[SDL] sleep threads in SDL?

Stephane Marchesin stephane.marchesin at wanadoo.fr
Sat Jan 29 12:38:36 PST 2005


Will Childman wrote:

>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();   
>}
>
SDL_Delay  ?

Stephane







More information about the SDL mailing list