Work in progress on multi-display support:
* Added display parameter to many internal functions so video modes can be set on displays that aren't the public current one. * The fullscreen mode is associated with fullscreen windows - not displays, so different windows more naturally have a mode associated with them based on their width and height. It's no longer necessary to specify a fullscreen mode, a default one will be picked automatically for fullscreen windows. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404241
This commit is contained in:
parent
3e860cdcf9
commit
1cd715e9db
29 changed files with 446 additions and 485 deletions
|
@ -76,7 +76,7 @@ CommonCreateState(char **argv, Uint32 flags)
|
|||
state->argv = argv;
|
||||
state->flags = flags;
|
||||
state->window_title = argv[0];
|
||||
state->window_flags = SDL_WINDOW_SHOWN;
|
||||
state->window_flags = 0;
|
||||
state->window_x = SDL_WINDOWPOS_UNDEFINED;
|
||||
state->window_y = SDL_WINDOWPOS_UNDEFINED;
|
||||
state->window_w = DEFAULT_WINDOW_WIDTH;
|
||||
|
@ -737,6 +737,7 @@ CommonInit(CommonState * state)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_zero(fullscreen_mode);
|
||||
switch (state->depth) {
|
||||
case 8:
|
||||
fullscreen_mode.format = SDL_PIXELFORMAT_INDEX8;
|
||||
|
@ -754,14 +755,7 @@ CommonInit(CommonState * state)
|
|||
fullscreen_mode.format = SDL_PIXELFORMAT_RGB888;
|
||||
break;
|
||||
}
|
||||
fullscreen_mode.w = state->window_w;
|
||||
fullscreen_mode.h = state->window_h;
|
||||
fullscreen_mode.refresh_rate = state->refresh_rate;
|
||||
if (SDL_SetFullscreenDisplayMode(&fullscreen_mode)<0) {
|
||||
fprintf(stderr, "Can't switch to fullscreen display mode: %s\n",
|
||||
SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
state->windows =
|
||||
(SDL_WindowID *) SDL_malloc(state->num_windows *
|
||||
|
@ -789,6 +783,13 @@ CommonInit(CommonState * state)
|
|||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
if (SDL_SetWindowDisplayMode(state->windows[i], &fullscreen_mode) < 0) {
|
||||
fprintf(stderr, "Can't set up fullscreen display mode: %s\n",
|
||||
SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
}
|
||||
SDL_ShowWindow(state->windows[i]);
|
||||
|
||||
if (!state->skip_renderer
|
||||
&& (state->renderdriver
|
||||
|| !(state->window_flags & SDL_WINDOW_OPENGL))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue