PDA

View Full Version : branch in render()



firegun9
02-28-2005, 08:08 PM
I have a render method like this:

(cnt is a global variable)
render(){
...
cnt++;
glutWireCube(1.0);
if(cnt > 1000)
glutSolidCube(1.0);
glutSwapBuffers();
}

When cnt>1000, the wire cube disapeared, and the solid cube isn't drawn.

Is it not allowed to have brance statement in the callback function for glutDisplayFunc()?

firegun9
02-28-2005, 08:52 PM
never mind.
I find the problem.

I have to resize the window to re-compute the matrix.