The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
[X11] SDL_CreateWindow in secondary x screen (DISPLAY 0.1)?
bullale


Joined: 05 Jun 2015
Posts: 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.

Thanks in advance for any help.