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

Reto Schneider mailinglisten at reto-schneider.ch
Sat Mar 23 07:54:19 PDT 2013

I think the forum thread "SDL2 and Multiple Screens in Linux" [1] is

To me this is a real issue as well. I have a notebook with a triple head
setup. The first display (internal monitor) is driven by the integrated
Intel graphics card. Both external monitors (2nd and 3rd display) are
attached to the Nvidia graphics card.
Unfortunately, AFAIK it is not possible to have both graphics cards
offering GLX which forces me to disable the acceleration of the first

+++++++++++++++++++++ ++++++++++++++++++++++++ ++++++++++++++++++++++++
+                   + +                      + +                      +
+ internal monitor  + +  external monitor 1  + +  external monitor 2  +
+  :0.0  (no GLX)   + +   :0.1  (with GLX)   + +   :0.2 (with GLX)    +
+                   + +                      + +                      +
+++++++++++++++++++++ ++++++++++++++++++++++++ ++++++++++++++++++++++++

As SDL always opens up the display on the first screen and given the
fact that there is no GLX available, SDL does not work for applications
which require OpenGL acceleration (passing SDL_WINDOW_OPENGL to
SDL_CreateWindow). I do not have this problem for any SDL 1.2
applications as SDL 1.2 respects the DISPLAY variable.

Am I doing stuff wrong (please have a look at the attached test program)
or is my setup just unsupported by the current SDL2 state?

1: http://forums.libsdl.org/viewtopic.php?t=8812

On 03/20/2013 03:39 PM, Alex Barry 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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: separatescreenissues.c
Type: text/x-csrc
Size: 977 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130323/94f209e3/attachment-0009.c>

More information about the SDL mailing list