comparison include/SDL_video.h @ 5251:58265e606e4e

Window coordinates are in the global space and windows are not tied to a particular display. Also added Ctrl-Enter keybinding to the test code to toggle fullscreen mode for testing.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 10 Feb 2011 14:44:25 -0800
parents 762e40fb8e28
children b530ef003506
comparison
equal deleted inserted replaced
5250:329d435f97f4 5251:58265e606e4e
111 } SDL_WindowFlags; 111 } SDL_WindowFlags;
112 112
113 /** 113 /**
114 * \brief Used to indicate that you don't care what the window position is. 114 * \brief Used to indicate that you don't care what the window position is.
115 */ 115 */
116 #define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF 116 #define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000
117 #define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
118 #define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
119 #define SDL_WINDOWPOS_ISUNDEFINED(X) \
120 (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
117 121
118 /** 122 /**
119 * \brief Used to indicate that the window position should be centered. 123 * \brief Used to indicate that the window position should be centered.
120 */ 124 */
121 #define SDL_WINDOWPOS_CENTERED 0x7FFFFFE 125 #define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000
126 #define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X))
127 #define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)
128 #define SDL_WINDOWPOS_ISCENTERED(X) \
129 (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
122 130
123 /** 131 /**
124 * \brief Event subtype for window events 132 * \brief Event subtype for window events
125 */ 133 */
126 typedef enum 134 typedef enum
302 * \sa SDL_GetDisplayMode() 310 * \sa SDL_GetDisplayMode()
303 */ 311 */
304 extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); 312 extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
305 313
306 /** 314 /**
315 * \brief Get the display index associated with a window.
316 *
317 * \return the display index of the display containing the center of the
318 * window, or -1 on error.
319 */
320 extern DECLSPEC int SDLCALL SDL_GetWindowDisplay(SDL_Window * window);
321
322 /**
307 * \brief Set the display mode used when a fullscreen window is visible. 323 * \brief Set the display mode used when a fullscreen window is visible.
308 * 324 *
309 * By default the window's dimensions and the desktop format and refresh rate 325 * By default the window's dimensions and the desktop format and refresh rate
310 * are used. 326 * are used.
311 * 327 *
529 * 545 *
530 * \sa SDL_SetWindowDisplayMode() 546 * \sa SDL_SetWindowDisplayMode()
531 * \sa SDL_GetWindowDisplayMode() 547 * \sa SDL_GetWindowDisplayMode()
532 */ 548 */
533 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, 549 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
534 int fullscreen); 550 SDL_bool fullscreen);
535 551
536 /** 552 /**
537 * \brief Get an SDL surface associated with the window. 553 * \brief Get an SDL surface associated with the window.
538 * 554 *
539 * \return A surface in the optimal format for the window, or NULL on error. 555 * \return A surface in the optimal format for the window, or NULL on error.