OpenGL and SDL

im writing a really basic program using opengl and sdl. the problem is that it the rotating cube only turns when you move the mouse and stop when the mouse stops. what could be stopping this from doing it? Im following the instructions from the sdl site and i cant see why its just refreshing when the mouse moves.

you just forgot your animation cycle… try to have an idle time function just calling to render.

You cube only rotates in the mouse routine because it is the only place it is being called to be updated.

Switch from updating the display from the mouse routine, into a timer function or idle function.

Every X seconds update the screen, not sure about it in SDL, but look under timmer events in SDL.

void My_animation( void )
{
// X seconds passed
updateDisplay();
}

Originally posted by Lurking:
im writing a really basic program using opengl and sdl. the problem is that it the rotating cube only turns when you move the mouse and stop when the mouse stops. what could be stopping this from doing it? Im following the instructions from the sdl site and i cant see why its just refreshing when the mouse moves.