comparison src/video/SDL_sysvideo.h @ 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 9f62f47d989b
children 467e67d301f3
comparison
equal deleted inserted replaced
3499:4cf8a1423d57 3500:4b594623401b
137 Uint32 flags; 137 Uint32 flags;
138 138
139 int display; 139 int display;
140 SDL_Renderer *renderer; 140 SDL_Renderer *renderer;
141 141
142 SDL_DisplayMode fullscreen_mode;
143
142 void *userdata; 144 void *userdata;
143 void *driverdata; 145 void *driverdata;
144 }; 146 };
145 #define FULLSCREEN_VISIBLE(W) \ 147 #define FULLSCREEN_VISIBLE(W) \
146 (((W)->flags & SDL_WINDOW_FULLSCREEN) && \ 148 (((W)->flags & SDL_WINDOW_FULLSCREEN) && \
156 int max_display_modes; 158 int max_display_modes;
157 int num_display_modes; 159 int num_display_modes;
158 SDL_DisplayMode *display_modes; 160 SDL_DisplayMode *display_modes;
159 SDL_DisplayMode desktop_mode; 161 SDL_DisplayMode desktop_mode;
160 SDL_DisplayMode current_mode; 162 SDL_DisplayMode current_mode;
161 SDL_DisplayMode fullscreen_mode;
162 SDL_Palette *palette; 163 SDL_Palette *palette;
163 164
164 Uint16 *gamma; 165 Uint16 *gamma;
165 Uint16 *saved_gamma; /* (just offset into gamma) */ 166 Uint16 *saved_gamma; /* (just offset into gamma) */
166 167
211 212
212 /* 213 /*
213 * Get a list of the available display modes. e.g. 214 * Get a list of the available display modes. e.g.
214 * SDL_AddDisplayMode(_this->current_display, mode) 215 * SDL_AddDisplayMode(_this->current_display, mode)
215 */ 216 */
216 void (*GetDisplayModes) (_THIS); 217 void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display);
217 218
218 /* 219 /*
219 * Setting the display mode is independent of creating windows, so 220 * Setting the display mode is independent of creating windows, so
220 * when the display mode is changed, all existing windows should have 221 * when the display mode is changed, all existing windows should have
221 * their data updated accordingly, including the display surfaces 222 * their data updated accordingly, including the display surfaces
222 * associated with them. 223 * associated with them.
223 */ 224 */
224 int (*SetDisplayMode) (_THIS, SDL_DisplayMode * mode); 225 int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
225 226
226 /* Set the color entries of the display palette */ 227 /* Set the color entries of the display palette */
227 int (*SetDisplayPalette) (_THIS, SDL_Palette * palette); 228 int (*SetDisplayPalette) (_THIS, SDL_VideoDisplay * display, SDL_Palette * palette);
228 229
229 /* Get the color entries of the display palette */ 230 /* Get the color entries of the display palette */
230 int (*GetDisplayPalette) (_THIS, SDL_Palette * palette); 231 int (*GetDisplayPalette) (_THIS, SDL_VideoDisplay * display, SDL_Palette * palette);
231 232
232 /* Set the gamma ramp */ 233 /* Set the gamma ramp */
233 int (*SetDisplayGammaRamp) (_THIS, Uint16 * ramp); 234 int (*SetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
234 235
235 /* Get the gamma ramp */ 236 /* Get the gamma ramp */
236 int (*GetDisplayGammaRamp) (_THIS, Uint16 * ramp); 237 int (*GetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
237 238
238 /* * * */ 239 /* * * */
239 /* 240 /*
240 * Window functions 241 * Window functions
241 */ 242 */
403 #define SDL_CurrentRenderer (SDL_CurrentDisplay.current_renderer) 404 #define SDL_CurrentRenderer (SDL_CurrentDisplay.current_renderer)
404 405
405 extern SDL_VideoDevice *SDL_GetVideoDevice(); 406 extern SDL_VideoDevice *SDL_GetVideoDevice();
406 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); 407 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
407 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display); 408 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
408 extern SDL_bool 409 extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
409 SDL_AddDisplayMode(int displayIndex, const SDL_DisplayMode * mode); 410 extern int SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display);
410 extern void 411 extern int SDL_GetDisplayModeForDisplay(SDL_VideoDisplay * display, int index, SDL_DisplayMode * mode);
411 SDL_AddRenderDriver(int displayIndex, const SDL_RenderDriver * driver); 412 extern int SDL_GetDesktopDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode);
413 extern int SDL_GetCurrentDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode);
414 extern SDL_DisplayMode * SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
415 extern int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode);
416 extern int SDL_SetDisplayPaletteForDisplay(SDL_VideoDisplay * display, const SDL_Color * colors, int firstcolor, int ncolors);
417 extern int SDL_GetDisplayPaletteForDisplay(SDL_VideoDisplay * display, SDL_Color * colors, int firstcolor, int ncolors);
418 extern void SDL_AddRenderDriver(SDL_VideoDisplay *display, const SDL_RenderDriver * driver);
419
420 extern int SDL_SetGammaRampForDisplay(SDL_VideoDisplay * display, const Uint16 * red, const Uint16 * green, const Uint16 * blue);
421 extern int SDL_GetGammaRampForDisplay(SDL_VideoDisplay * display, Uint16 * red, Uint16 * green, Uint16 * blue);
412 422
413 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); 423 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
414 extern SDL_Window *SDL_GetWindowFromID(SDL_WindowID windowID); 424 extern SDL_Window *SDL_GetWindowFromID(SDL_WindowID windowID);
415 extern SDL_VideoDisplay *SDL_GetDisplayFromWindow(SDL_Window * window); 425 extern SDL_VideoDisplay *SDL_GetDisplayFromWindow(SDL_Window * window);
416 426