[SDL] Re: moving screen when u change resolution
bob at pendleton.com
Mon Jan 31 13:32:22 PST 2005
On Mon, 2005-01-31 at 20:52 +0100, Stephane Marchesin wrote:
> Bob Pendleton wrote:
> >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 nice thing about a backend selection API is that you don't need
> support from all the backends :)
Yep, you are correct on that. The back end selection is done before the
backend is intialized. I was wrong on that one. There is even a comment
in that code saying that it will be replaced at some time.
> >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?
> If your application is alpha blitting intensive you don't want the
> DirectX driver, because alpha blits to screen will become prohibitively
So, as a programmer, *you* set the environment variable to the value you
want. In this example you don't need to know which back ends are
available, you just set the variable to request the one you want, and
then you have to live with the one you get. The end users version of SDL
may not have both windib and directx support compiled in.
> Similarly, you don't want to use glSDL if your application wasn't tuned
> for it, because you will very likely get very bad performance.
> Also, if the application has the backend selection interface available,
> it can in turn give the user a friendly interface to choose betwen the
> different audio/video backends. Not everyone knows how to setup an env
I think we are talking across each other here. It is rare that an end
user will ever set an environment variable to select a back end of any
kind.... Unless of course the documentation that comes with the program
tells them to do it and tells them how to do it.
The way things are is mostly for the programmer and rarely of interest
to the end user.
> That said, such a mechanism would probably be the cause for a lot of
> trouble too.
> SDL mailing list
> SDL at libsdl.org
More information about the SDL