[SDL] Open several SDL windows on multihead X

Jonathan Atkins jcatki at home.com
Thu Jun 14 19:00:05 PDT 2001


Gernot Ziegler wrote:

> I know that it is possible to do that by setting the environment variables
> _before_ starting the program, but since I can't change them in the
> program (or can I ?)

putenv might do the trick...
putenv("DISPLAY=:1");
would set the display to the :1 display (which is usually the second head...)

you might also consider that if SDL fails to open on the new display that you should revert back to the old one, and then reopen your SDL window/screen and tell the user that it failed...to get the current value of the display there's of course, getenv("DISPLAY") which returns the value of DISPLAY (or NULL if  it isn't set, fancy that).

Cheers,

	Jon Atkins (LIM the Long Island Man)



More information about the SDL mailing list