Is there a way to let a thread sleep in SDL? for example, how to implement
something like:
while(!done) {
…//handle events.
Uint32 timeElapsed = lastUpdateTime - SDL_GetTicks();
if (timeElapsed < 30) {
…//sleep for 30 - timeElapsed milliseconds.
}
redraw();
lastUpdateTime = SDL_GetTicks();
}
Thank you!