[SDL] Memory leaks, output with debug SDL lib
pphaneuf at gmail.com
Thu May 21 07:20:54 PDT 2009
On Thu, May 21, 2009 at 9:38 AM, Leonardo Guilherme
<leonardo.guilherme at gmail.com> wrote:
> Since you're using SDL, you can use SDL_Delay to stop the while for 10 or 20
> ms, and that is far enough to free your cpu.
If Bruno is using SDL 1.3, he can also use SDL_WaitEventTimeout and
set the timeout to attain a specific frame rate. Check SDL_Ticks, draw
a frame, then use min(0, previous_ticks + 16 - SDL_Ticks()) to aim for
roughly 60 fps, for example (where 16 is 1000 / 60, rounded down).
More information about the SDL