Advertisement

GLUT

Started by August 12, 2000 12:39 PM
5 comments, last by Ched45 24 years, 3 months ago
Can U use the up/down left/right arrows in GLUT and if so what are they called? Thanx --Ched-- --Ched-- chris@ched45.com
--Ched--chris@ched45.com
glut does have help look in the man folder, in the glut directory

void mySpecial(int key, int x, int y)
{
switch(key)
{
case GLUT_KEY_RIGHT:
game.mario.right_key_pressed = true; break;
case GLUT_KEY_LEFT:
game.mario.left_key_pressed = true; break;
case GLUT_KEY_UP:
game.mario.up_key_pressed = true; break;
case GLUT_KEY_DOWN:
game.mario.down_key_pressed = true; break;
}
}

glutSpecialFunc(mySpecial);
Advertisement
thing to note (this asumes you are using M$ Windoze):

If you are tring to write a proper, I''m-going-to-sell-this type game, you shouldn''t realy use GLUT for keyboard (or anything for that matter). Use DirectInput. I know it sucks, but its that(groan), GLUT(grrooan) or Windows Msgs(arrggggghh). (or you could just not have any input )

Also, I''m not saying that your doing it or not doing it, but, if you want your game to be good, then you should realy have a way of customising the keys, etc.

Andrew
Error, no keyboard - press F1 to continue.

SLARTIBARTFAST00 PLEASE SELECT WITTY .SIG: NoneWho is General Failure and why is he reading my disk?Microwave: Signal from a friendly micro...Multitasking: Screwing up several things at once...How do I set my laser printer on stun?Sarr! The spellchecker kinna take this abuse!
Thanx for the help. The games my first ( just a small maze ), don''t think its gonna hit the shops anytime soon....LMAO


Thanx again



--Ched--
chris@ched45.com
--Ched--chris@ched45.com
Yeah, Hey.

BTW, I''m working on my first game (bit more complex than a maze). Your maze, tile based? Do you have any recomendations for perspective-tile based game engines? (BTW, I have another thread for it)
SLARTIBARTFAST00 PLEASE SELECT WITTY .SIG: NoneWho is General Failure and why is he reading my disk?Microwave: Signal from a friendly micro...Multitasking: Screwing up several things at once...How do I set my laser printer on stun?Sarr! The spellchecker kinna take this abuse!
I aren''t using an engine....this is just gut OpenGL graphics with some C stuck in...lmao. If anyone saw the source code they''d have a fit at how untidy it is...lmao

Don''t know of any 3D engines sorry.

Good luck with your game

--Ched--
chris@ched45.com
--Ched--chris@ched45.com
Advertisement
im sure if youre writing a game that u are actually gonna finish and sell then u dont need to be told what to use input wise

"Premature optimization is the root of all evil" (Donald Knuth).

im working on a opensource tilebased game see empires at
http://members.xoom.com/myBollux

This topic is closed to new replies.

Advertisement