About SDL_SelectVideoDisplay() removal

umh, if i want each window to be displayed on different monitor, how
is that possible now that SDL_SelectVideoDisplay has been removed?

if this hasn’t been considered i’d add a parameter to
SDL_CreateWindow() to specify on which monitor the window should
appear…

Vittorio

I think you have to enumerate the displays and get the coordinates respectively:

int num = SDL_GetNumVideoDisplays();
SDL_Rect displays[num];
for( int m=0; m < num; m++ )
SDL_GetDisplayBounds( m, &displays[m] );

// Let’s pretend you want to display on monitor #2
int windowWidth = 500;
int windowHeight = 200;
Uint32 flags = SDL_WINDOW_SHOWN;
SDL_Window *win = SDL_CreateWindow( “I’m a window! Yay!”,
displays[1].x, displays[1].y, windowWidth, windowHeight, flags );

I hope that helps,
-AlexOn Sat, Feb 12, 2011 at 9:24 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

umh, if i want each window to be displayed on different monitor, how
is that possible now that SDL_SelectVideoDisplay has been removed?

if this hasn’t been considered i’d add a parameter to
SDL_CreateWindow() to specify on which monitor the window should
appear…

Vittorio


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

You can either use the display coordinates that Alex mentioned, or you can
use these constants if you want it to show up on a specific display but
don’t care where, or you want it centered and don’t want to do the math
yourself:

SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)
SDL_WINDOWPOS_CENTERED_DISPLAY(X)On Sat, Feb 12, 2011 at 6:24 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

umh, if i want each window to be displayed on different monitor, how
is that possible now that SDL_SelectVideoDisplay has been removed?

if this hasn’t been considered i’d add a parameter to
SDL_CreateWindow() to specify on which monitor the window should
appear…

Vittorio


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Welllll, i still believe that an additional parameter to
SDL_CreateWindow would be a lot simpler
Documentation-wise and tutorial-wise would be easier to handle and in
line with the explicit API:
after all, we pass the displayIndex now for every DisplayMode
function, why wouldn’t we need to pass an index to CreateWindow to
select the display where to show the window?..

VittorioOn Sat, Feb 12, 2011 at 4:59 PM, Sam Lantinga wrote:

You can either use the display coordinates that Alex mentioned, or you can
use these constants if you want it to show up on a specific display but
don’t care where, or you want it centered and don’t want to do the math
yourself:

SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)
SDL_WINDOWPOS_CENTERED_DISPLAY(X)

On Sat, Feb 12, 2011 at 6:24 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

umh, if i want each window to be displayed on different monitor, how
is that possible now that SDL_SelectVideoDisplay has been removed?

if this hasn’t been considered i’d add a parameter to
SDL_CreateWindow() to specify on which monitor the window should
appear…

Vittorio


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


? ? -Sam Lantinga, Founder and CEO, Galaxy Gameworks


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

You could just making a wrapper function…On Sat, Feb 12, 2011 at 12:02 PM, Vittorio G. <vitto.giova at yahoo.it> wrote:

Welllll, i still believe that an additional parameter to
SDL_CreateWindow would be a lot simpler
Documentation-wise and tutorial-wise would be easier to handle and in
line with the explicit API:
after all, we pass the displayIndex now for every DisplayMode
function, why wouldn’t we need to pass an index to CreateWindow to
select the display where to show the window?..

Vittorio

On Sat, Feb 12, 2011 at 4:59 PM, Sam Lantinga wrote:

You can either use the display coordinates that Alex mentioned, or you can
use these constants if you want it to show up on a specific display but
don’t care where, or you want it centered and don’t want to do the math
yourself:

SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)
SDL_WINDOWPOS_CENTERED_DISPLAY(X)

On Sat, Feb 12, 2011 at 6:24 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

umh, if i want each window to be displayed on different monitor, how
is that possible now that SDL_SelectVideoDisplay has been removed?

if this hasn’t been considered i’d add a parameter to
SDL_CreateWindow() to specify on which monitor the window should
appear…

Vittorio


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


? ? -Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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

I’d like to keep the API simple for the general case where the user doesn’t
care about multi-monitor support. Most of the time you don’t care which
monitor the window goes onto, and if you’re just saving and restoring window
position, with the new code changes you can do just that, and the window
will go onto the monitor it was on when it was saved.

See ya!On Sat, Feb 12, 2011 at 9:02 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

Welllll, i still believe that an additional parameter to
SDL_CreateWindow would be a lot simpler
Documentation-wise and tutorial-wise would be easier to handle and in
line with the explicit API:
after all, we pass the displayIndex now for every DisplayMode
function, why wouldn’t we need to pass an index to CreateWindow to
select the display where to show the window?..

Vittorio

On Sat, Feb 12, 2011 at 4:59 PM, Sam Lantinga <@slouken> wrote:

You can either use the display coordinates that Alex mentioned, or you
can
use these constants if you want it to show up on a specific display but
don’t care where, or you want it centered and don’t want to do the math
yourself:

SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)
SDL_WINDOWPOS_CENTERED_DISPLAY(X)

On Sat, Feb 12, 2011 at 6:24 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

umh, if i want each window to be displayed on different monitor, how
is that possible now that SDL_SelectVideoDisplay has been removed?

if this hasn’t been considered i’d add a parameter to
SDL_CreateWindow() to specify on which monitor the window should
appear…

Vittorio


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks