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

Alex Barry alex.barry at gmail.com
Wed Mar 20 11:09:41 PDT 2013


Two processes is an option, it just means adding in some extra logic into
my application, which isn't a huge problem, but I was wondering if there
may have been a different or better solution.

Thanks for the advice, Sam,
-Alex

On Wed, Mar 20, 2013 at 12:51 PM, Sam Lantinga <slouken at libsdl.org> wrote:

> If you're using NVIDIA binary drivers, hardware acceleration isn't
> disabled with Xinerama.
>
> SDL provides an API to query the displays and get their relative
> positions, so you should have all the info you need to do it in a single
> process.
>
> If you really do need two X servers then you'll need two processes, or to
> radically change the x11 video driver in SDL.
>
>
> On Wed, Mar 20, 2013 at 7:39 AM, Alex Barry <alex.barry at gmail.com> wrote:
>
>> 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
>> available.
>>
>> 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
>> another.
>>
>>
>> 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
>>>>> <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.
>>>
>>> _______________________________________________
>>> 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
>>
>>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130320/d69b9ee4/attachment-0009.htm>


More information about the SDL mailing list