[SDL] Opening windows on different X displays (Ubuntu 12)

Gabriel Jacobo gabomdq at gmail.com
Wed Mar 20 06:17:36 PDT 2013


Most of this is untested and a lot of it pulled from memory, so excuse me
if you tried this already and it didn't work...

SDL scans for available screens in the current X11 display, and creates a
new SDL_VideoDisplay for each (yes, the names are confusing).

So, my strategy would be to call SDL_GetNumVideoDisplays to check that
there are actually two displays available, then SDL_GetNumDisplayModes for
each display, and iterate those two using SDL_GetDisplayMode to find a
suitable mode for each screen (or just wing it and
use SDL_GetCurrentDisplayMode)

Then, create two windows, and use SDL_SetWindowDisplayMode on each with the
modes you found in the previous step, and finally go full screen... did you
try this? Does it not work?

Also, full screen on Xinerama systems works fine AFAIK, if you change the
resolution of the desktop you get some hiccups when restoring the
resolution though.




2013/3/20 Alex Barry <alex.barry at gmail.com>

> Separate X11 displays is very relevant, as I want to open one window on
> the left screen, and one on the right using the one instance of an
> application.  There is no fullscreen problem at all.
>
> I can throw in a `export DISPLAY=:0.1` in there, but then both windows
> will end up on the same X11 display.
>
> Also, I'm use SDL2, not 1.2.
>
> On Wed, Mar 20, 2013 at 3:45 AM, Petr Pisar <ppisar at redhat.com> wrote:
>
>> On Tue, Mar 19, 2013 at 10:45:20PM -0400, Alex Barry wrote:
>> > Full screen works fine for me in Ubuntu 12 with AMD Catalyst drivers.
>> >
>> This is irrelevant in your set-up as separete X11 screens behave
>> independently. The full-screen problem is about xrandr multi-head one big
>> screen consisting of more monitors.
>>
>> In my opinion, current SDL-1.2 full-screen handling is still not ideal
>> and it
>> misbehaves in some cases, but as user can decide which way to go using
>> environment variable, it's still better than before. (See
>> <https://bugzilla.redhat.com/show_bug.cgi?id=859907#c2>.)
>>
>> -- Petr
>>
>>
>> _______________________________________________
>> SDL mailing list
>> SDL at lists.libsdl.org
>> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>>
>>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>


-- 
Gabriel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130320/6c86ff62/attachment-0009.htm>


More information about the SDL mailing list