diff src/video/SDL_sysvideo.h @ 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 0ef52d56e8bb
children f7c667ded87d
line wrap: on
line diff
--- a/src/video/SDL_sysvideo.h	Sat Jul 08 20:55:39 2006 +0000
+++ b/src/video/SDL_sysvideo.h	Sun Jul 09 09:02:26 2006 +0000
@@ -117,14 +117,16 @@
     int w, h;
     Uint32 flags;
 
-    Uint16 *gamma;
-
     int display;
     SDL_Renderer *renderer;
 
     void *userdata;
     void *driverdata;
 };
+#define FULLSCREEN_VISIBLE(W) \
+    ((W->flags & SDL_WINDOW_FULLSCREEN) && \
+     (W->flags & SDL_WINDOW_SHOWN) && \
+     !(W->flags & SDL_WINDOW_MINIMIZED))
 
 /* Define the SDL display structure
    This corresponds to physical monitors attached to the system.
@@ -136,8 +138,13 @@
     SDL_DisplayMode *display_modes;
     SDL_DisplayMode desktop_mode;
     SDL_DisplayMode current_mode;
+    SDL_DisplayMode desired_mode;
+    SDL_DisplayMode *fullscreen_mode;
     SDL_Palette *palette;
 
+    Uint16 *gamma;
+    Uint16 *saved_gamma;        /* (just offset into gamma) */
+
     int num_render_drivers;
     SDL_RenderDriver *render_drivers;
 
@@ -174,6 +181,12 @@
     /* * * */
     /* Display functions
      */
+
+    /* Get a list of the available display modes.
+     * e.g.  SDL_AddDisplayMode(_this->current_display, mode)
+     */
+    void (*GetDisplayModes) (_THIS);
+
     /* Setting the display mode is independent of creating windows,
      * so when the display mode is changed, all existing windows
      * should have their data updated accordingly, including the
@@ -181,12 +194,18 @@
      */
     int (*SetDisplayMode) (_THIS, SDL_DisplayMode * mode);
 
-    /* Sets the color entries of the display palette to those in 'colors'.
-       The return value is 0 if all entries could be set properly or -1
-       otherwise.
-     */
+    /* Set the color entries of the display palette */
     int (*SetDisplayPalette) (_THIS, SDL_Palette * palette);
 
+    /* Get the color entries of the display palette */
+    int (*GetDisplayPalette) (_THIS, SDL_Palette * palette);
+
+    /* Set the gamma ramp */
+    int (*SetDisplayGammaRamp) (_THIS, Uint16 * ramp);
+
+    /* Get the gamma ramp */
+    int (*GetDisplayGammaRamp) (_THIS, Uint16 * ramp);
+
     /* * * */
     /* Window functions
      */
@@ -214,21 +233,6 @@
     void (*VideoQuit) (_THIS);
 
     /* * * */
-    /* Gamma support */
-
-    /* Set the gamma correction directly (emulated with gamma ramps) */
-    int (*SetGamma) (_THIS, float red, float green, float blue);
-
-    /* Get the gamma correction directly (emulated with gamma ramps) */
-    int (*GetGamma) (_THIS, float *red, float *green, float *blue);
-
-    /* Set the gamma ramp */
-    int (*SetGammaRamp) (_THIS, Uint16 * ramp);
-
-    /* Get the gamma ramp */
-    int (*GetGammaRamp) (_THIS, Uint16 * ramp);
-
-    /* * * */
     /* OpenGL support */
 
     /* Sets the dll to use for OpenGL and loads it */
@@ -405,7 +409,6 @@
 #endif
 
 #define SDL_CurrentDisplay	(_this->displays[_this->current_display])
-#define SDL_CurrentWindow	(SDL_CurrentDisplay.windows[0])
 
 extern SDL_VideoDevice *SDL_GetVideoDevice();
 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
@@ -418,6 +421,11 @@
 extern SDL_Window *SDL_GetWindowFromID(SDL_WindowID windowID);
 extern SDL_VideoDisplay *SDL_GetDisplayFromWindow(SDL_Window * window);
 
+extern void SDL_OnWindowShown(SDL_Window * window);
+extern void SDL_OnWindowHidden(SDL_Window * window);
+extern void SDL_OnWindowFocusGained(SDL_Window * window);
+extern void SDL_OnWindowFocusLost(SDL_Window * window);
+
 #endif /* _SDL_sysvideo_h */
 
 /* vi: set ts=4 sw=4 expandtab: */