Hi everyone,
Back in February I asked a question about SDL and speed. After a
couple responses I happily went on my way making sure to only update
small areas of the screen that needed it. Last night I realised that I
just need more speed no question about it. I really wonder if I’m doing
something wrong.
In my tests I initialize SDL, get me screen surface 1024x768x24
SDL_FULLSCREEN SDL_HWSURFACE. I load my bitmap, I do a
SDL_DisplayFormat. I then proceed to blit my 1024x768x24 image onto
that surface (this blit isn’t slow). I then run a loop 100 times that
simply does SDL_UpdateRects(screen,0,0,0,0)
Uint starttime SDL_GetTicks();
for (int c=0; c<100;c++)
{
SDL_UpdateRects(screen,0,0,0,0);
}
Uint endtime SDL_GetTicks();
int time = endtime - starttime;
printf(“average time: %i”,time/100);
the averate time takes about 103milli seconds. That seems like way too
slow. I have an Athlon 1200mhz 512megs of DDR memory, Geforce card with
32megs of DDR memory. My system bus runs at 133mhz so both sets of
memory are running at 233mhz. The UpdateRects should only be copying
under 2.5 megs each time. that is only copying across at about 2mhz.
This makes me really wonder what is going on. Shouldn’t it simply be
copying the 2.5 megs directly across to the screen?
I have tested this on many different machines, the results are similar.
Please any input on this, or ideas on how to get things up to speed are
definitely welcome.
thanks
Jaren Peterson