[SDL] Optimal mode from SDL_GetVideoMode

benang at cs.its.ac.id benang at cs.its.ac.id
Thu Oct 5 20:58:32 PDT 2006


>
>> Keep in mind that plain X11 is always software rendered, and therefore
>> not terribly fast (but fast enough for most uses). To remedy this, you
>> must either 1) use OpenGL instead of the 2D API, or 2) wait for SDL
>> 1.3, which will provide an OpenGL backend for the 2D API.
>
> Yeah, the X11 target returning 0 for available video memory is not a
> bug; there are no hardware surfaces.
>
> While it's not a fast path, it should _not_ kill your performance,
> generally...I have yet to see a 2D game that couldn't manage with
> software surfaces, even when doing a fair bit of alpha blending. Usually
> the bottleneck is converting data formats during blits, so be sure to
> preconvert them! Otherwise, never call SDL_UpdateRect or SDL_Flip until
> forced to.
>
> Or use OpenGL, of course.
>
> --ryan.
>

I get it. And here I thought there's an error in my graphics card. Well, I
didn't store the image in RWops type. I converted them when I read all the
bitmap files to Surfaces so it should pose a problem. Also I only call
SDL_Flip once in every loop. Or maybe I should've add some algorithm to
check whether the surface is updated (so I don't have to Flip the screen)
or not to improve the performance?






More information about the SDL mailing list