Sign in to follow this  
2xp

managin input with glut

Recommended Posts

hi i want to manage my character movements with glut. most of the functions i use come from nehe's tutorials. however, i found out that the app cannot manage multiple keyboard strokes, meaning i can only use one button then another button. this is quite impractical beacause i want to create an action game. do i have to use another library ? or do i have to implement more developed functions? thanks for the help i develop on MACOSX with cocoa

Share this post


Link to post
Share on other sites
First, disable key repeat (glutSetKeyRepeat).
Create an array keeping track of each key's state (up, down).
Use a glutKeyboardFunc callback to flag a key as being down.
Use a glutKeyboardUpFunc callback to flag a key as being up.

When you need to check the state of a key, read it up in the array.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if you are using glut anyways... you might as well upgrade once more & use another useful toolkit:

open scene graph

it will help you organize a lot of stuff in your action game
go check it out: GOOGLE -> Open Scene Graph

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