[SDL] SDL_ANYFORMAT
Matthijs Hollemans
matthijs at allyoursoftware.com
Thu Oct 10 02:25:01 PDT 2002
Hi all,
When setting up the video mode for my game I want to accomplish the
following: if I can get a HWSURFACE with DOUBLEBUF, in any
bits-per-pixel mode, I'll take it. Otherwise, I want to use a
SWSURFACE, not a HWSURFACE without DOUBLEBUF. The reason for this is
that all of my testing shows that a hardware surface without page
flipping tears like crazy, but for a software surface it isn't even
all that bad (probably because the contents of the software surface
are blitted to the framebuffer in one go).
Is there any way I can specify this in the call to SDL_SetVideoMode?
AFAIK, SetVideoMode will first try HWSURFACE | DOUBLEBUF, and if
that fails, it will automatically try HWSURFACE, followed by
SWSURFACE. (This is independent of the SDL_ANYFORMAT flag, which I
believe only means "do not emulate the requested bits-per-pixel
mode" -- it doesn't have anything to do with the hardware/software
surface decision.)
My code currently first checks to see if the request video mode is
available with SDL_VideoModeOK. It is unclear to me if this has the
same semantics as SetVideoMode. In other words, does it
automatically fall back to a HWSURFACE if the DOUBLEBUF is not
available, and to a SWSURFACE if no HWSURFACE is available? I hope
not...
Thanks,
--
Matthijs Hollemans
All Your Software
www.allyoursoftware.com
More information about the SDL
mailing list