[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: SDL and multiscreen



> Le 28/05/2011 15:23, Darren Salt a écrit :
> > I've had enough problems with games (usually SDL-using ones) starting in
> > full-screen mode then NOT RESTORING THE PREVIOUS SETUP ON EXIT, effectively
> > switching from multi-head to single-head, such that my answer to this is:
> > _ _ ___ _
> > | \ | |/ _ \| |
> > | \| | | | | |
> > | |\ | |_| |_|
> > |_| \_|\___/(_)
> >
> > Yes, it's trivially fixable with xrandr (and I have a shell script for that),
> > but then I usually still need to move windows back to where I want them.
> >
> > I shouldn't need to do that.
> >
>
> As a maintainer of a game (upstream) which uses SDL :
> 1/ I am interested in your script to fix this problem (even if the game
> runs on MS windows too, so the xrandr solution is only a partial workaround)
>
> 2/ afaik, SDL 1.2(.14) does not handle multiscreen correctly, so i am
> just waiting for SDL-1.3 (june 2011 iirc) which should solve this
> problems definitely.
>
> Best regards
> Alain .
>
>

If I remember correctly (from a message to debian-devel a couple of years ago), changing screen modes is no longer supported.
 
Quote:
  There is a bug in Red Hat's bugzilla and I talked with various xdevs about
  this, but it is not trivial to fix for them, or so I've been told.
  Also we don't need to fix all games, most use a handful if libs, for
  Fedora those 3 patches are all that is needed.
  Also note that xf86vidmode is considered sort of deprecated by upstream xorg,
  so the chances of getting this fixed there are not too good.
 
This is why ClanLib no longer supports fullscreen, via changing the screen mode.
 
If using OpenGL, it is easier to scale the game window (for example 640x480) to fill a borderless window containing the whole screen.
 
 
With modern graphics cards and LCD monitors there's little sense in changing the actual screen resolution anymore. A much better approach is to render to an off-screen texture that has the size you desire, then stretch that one to the size of the back-buffer and flip that to front.
 
It has the following benefits:
 1.You escape the resolution changing problem with 3d applications
 2.With modern graphics cards the last stretching operation is very cheap
 3.Because you stretch it yourself, it is not the LCD monitor hardware that stretches it. You control the quality of the stretch now
 4.Alt-tabbing is much more pleasant now.
 5.You better support the situation where a gamer might want to be both logged into your game and do other stuff (particular important for mmorpgs and turn based games)
 6.No need for complex tricks to ensure the resolution is restored if your application crashes or hangs

 
This is the reason ClanLib removed support in 2009
 
 
  		 	   		  

Reply to: