• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# Basic GLUT programming

This topic is 6858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, firstly I would like to say a big thankyou to all the guys that has helped me in the past.CHEERS!!!! Ive only just moved from using AllegroGL to proper Opengl - suddenly Ive got to think about windows programming and C++ with classes. Im well out of my depth, but I can understand GL pretty well, Ive decided on using GLUT as for the time it will shield me from all the nasty windows setup stuff. I want to convert some of the demos that can be found on the net - to glut as a training exercise (NeHe, Nates etc) My problem lies with the keyboard, I cannot use the standard glut keyboard function as this does not get called every frame update and results in a very slow response. Ive been informed that I could use "GetAsyncKeyState" in the idle function - trouble is I just cannot get the damn thing to work. Would somebody please be so kind as to write me the code I would need to check if the q key or right mouse button was pressed. I guess its time I invested in some easy windows programming books! THANKS.

##### Share on other sites
Hello! The problem you are having as i understand it is with the keyboard caching, and this can be solved by recording the users keystrokes before any redraw. This way, you could insert smoe code into the gl routine before the page gets drawn to screen, that would tell it to skip some of the keyes, if it was the sam key. Let me know if you still need help with the source-

bitburd
www.darkspiresoft.com

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 11
• 15
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
634151
• Total Posts
3015825
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!