diff src/SDL_compat.c @ 1733:0b1070f2f94d SDL-1.3

Implemented gamma correction on Windows. Added general code to restore the video mode and gamma when windows lose focus.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 09 Jul 2006 09:02:26 +0000
parents 875c3cf1a12c
children f7c667ded87d
line wrap: on
line diff
--- a/src/SDL_compat.c	Sat Jul 08 20:55:39 2006 +0000
+++ b/src/SDL_compat.c	Sun Jul 09 09:02:26 2006 +0000
@@ -360,9 +360,8 @@
     if (flags & SDL_NOFRAME) {
         window_flags |= SDL_WINDOW_BORDERLESS;
     }
-    if (SDL_getenv("SDL_WINDOW_POS")) {
-    }
     GetEnvironmentWindowPosition(width, height, &window_x, &window_y);
+    SDL_SetFullscreenDisplayMode(NULL);
     SDL_VideoWindow =
         SDL_CreateWindow(wm_title, window_x, window_y, width, height,
                          window_flags);
@@ -427,21 +426,9 @@
 
     /* Set the desired display mode */
     if (flags & SDL_FULLSCREEN) {
-        if (!SDL_GetClosestDisplayMode(&mode, &mode)) {
+        if (SDL_SetFullscreenDisplayMode(&mode) < 0) {
             return NULL;
         }
-    } else {
-        if (desktop_format) {
-            mode.format = desktop_format;
-        }
-        if (desktop_mode->w && desktop_mode->h) {
-            mode.w = desktop_mode->w;
-            mode.h = desktop_mode->h;
-        }
-        mode.refresh_rate = desktop_mode->refresh_rate;
-    }
-    if (SDL_SetDisplayMode(&mode) < 0) {
-        return NULL;
     }
 
     /* If we're in OpenGL mode, just create a stub surface and we're done! */