Sign in to follow this  
illad

OpenGL OpenGl AutoRepeat Issues

Recommended Posts

My code upto now is attached.
It is some very basic code for a Pong game.


Two issues here...

1. Cannot figure out how to make the motion of the paddles instantaneous and smooth.
2. In the code, I think ive written it such that the paddle speed is 0 when i release the direction keys. But it doesn't seem to work

Thank you guys!

Share this post


Link to post
Share on other sites
This is input code; OpenGL has nothing whatsoever to do with input - it's for graphics only and nothing else.

It's also GLUT. GLUT isn't OpenGL and OpenGL isn't GLUT. GLUT is a simple and relatively high-level framework for handling [i]some[/i] of the required OS interaction stuff in a portable manner. It's a layer between OpenGL and your OS, and that's all. It's also not intended to be fully-featured in these respects, so it's probably not a suitable choice for game input.

My advice? Port to something like SDL instead.

Share this post


Link to post
Share on other sites
[quote name='mhagain' timestamp='1310680252' post='4835447']
This is input code; OpenGL has nothing whatsoever to do with input - it's for graphics only and nothing else.

It's also GLUT. GLUT isn't OpenGL and OpenGL isn't GLUT. GLUT is a simple and relatively high-level framework for handling [i]some[/i] of the required OS interaction stuff in a portable manner. It's a layer between OpenGL and your OS, and that's all. It's also not intended to be fully-featured in these respects, so it's probably not a suitable choice for game input.

My advice? Port to something like SDL instead.
[/quote]


Thank You, but I knew that this was a GLUT issue.
I just couldn't find the concerned forum. Sorry to waste your time


Share this post


Link to post
Share on other sites
I don't have any experience about GLUT, but the basic idea is to make variables for the keys. For example bool keyUp, and set keyUp to true when the up key is pressed (and set it false when the key is released). Now... when you update the scene, if(keyUp == true) movePaddle();

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this