Invalidate method
-
I'm drawing graphics with OpenGL in an MDI application. In my OnDraw() function, I have the following portion of code: if(spin==1) { Y_Angle++; Invalidate(TRUE); } I have a button which makes spin=1. So when I press this, Y_Angle will continue to increment and then Invalidate(TRUE) redraws the scene each time, giving the appearance of continuous rotation. This works fine. Problem is, when I click any menu thats supposed to bring up a dialog box, the box doesn't come up. I have a feeling this has something to do with Invalidate(TRUE) continuously redrawing the scene. How can I fix this?
-
I'm drawing graphics with OpenGL in an MDI application. In my OnDraw() function, I have the following portion of code: if(spin==1) { Y_Angle++; Invalidate(TRUE); } I have a button which makes spin=1. So when I press this, Y_Angle will continue to increment and then Invalidate(TRUE) redraws the scene each time, giving the appearance of continuous rotation. This works fine. Problem is, when I click any menu thats supposed to bring up a dialog box, the box doesn't come up. I have a feeling this has something to do with Invalidate(TRUE) continuously redrawing the scene. How can I fix this?
First of all, I'll make sure it is the continuous calling to
Invalidate
that is causing the problem. To determine this, simply comment the call out and check if the dialog box appears now. Assumming that is indeed the problem, try setting a timer and callingInvalidate
there. Check Nemanja Trifunovic's Timers tutorial for further info on timers. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo