Original Post
I am writing some routines to draw 2d graphics with SDL library. The results are that I only get about 50 fps bliting a screen-size SDL_Surface.
I investigated that and I found that the bottleneck is in the SDL_Flip function. A dummy while calling SDL_Flip only gets 76 fps, while, for example, Quake 3 gets 180 fps in my computer.
I use all the hardware accelerate flags in video mode initialization:
bool motor2d::nuevoModoVideo(int resX,int resY,int ppp,bool fullScreen)
{
int flags;
flags = SDL_HWPALETTE | SDL_DOUBLEBUF;
if (fullScreen)
flags |= SDL_FULLSCREEN;
if (videoInfo->hw_available)
flags |= SDL_HWSURFACE;
else flags |= SDL_SWSURFACE;
if (videoInfo->blit_hw)
flags |= SDL_HWACCEL;
if ((m_pPantalla = SDL_SetVideoMode(resX, resY, ppp, flags )) != NULL)
return true;
return false;
}
Someone has the same problem?
Thanks.