diff src/SDL_compat.c @ 3500:4b594623401b

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.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 01 Dec 2009 05:57:15 +0000
parents 00cace2d9080
children abefdc334970
line wrap: on
line diff
--- a/src/SDL_compat.c	Mon Nov 30 21:04:25 2009 +0000
+++ b/src/SDL_compat.c	Tue Dec 01 05:57:15 2009 +0000
@@ -482,7 +482,6 @@
 SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
 {
     SDL_DisplayMode desktop_mode;
-    SDL_DisplayMode mode;
     int window_x = SDL_WINDOWPOS_UNDEFINED;
     int window_y = SDL_WINDOWPOS_UNDEFINED;
     Uint32 window_flags;
@@ -552,7 +551,6 @@
         window_flags |= SDL_WINDOW_BORDERLESS;
     }
     GetEnvironmentWindowPosition(width, height, &window_x, &window_y);
-    SDL_SetFullscreenDisplayMode(NULL);
     SDL_VideoWindow =
         SDL_CreateWindow(wm_title, window_x, window_y, width, height,
                          window_flags);
@@ -611,14 +609,14 @@
             return NULL;
         }
     }
-    mode.format = desired_format;
-    mode.w = width;
-    mode.h = height;
-    mode.refresh_rate = 0;
 
-    /* Set the desired display mode */
+    /* Set up the desired display mode */
     if (flags & SDL_FULLSCREEN) {
-        if (SDL_SetFullscreenDisplayMode(&mode) < 0) {
+        SDL_DisplayMode mode;
+
+        SDL_zero(mode);
+        mode.format = desired_format;
+        if (SDL_SetWindowDisplayMode(SDL_VideoWindow, &mode) < 0) {
             return NULL;
         }
     }