Keyboard responsiveness

Hi!

I hopefully can assume most people here tried the NeHe tutorials. I just had a question about the key handling. All the tutorials I tried that used the keyboard with glut were very slow. I got around this by putting the calcs that make the next screen (updates of rotations, etc.) in the Idle function and at the end there calling a glutPostRedisplay();

I allso tried the SDL versions of these tutorials, and the keyboard reacted even slower! Why is this, and how can this be sped up?

Maybe somebody has a keyboard handling function that works good for games (like in quake or something thats real smooth and can handle a lot of keypresses).

John

If you are familiar with X11 and Xlib, you could create an OpenGL app that accesses the X11 message loop directly, and this is probably the fastest way to handle the keyboard under X.

I’ve made a very small sample application that handles keyboard input this way, but it is a Glide application, not OpenGL.

check www.voodooextreme.com/glide3tutorial/
and download the linux example of the spinning cube tutorial.
This should get you started on how to handle the keyboard.
Of course, the windows this program creates, is not OpenGL-capable. If you have problems changing the code to create an OpenGL window, just email me.
http://www.voodooextreme.com/glide3tutorial/html/download.htm

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.