PDA

View Full Version : Keyboard interaction opengl problems



moody
12-05-2011, 12:57 PM
I have a program which is supposed to rotate a cube. When I click in the File menu "New Cube" to render the solid the cube shows up,but when I press a key, he doesn't rotate.
If, instead, I render the cube immediately (inside the main loop) instead of just clicking "New Cube" (which would be rendered inside a case statement on the WindowProc), and I press the appropriate keys, the cube rotates like it's supposed to.
The case statement of "New Cube" has 2 functions: Initialize() function which enables lighting and depth and a Render function() which does the transformations on the cube.
The main loop has a GetMessage(...),TranslateMessage(..) and DispatchMessage(...) only.
The keys are checked in the WIndowProc with WM_KEYUP and WM_KEYDOWN and cases which check if it was pressed the left or right arrow keys and act accordingly.

Any help is very much appreciated!Thank you in advance.

BionicBytes
12-05-2011, 02:59 PM
What do you want anyone to do with your post?
There's nothing to go on other than pure speculation.
Secondly none of this has anything to do with an OpenGL question.