Discussion:
[SDL] changing display resolution using SDL_WINDOW_FULLSCREEN with multiple displays not working on mac OS X (el capitan) ?
jeroen clarysse
2016-09-26 11:41:32 UTC
Permalink
hi all,

using THREE monitors, and trying to create two SDL_windows like this :

int display_main_num = 1;
int display_2nd_num = 2;

m_main_window_w = 1024;
m_main_window_h = 768;
m_2nd_window_w = 1024;
m_2nd_window_h = 768;

m_main_window = SDL_CreateWindow("Main window",SDL_WINDOWPOS_CENTERED_DISPLAY(display_main_num),SDL_WINDOWPOS_CENTERED_DISPLAY(display_main_num),m_main_window_w,m_main_window_h,SDL_WINDOW_SHOWN|SDL_WINDOW_FULLSCREEN_DESKTOP);
m_main_renderer = SDL_CreateRenderer(m_main_window, -1, SDL_RENDERER_SOFTWARE);

m_2nd_window = SDL_CreateWindow("2nd window",SDL_WINDOWPOS_CENTERED_DISPLAY(display_2nd_num),SDL_WINDOWPOS_CENTERED_DISPLAY(display_2nd_num),m_2nd_window_w,m_2nd_window_h,SDL_WINDOW_SHOWN|SDL_WINDOW_FULLSCREEN_DESKTOP);
m_2nd_renderer = SDL_CreateRenderer(m_2nd_window, -1, SDL_RENDERER_SOFTWARE);


this works nicely, but these call don't change resolutions yet. However, when I change the flags SDL_WINDOW_FULLSCREEN_DESKTOP to SDL_WINDOW_FULLSCREEN, SDL is supposed to change the resolution of both monitors to 1024 x 768. A lot happens on the screen : flickering windows, typical macos fullscreen resizing animation, flashing menu bar, … but the whole function stays stuck in he first CreateWindow() call

after I click around a bit, the code continues, but the windows are NOT fullscreen.

has anyone succeeded in using multiple displays WITH resolution changes ?


I also tried with using only ONE display resolution and leaving the other at desktop res, but even that didn’t work
Kai Sterker
2016-09-26 12:11:53 UTC
Permalink
Have never tried multiple windows fullscreen on multiple monitors, but one
thing that sticks out immediately is you using the
SDL_WINDOW_FULLSCREEN_DESKTOP flag. This will not change resolution, but
always keep current desktop resolution. At the very least, you'd want to
use SDL_WINDOW_FULLSCREEN instead.

See https://wiki.libsdl.org/SDL_WindowFlags

Kai
Post by jeroen clarysse
hi all,
int display_main_num = 1;
int display_2nd_num = 2;
m_main_window_w = 1024;
m_main_window_h = 768;
m_2nd_window_w = 1024;
m_2nd_window_h = 768;
m_main_window = SDL_CreateWindow("Main
window",SDL_WINDOWPOS_CENTERED_DISPLAY(display_main_num),SDL_WINDOWPOS_CENTERED_DISPLAY(display_main_num),m_main_window_w,m_main_window_h,SDL_WINDOW_SHOWN|SDL_WINDOW_FULLSCREEN_DESKTOP);
Post by jeroen clarysse
m_main_renderer = SDL_CreateRenderer(m_main_window, -1, SDL_RENDERER_SOFTWARE);
m_2nd_window = SDL_CreateWindow("2nd
window",SDL_WINDOWPOS_CENTERED_DISPLAY(display_2nd_num),SDL_WINDOWPOS_CENTERED_DISPLAY(display_2nd_num),m_2nd_window_w,m_2nd_window_h,SDL_WINDOW_SHOWN|SDL_WINDOW_FULLSCREEN_DESKTOP);
Post by jeroen clarysse
m_2nd_renderer = SDL_CreateRenderer(m_2nd_window, -1,
SDL_RENDERER_SOFTWARE);
Post by jeroen clarysse
this works nicely, but these call don't change resolutions yet. However,
when I change the flags SDL_WINDOW_FULLSCREEN_DESKTOP to
SDL_WINDOW_FULLSCREEN, SDL is supposed to change the resolution of both
monitors to 1024 x 768. A lot happens on the screen : flickering windows,
typical macos fullscreen resizing animation, flashing menu bar, 
 but the
whole function stays stuck in he first CreateWindow() call
Post by jeroen clarysse
after I click around a bit, the code continues, but the windows are NOT fullscreen.
has anyone succeeded in using multiple displays WITH resolution changes ?
I also tried with using only ONE display resolution and leaving the other
at desktop res, but even that didn’t work
Post by jeroen clarysse
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
jeroen clarysse
2016-09-26 12:21:34 UTC
Permalink
yep, that’s what I said in the mail :-)

I just added the SDL_WINDOW_FULLSCREEN_DESKTOP flag to explain that, *without* changing resolutions, everything runs fine. But, as I said in the mail : when I change it to SDL_WINDOW_FULLSCREEN instead, nothing happens

:-)
Have never tried multiple windows fullscreen on multiple monitors, but one thing that sticks out immediately is you using the SDL_WINDOW_FULLSCREEN_DESKTOP flag. This will not change resolution, but always keep current desktop resolution. At the very least, you'd want to use SDL_WINDOW_FULLSCREEN instead.
See https://wiki.libsdl.org/SDL_WindowFlags
Kai
Post by jeroen clarysse
hi all,
int display_main_num = 1;
int display_2nd_num = 2;
m_main_window_w = 1024;
m_main_window_h = 768;
m_2nd_window_w = 1024;
m_2nd_window_h = 768;
m_main_window = SDL_CreateWindow("Main window",SDL_WINDOWPOS_CENTERED_DISPLAY(display_main_num),SDL_WINDOWPOS_CENTERED_DISPLAY(display_main_num),m_main_window_w,m_main_window_h,SDL_WINDOW_SHOWN|SDL_WINDOW_FULLSCREEN_DESKTOP);
m_main_renderer = SDL_CreateRenderer(m_main_window, -1, SDL_RENDERER_SOFTWARE);
m_2nd_window = SDL_CreateWindow("2nd window",SDL_WINDOWPOS_CENTERED_DISPLAY(display_2nd_num),SDL_WINDOWPOS_CENTERED_DISPLAY(display_2nd_num),m_2nd_window_w,m_2nd_window_h,SDL_WINDOW_SHOWN|SDL_WINDOW_FULLSCREEN_DESKTOP);
m_2nd_renderer = SDL_CreateRenderer(m_2nd_window, -1, SDL_RENDERER_SOFTWARE);
this works nicely, but these call don't change resolutions yet. However, when I change the flags SDL_WINDOW_FULLSCREEN_DESKTOP to SDL_WINDOW_FULLSCREEN, SDL is supposed to change the resolution of both monitors to 1024 x 768. A lot happens on the screen : flickering windows, typical macos fullscreen resizing animation, flashing menu bar, … but the whole function stays stuck in he first CreateWindow() call
after I click around a bit, the code continues, but the windows are NOT fullscreen.
has anyone succeeded in using multiple displays WITH resolution changes ?
I also tried with using only ONE display resolution and leaving the other at desktop res, but even that didn’t work
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Loading...