[SDL] Re: moving screen when u change resolution

Bob Pendleton bob at pendleton.com
Mon Jan 31 07:50:44 PST 2005

On Fri, 2005-01-28 at 20:27 -0700, Rainer Deyke wrote:
> Jon Colverson wrote:
> > As mentioned at:
> > http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fenvvars
> > neither users nor applications should be relying on the
> > environment variables; they aren't part of the API.
> If there was no need to access this functionality, these environment
> variables wouldn't exist in the first place.  That said, I wouldn't mind at
> all if these environment variables were replaced with functions in the C
> API.
> > SDL_VIDEO_CENTERED looks like the only variable which
> > provides potentially portable functionality, and as such,
> > I think it would be a good candidate for being added to
> > the C API (presumably as a flag for SDL_SetVideoMode(),
> > which I believe could be added without breaking binary
> > compatability in any direction).
> I'd like to see at least the following in the C API:
> SDL_VIDEODRIVER (plus some way of enumerating available video drivers)

I'd be surprised if that one every became available through a C API. It
is a hack that is only supported by a small number of video drivers.
Making it an environment variable means that only the drivers that
support it need to even be aware that it exists. OTOH, making it a
standard part of SDL means that *every* driver has to have code to
handle it, even if all the code does is return an error message. 

The same thing is true of the SDL_VIDEO_CENTERED but a flag is a lot
easier to ignore than an API.

> SDL_AUDIODRIVER (plus some way of enumerating available audio drivers)

In most cases video and audio driver selection is moot. You rarely have
more than one choice. When you do it is usually the case that one is
automatically used as a fall back for a better driver. Or, in some cases
the alternative driver requires special permission to use. Consider the
difference between the X driver and the other Linux drivers. Anyone can
run an SDL_X11 program, but using the DGA requires you to have root
privileges. On windows, when would you use the DIB driver if you could
use the DirectX driver?

		Bob Pendleton

More information about the SDL mailing list