[SDL] Windows XP speed problems
Martin Konrad
mkon at gmx.de
Wed Nov 13 10:10:01 PST 2002
> Martin Konrad wrote:
>
> > t0 = SDL_GetTicks();
> > SDL_BlitSurface(...)...
> > t1 = SDL_GetTicks();
>
> GetTicks precision is about +-10msec, so using it for a benchmark is not
> correct for calls fast as SDL_BlitSurface!
>
> Try something like:
>
> t0 = SDL_GetTicks();
> for(i=0; i<100; i++ )
> SDL_BlitSurface(...)...
> t1 = SDL_GetTicks();
>
> t2 = SDL_GetTicks();
> for(i=0; i<100; i++ )
> SDL_Flip...)
> t3 = SDL_GetTicks();
>
> In this way you SHOULD be able to understand in a more reliable way
> where your time is lost (and probably it is in SDL_Flip for the hw
> refresh sync).
The precision is not the problem.
For 1/60 second I get a value between 16 and 17, and it's definately lost
with the first blit or fill. So, I get either 0 or 16/17.
Testing the time with 100x SDL_Flip() and nothing else doesn't help. The
time is only lost when there are about 20 or more blits in the main loop with
both blits and SDL_Flip().
--
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
More information about the SDL
mailing list