Flags for SDL_CreateWindow Full screen with multi monitors

Hi All,
I’m using Ubuntu 130.4 with SDL 2. I need to run on multiple monitors. I’ve got my code up and running however I’m unable to screens to run correctly in full screen mode.
I’m running dula monitors on ATI catalyst set up for 2 screens, so it shows multi display desktop with 2 displays. Xorg.conf shows two moitors display with 1920x1080

Code:

Section "Monitor"
Identifier "0-DFP2"
Option “VendorName” "ATI Proprietary Driver"
Option “ModelName” "Generic Autodetecting Monitor"
Option “DPMS” "true"
Option “PreferredMode” "1920x1080"
Option “TargetRefresh” "60"
Option “Position” "0 0"
Option “Rotate” "normal"
Option “Disable” "false"
EndSection

Section "Monitor"
Identifier "0-CRT1"
Option “VendorName” "ATI Proprietary Driver"
Option “ModelName” "Generic Autodetecting Monitor"
Option “DPMS” "true"
Option “TargetRefresh” "60"
Option “Position” "1920 0"
Option “Rotate” "normal"
Option “Disable” "false"
Option “PreferredMode” "1920x1080"
EndSection

and a single display at

Code:

Section "Screen"
Identifier "amdcccle-Screen[0]-0"
Device "amdcccle-Device[0]-0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Virtual 3840 1920
Depth 24
EndSubSection
EndSection

So I set two windows up one to draw to location 0,0 the next 1920,0. In windowed mode this works great. But I want to run in full screen mode.
So first I tried the SDL_WINDOW_FULLSCREEN_DESKTOP flag,

Code:

screen[ screen_counter ]->window = SDL_CreateWindow( screen[ screen_counter ]->video_screen.screen_name.c_str( ), 

screen_counter * 1920,0,
screen[ screen_counter ]->video_screen.width, screen[ screen_counter ]->video_screen.length, 
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_FULLSCREEN_DESKTOP );

However this just spans the last screen drawn across the two screens with big black boarders on the right of one screen left of the other.

Next I tried SDL_WINDOW_BORDERLESS with windows having resolutions matching each screen, 1920x1080

Code:

screen[ screen_counter ]->window = SDL_CreateWindow( screen[ screen_counter ]->video_screen.screen_name.c_str( ), 

screen_counter * 1920,0,
screen[ screen_counter ]->video_screen.width, screen[ screen_counter ]->video_screen.length, 
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS );

This almost works however the Ubuntu OS bar ( don’t know what it’s called ) is still draw at the top of the screen, showin clock, wireless connection ect.

What flags do I need to set to get it full screen (os bar is gone ) to two monitors but without the OS bar?

Thanks I’m a bit stuck on this one

Try SDL_WINDOWPOS_CENTERED_DISPLAY(screen_counter) for the x and y arguments to SDL_CreateWindow, with SDL_WINDOW_FULLSCREEN_DESKTOP in the flags.On Jan 10, 2014, at 6:25 AM, tony67 wrote:

Hi All,
I’m using Ubuntu 130.4 with SDL 2. I need to run on multiple monitors. I’ve got my code up and running however I’m unable to screens to run correctly in full screen mode.
I’m running dula monitors on ATI catalyst set up for 2 screens, so it shows multi display desktop with 2 displays. Xorg.conf shows two moitors display with 1920x1080

Code:

Section "Monitor"
Identifier "0-DFP2"
Option “VendorName” "ATI Proprietary Driver"
Option “ModelName” "Generic Autodetecting Monitor"
Option “DPMS” "true"
Option “PreferredMode” "1920x1080"
Option “TargetRefresh” "60"
Option “Position” "0 0"
Option “Rotate” "normal"
Option “Disable” "false"
EndSection

Section "Monitor"
Identifier "0-CRT1"
Option “VendorName” "ATI Proprietary Driver"
Option “ModelName” "Generic Autodetecting Monitor"
Option “DPMS” "true"
Option “TargetRefresh” "60"
Option “Position” "1920 0"
Option “Rotate” "normal"
Option “Disable” "false"
Option “PreferredMode” "1920x1080"
EndSection

and a single display at

Code:

Section "Screen"
Identifier "amdcccle-Screen[0]-0"
Device "amdcccle-Device[0]-0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Virtual 3840 1920
Depth 24
EndSubSection
EndSection

So I set two windows up one to draw to location 0,0 the next 1920,0. In windowed mode this works great. But I want to run in full screen mode.
So first I tried the SDL_WINDOW_FULLSCREEN_DESKTOP flag,

Code:

screen[ screen_counter ]->window = SDL_CreateWindow( screen[ screen_counter ]->video_screen.screen_name.c_str( ),

screen_counter * 1920,0,
screen[ screen_counter ]->video_screen.width, screen[ screen_counter ]->video_screen.length,
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_FULLSCREEN_DESKTOP );

However this just spans the last screen drawn across the two screens with big black boarders on the right of one screen left of the other.

Next I tried SDL_WINDOW_BORDERLESS with windows having resolutions matching each screen, 1920x1080

Code:

screen[ screen_counter ]->window = SDL_CreateWindow( screen[ screen_counter ]->video_screen.screen_name.c_str( ),

screen_counter * 1920,0,
screen[ screen_counter ]->video_screen.width, screen[ screen_counter ]->video_screen.length,
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS );

This almost works however the Ubuntu OS bar ( don’t know what it’s called ) is still draw at the top of the screen, showin clock, wireless connection ect.

What flags do I need to set to get it full screen (os bar is gone ) to two monitors but without the OS bar?

Thanks I’m a bit stuck on this one


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

Hi tried that but get an error on compile ?SDL_WINDOWPOS_CENTERED_DISPLAY? was not declared in this scope,
when I’ve check out the sdl video defines I can even see this defined? Only

Code:

#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000
#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
#define SDL_WINDOWPOS_ISUNDEFINED(X)
(((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)

/**

  • \brief Used to indicate that the window position should be centered.
    */
    #define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000
    #define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X))
    #define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)
    #define SDL_WINDOWPOS_ISCENTERED(X)
    (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)

Sorry misread your post didn’t see the (screen ) bit .

However it’s still producing the same result , splitting what ever is drawn between two screens