View Full Version : Is Glut no good for games?
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?
08-26-2001, 01:43 PM
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.
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;
case 'a': KEYA_pressed = true; break;
switch (key )
case 'a': KEYA_pressed = false; break;
if (KEYA_pressed == true ) do someit
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...
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.
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)
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...
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.....
08-30-2001, 12:57 AM
A cool Glut-based game.
Too bad it doesn't run on my PC and runs slower than many other games on other PCs...
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.