[SDL] moving screen when u change resolution

David Olofson david at olofson.net
Fri Jan 28 15:12:43 PST 2005

On Friday 28 January 2005 23.44, Pete Elmore wrote:
> Bob Pendleton wrote:
> > My belief is that if you call SDL_quit(), change the environment
> > variables, and then call SDL_Init() and SDL_SetVideoMode() you 
> > see a change.
> This seems very dirty to me.  Environment variables are for the user 
> communicate with the program about how to run it, not for the 
program to 
> communicate with the library.  Adding support to the API (unless it 
> already exists) seems like a better solution than using environment 
> variables.

Right, but there are some problems:

 * Adding stuff to the API breaks binary compatibility
   in at least one direction.

 * The system variables are currently the only interface
   to certain features. Adding a "pure" C API means we
   have two ways of accessing the same data, which in
   turn means more chances to screw up.

 * We can't *replace* the system variable interface with
   a C API, since that would remove features that both
   users and applications rely on. That's actually worse
   than breaking binary compatibility in both directions.

Note that in general (that's the idea, anyway, I think), these 
features are much more frequently used the "normal" way than (ab)used 
by applications. So, the "dirty" usage is the exception; not the 

On the plus side:

 * The system variable interface is a portable
   user interface!

 * An application can both read the variables to
   see what the user wants, and affect what SDL does,
   using the same interface.

 * An application can also just ignore this interface
   entirely, *without* cutting off the link from the
   user to these SDL features.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---

More information about the SDL mailing list