comparison src/video/SDL_sysvideo.h @ 5281:15a71bec4a55

merged
author Eric Wing <ewing . public |-at-| gmail . com>
date Sat, 12 Feb 2011 19:16:09 -0800
parents 3c94c559f5c2
children
comparison
equal deleted inserted replaced
5219:adfcdd311ae0 5281:15a71bec4a55
1 /* 1 /*
2 SDL - Simple DirectMedia Layer 2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2010 Sam Lantinga 3 Copyright (C) 1997-2011 Sam Lantinga
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public 6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version. 8 version 2.1 of the License, or (at your option) any later version.
74 char *title; 74 char *title;
75 int x, y; 75 int x, y;
76 int w, h; 76 int w, h;
77 Uint32 flags; 77 Uint32 flags;
78 78
79 SDL_VideoDisplay *display;
80
81 SDL_DisplayMode fullscreen_mode; 79 SDL_DisplayMode fullscreen_mode;
82 80
83 SDL_Surface *surface; 81 SDL_Surface *surface;
84 SDL_bool surface_valid; 82 SDL_bool surface_valid;
85 83
106 int max_display_modes; 104 int max_display_modes;
107 int num_display_modes; 105 int num_display_modes;
108 SDL_DisplayMode *display_modes; 106 SDL_DisplayMode *display_modes;
109 SDL_DisplayMode desktop_mode; 107 SDL_DisplayMode desktop_mode;
110 SDL_DisplayMode current_mode; 108 SDL_DisplayMode current_mode;
111 SDL_bool updating_fullscreen; 109
112
113 Uint16 *gamma;
114 Uint16 *saved_gamma; /* (just offset into gamma) */
115
116 SDL_Window *windows;
117 SDL_Window *fullscreen_window; 110 SDL_Window *fullscreen_window;
118 111
119 SDL_VideoDevice *device; 112 SDL_VideoDevice *device;
120 113
121 void *driverdata; 114 void *driverdata;
122 }; 115 };
116
117 /* Forward declaration */
118 struct SDL_SysWMinfo;
123 119
124 /* Define the SDL video driver structure */ 120 /* Define the SDL video driver structure */
125 #define _THIS SDL_VideoDevice *_this 121 #define _THIS SDL_VideoDevice *_this
126 122
127 struct SDL_VideoDevice 123 struct SDL_VideoDevice
154 * Get the bounds of a display 150 * Get the bounds of a display
155 */ 151 */
156 int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); 152 int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect);
157 153
158 /* 154 /*
159 * Get a list of the available display modes. e.g. 155 * Get a list of the available display modes for a display.
160 * SDL_AddDisplayMode(_this->current_display, mode)
161 */ 156 */
162 void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display); 157 void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display);
163 158
164 /* 159 /*
165 * Setting the display mode is independent of creating windows, so 160 * Setting the display mode is independent of creating windows, so
166 * when the display mode is changed, all existing windows should have 161 * when the display mode is changed, all existing windows should have
167 * their data updated accordingly, including the display surfaces 162 * their data updated accordingly, including the display surfaces
168 * associated with them. 163 * associated with them.
169 */ 164 */
170 int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); 165 int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
171
172 /* Set the gamma ramp */
173 int (*SetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
174
175 /* Get the gamma ramp */
176 int (*GetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
177 166
178 /* * * */ 167 /* * * */
179 /* 168 /*
180 * Window functions 169 * Window functions
181 */ 170 */
189 void (*HideWindow) (_THIS, SDL_Window * window); 178 void (*HideWindow) (_THIS, SDL_Window * window);
190 void (*RaiseWindow) (_THIS, SDL_Window * window); 179 void (*RaiseWindow) (_THIS, SDL_Window * window);
191 void (*MaximizeWindow) (_THIS, SDL_Window * window); 180 void (*MaximizeWindow) (_THIS, SDL_Window * window);
192 void (*MinimizeWindow) (_THIS, SDL_Window * window); 181 void (*MinimizeWindow) (_THIS, SDL_Window * window);
193 void (*RestoreWindow) (_THIS, SDL_Window * window); 182 void (*RestoreWindow) (_THIS, SDL_Window * window);
183 void (*PrepWindowFullscreen) (_THIS, SDL_Window * window);
184 void (*SetWindowFullscreen) (_THIS, SDL_Window * window);
194 void (*SetWindowGrab) (_THIS, SDL_Window * window); 185 void (*SetWindowGrab) (_THIS, SDL_Window * window);
195 void (*DestroyWindow) (_THIS, SDL_Window * window); 186 void (*DestroyWindow) (_THIS, SDL_Window * window);
196 int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); 187 int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
197 int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, int numrects, SDL_Rect * rects); 188 int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, int numrects, SDL_Rect * rects);
198 void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window); 189 void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
243 /* * * */ 234 /* * * */
244 /* Data common to all drivers */ 235 /* Data common to all drivers */
245 SDL_bool suspend_screensaver; 236 SDL_bool suspend_screensaver;
246 int num_displays; 237 int num_displays;
247 SDL_VideoDisplay *displays; 238 SDL_VideoDisplay *displays;
248 int current_display; 239 SDL_Window *windows;
249 Uint8 window_magic; 240 Uint8 window_magic;
250 Uint32 next_object_id; 241 Uint32 next_object_id;
251 char * clipboard_text; 242 char * clipboard_text;
252 243
253 /* * * */ 244 /* * * */
329 #endif 320 #endif
330 #if SDL_VIDEO_DRIVER_DUMMY 321 #if SDL_VIDEO_DRIVER_DUMMY
331 extern VideoBootStrap DUMMY_bootstrap; 322 extern VideoBootStrap DUMMY_bootstrap;
332 #endif 323 #endif
333 324
334 #define SDL_CurrentDisplay (&_this->displays[_this->current_display])
335
336 extern SDL_VideoDevice *SDL_GetVideoDevice(void); 325 extern SDL_VideoDevice *SDL_GetVideoDevice(void);
337 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); 326 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
338 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display); 327 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
339 extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode); 328 extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
340 extern int SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display); 329 extern SDL_VideoDisplay *SDL_GetDisplayForWindow(SDL_Window *window);
341 extern int SDL_GetDisplayModeForDisplay(SDL_VideoDisplay * display, int index, SDL_DisplayMode * mode);
342 extern int SDL_GetDesktopDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode);
343 extern int SDL_GetCurrentDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode);
344 extern SDL_DisplayMode * SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
345 extern int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode);
346 extern int SDL_SetGammaRampForDisplay(SDL_VideoDisplay * display, const Uint16 * red, const Uint16 * green, const Uint16 * blue);
347 extern int SDL_GetGammaRampForDisplay(SDL_VideoDisplay * display, Uint16 * red, Uint16 * green, Uint16 * blue);
348 330
349 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); 331 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
350 332
351 extern void SDL_OnWindowShown(SDL_Window * window); 333 extern void SDL_OnWindowShown(SDL_Window * window);
352 extern void SDL_OnWindowHidden(SDL_Window * window); 334 extern void SDL_OnWindowHidden(SDL_Window * window);