diff src/video/SDL_gamma.c @ 1734:f7c667ded87d SDL-1.3

The general code handles restoring video mode/gamma/etc. when the window loses focus. Support for changing fullscreen/windowed mode in progress.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 09 Jul 2006 18:09:16 +0000
parents 0b1070f2f94d
children
line wrap: on
line diff
--- a/src/video/SDL_gamma.c	Sun Jul 09 09:02:26 2006 +0000
+++ b/src/video/SDL_gamma.c	Sun Jul 09 18:09:16 2006 +0000
@@ -152,8 +152,12 @@
     /* Try to set the gamma ramp in the driver */
     succeeded = -1;
     if (_this && _this->SetDisplayGammaRamp) {
-        succeeded =
-            _this->SetDisplayGammaRamp(_this, SDL_CurrentDisplay.gamma);
+        if (SDL_GetFocusWindow()) {
+            succeeded =
+                _this->SetDisplayGammaRamp(_this, SDL_CurrentDisplay.gamma);
+        } else {
+            succeeded = 0;
+        }
     } else {
         SDL_SetError("Gamma ramp manipulation not supported");
     }