View Full Version : help in game graphics using OpenGL

Chirag Varde
01-21-2011, 05:03 AM
Hi friends

Currently I am developing a classical 2d game. In the game there are bricks in the upper screen and the bricks are to be broken by ball and we can move the paddle right and left. Hope you understood the game as I do not know the standard name for it.

So the problem is when I am trying to give keyboard input, it is not that smooth. I mean if I keep on pressing a key, say left key, then the number of times that input is read in a second by OpenGL is finite and which that finite number of inputs I am unable to smoothly animate the paddle. I am using the glutKeyboardFunc(); for taking user input. Suggest me if there is any better way of giving input so that the paddle animates smoothly.

01-21-2011, 05:23 AM
Use GLFW instead of struggling with GLUT for that.
Otherwise the idea is to only get events for key down and key up.

Chirag Varde
01-21-2011, 05:45 AM
yeah the second one worked. :D