PDA

View Full Version : how to give user input through keyboard/mouse when a continuous loop is exceuted ?



arnott
05-15-2000, 04:50 PM
Hi ,
We are trying to display molecules at different time frames and we want to user to be able to vary some display parameters ,after a time frame.But the display function
exceutes everything at a stretch.

how to give input to the program and if no input is given , the program should run with its default values.

thank you.

regards
arun

[This message has been edited by arnott (edited 05-15-2000).]

Gorg
05-15-2000, 05:36 PM
The thing to do is to read the input in your loop.

example:

if you use Win32. When you make your loop, test to see if there is a message in the message queue. If there is one process it. In the message queue, you'll get all the input of the users, system calls, etc.

I suggest you go take a look at some tutorials that draws and have input.
http://nehe.gamedev.net/

This nehe's page, the tutorials are for opengl, but by looking at them, you'll understand a way to do input.

Glenn Upton
05-17-2000, 11:38 AM
Also see the back section in the OpenGl SuperBible on multithreading and real-time application programming. Exactly what you are looking for.