Another day, another question =)
Let’s say i have a game that have a menu screen in fullscreen 640x480
resolution, while the actual game runs in fullscreen 800x600 (i
don’t, but i ask anyway). What would be the correct way of changing
the resolution ?
IMHO, the only correct way is not to do it at all. Some monitors take
incredibly long to detect the new resolution after a change (several
seconds before you get a solid image is “normal”), so games that change
resolution all the time can be very frustrating.
Besides, that’s two resolutions that have to be configured and ensured
working - another reason to avoid such solutions.
BTW, another thing I don’t like is games that switch between SDL 2D and
OpenGL rendering. Reinitializing with/without OpenGL also results in all
sorts of artifacts on some targets, and the results graphics tend to look
very different between the modes, especially if different resoutions are
used.
Sure, software rendering for the 2D stuff is a nice way to make sure that
people can access the configuration (rather than deleting the config file
if they happen to set an unsupported resolution…), but I think the
whole game should use the same rendering method once it’s known that
things are actually working. (One could check for “frenetic hammering on
ESC”, and switch to the emergency 2D mode if that’s detected. In fact, I
think I’ll implement that in Kobo Deluxe, or perhaps even build it into
the “Spitfire Engine”.
Will a call to SDL_SetVideoMode destroy the current
screen structure and create a new based on the new data, or is it
necessarry to quit and reinit the video subsystem ?
SDL_SetVideoMode() should work for changing resolution. (That’s how you
do resizable windows with SDL.)
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Wednesday 10 October 2001 23:24, Trick wrote: