PDA

View Full Version : Is Glut no good for games?



DJKAOS
08-26-2001, 10:03 AM
Just wondering if its a bad Idea to use glut for making a openGL game? From what I have played around with it seems like Glut reacts slower to keyboard input..like if I hold a key down it doesnt seem to repeat that key as fast as windows code does?

mikael_aronsson
08-26-2001, 01:43 PM
Hi !

There are plenty of games done with GLUT so I think it should work fine, not sure if it is crappier at keyboard input though, I havn't used it in a long time.

Mikael

zed
08-26-2001, 02:23 PM
u need to turn glutignorekeyboardrepeat(..)sp? on .
and + use the glutkeyboard(..) + keyboardUp(..) functions

(check the help or headers for the correct spelling/syntax)

+ use someit like so
bool KEYA_pressed = false;

void keybaord
{
switch (key)
case 'a': KEYA_pressed = true; break;

}

void keyboardup()
{
switch (key )
case 'a': KEYA_pressed = false; break;
}

mainloop()
{
if (KEYA_pressed == true ) do someit
}

gimp
08-27-2001, 01:33 AM
I seem to remember reading somewhere that glut only calls the idle func 18 times a second so it was only good for games that don't require frequent update loop. I think it read it in Thatcher Ulrich's Quadtree landscape demo.

Check it out before hand, that would really screw you if so as glut takes control once you start it up...

Osku
08-27-2001, 09:14 AM
Search for GetAsyncKeyState() at http://msdn.microsoft.com. It works great and you can also check for shift, ctrl etc. You can also press several key simultanously.

Osku

grady
08-28-2001, 03:25 AM
I think SDL is easier to use than glut. And you don't have to use the stupid "glutMainLoop". www.libsdl.org (http://www.libsdl.org)

MrShoe
08-28-2001, 09:51 PM
Are you totally sure you HAVE to use the glutMainLoop?? I have never tried, but it may be possible NOT to use it and instead use the program as if it were Win32 OpenGL... Im just speculating here...

Bob
08-29-2001, 01:08 AM
When entering the mainloop, GLUT creates a context, creates the window and starts calling your callback functions. Note, the window and the OpenGL rendering context, is not created until you call glutMainLoop.

So if you don't like glutMainLoop, you must create the window and the context yourself, and start calling your display/resize/idle/keyboard/mouse functions yourself. And not only do you have to call your keyboard/mouse functions, you must get the keypress/mousecoord yourself aswell.

So, to sum it up, GLUT is totally useless without glutMainLoop. It does not provide any kind of service, apart from rendering some basic primitives, like cubes, spheres, cones, and stuff like that. Totally useless.

Rob The Bloke
08-29-2001, 03:16 PM
You can do games in glut, there are however better ways.....

cityhunter
08-30-2001, 12:57 AM
how?

Obli
08-31-2001, 01:10 PM
http://www.tuxracer.com

A cool Glut-based game.
Too bad it doesn't run on my PC and runs slower than many other games on other PCs...