[X11] SDL_CreateWindow in secondary x screen (DISPLAY 0.1)?

Hello,

I am using an NVidia GTX970 with Ubuntu 14.04 and I have two different physical displays setup as separate X screens via /etc/X11/xorg.conf
SDL_GetNumVideoDisplays finds my two different physical displays, though they both have a position of 0,0. (one is 1920x1080, the other is 1080x1920)

  1. Does SDL2 have any way of knowing which ‘screen’ a display belongs to? If not, then maybe during enumeration I just have to increment a screenIdx everytime I find a new display with position 0,0?

  2. Does SDL2 have any way of creating a Window on a non-primary screen? Currently, if I try to position the Window beyond the bounds of my first monitor, it just ends up on the right of my first monitor.

If this is not currently possible then maybe this should be an added feature. Having a secondary x screen is really the best way to get VR HMDs to work well in Linux. (Other annoying options require making the HMD the first display so it drives the VSync, but this is an annoying configuration for non-VR tasks making it necessary to use xrandr scripts to switch everything around).

BTW, I am specifically interested in getting this working with Unreal Engine 4. See relevant question here (https://answers.unrealengine.com/questions/238272/linuxvrhow-to-place-window-on-display-01.html).

Thanks in advance for any help.

Hi,

I?m running into this issue as well, and it?s preventing a port of libavg (www.libavg.de) from SDL 1.2 to SDL 2.0. Under SDL 1.2, it was possible to set the DISPLAY env variable just before calling SDL_CreateWindow and have the window appear on the appropriate display. Unfortunately, I can?t get this to work anymore.

For our test system, SDL_GetNumVideoDisplays returns 2, and SDL_GetDisplayBounds returns (0,0,3840,3240) for both displays. SDL configure shows that xrandr and xinerama are both active. Fiddling around with various values for SDL_HINT_VIDEO_X11_xxx had no effect.

Any ideas?

Cheers,

UliOn 06.06.2015, at 03:06, bullale <chadwick.boulay at gmail.com> wrote:

Hello,

I am using an NVidia GTX970 with Ubuntu 14.04 and I have two different physical displays setup as separate X screens via /etc/X11/xorg.conf
SDL_GetNumVideoDisplays finds my two different physical displays, though they both have a position of 0,0. (one is 1920x1080, the other is 1080x1920)

  1. Does SDL2 have any way of knowing which ‘screen’ a display belongs to? If not, then maybe during enumeration I just have to increment a screenIdx everytime I find a new display with position 0,0?

  2. Does SDL2 have any way of creating a Window on a non-primary screen? Currently, if I try to position the Window beyond the bounds of my first monitor, it just ends up on the right of my first monitor.

If this is not currently possible then maybe this should be an added feature. Having a secondary x screen is really the best way to get VR HMDs to work well in Linux. (Other annoying options require making the HMD the first display so it drives the VSync, but this is an annoying configuration for non-VR tasks making it necessary to use xrandr scripts to switch everything around).

BTW, I am specifically interested in getting this working with Unreal Engine 4. See relevant question here.

Thanks in advance for any help.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Any technology distinguishable from magic is insufficiently advanced.

Ulrich von Zadow | +49-172-7872715
Jabber: zadow at xmpp.imld.de
Skype: uzadow


Any technology distinguishable from magic is insufficiently advanced.

Ulrich von Zadow | +49-172-7872715
Jabber: zadow at xmpp.imld.de
Skype: uzadow