[SDL] Opening windows on different X displays (Ubuntu 12)
alex.barry at gmail.com
Wed Mar 20 07:39:17 PDT 2013
Xinerama isn't an option because i need hardware acceleration (which I'm
under the impression that it gets disabled with Xinerama enabled) - I am
enumerating with SDL_VideoDisplay, but the problem is that the SDL_Rect
boundary for both screens start at 0, which means they get placed in the
same Display, because SDL isn't aware that there are multiple X displays
I did notice that using SDL_GetWindowWMInfo() gives me access to a X11
Display*, but I don't think it gives me the ability to get more information
on the different X11 Displays or how to move a window from one Display* to
On Wed, Mar 20, 2013 at 9:17 AM, Gabriel Jacobo <gabomdq at gmail.com> wrote:
> 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
>>> -- Petr
>>> SDL mailing list
>>> SDL at lists.libsdl.org
>> SDL mailing list
>> SDL at lists.libsdl.org
> SDL mailing list
> SDL at lists.libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL