comparison include/SDL_video.h @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 8b9d79e7eacf
children 4da1ee79c9af
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
18 18
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /* Header file for access to the SDL raw framebuffer window */ 23 /**
24 * \file SDL_video.h
25 *
26 * Header file for access to the SDL raw framebuffer window
27 */
24 28
25 #ifndef _SDL_video_h 29 #ifndef _SDL_video_h
26 #define _SDL_video_h 30 #define _SDL_video_h
27 31
28 #include "SDL_stdinc.h" 32 #include "SDL_stdinc.h"
29 #include "SDL_error.h" 33 #include "SDL_error.h"
34 #include "SDL_pixels.h"
30 #include "SDL_rwops.h" 35 #include "SDL_rwops.h"
31 36
32 #include "begin_code.h" 37 #include "begin_code.h"
33 /* Set up for C function definitions, even when using C++ */ 38 /* Set up for C function definitions, even when using C++ */
34 #ifdef __cplusplus 39 #ifdef __cplusplus
40 /* *INDENT-OFF* */
35 extern "C" { 41 extern "C" {
42 /* *INDENT-ON* */
36 #endif 43 #endif
37 44
38 /* Transparency definitions: These define alpha as the opacity of a surface */ 45 /* Transparency definitions: These define alpha as the opacity of a surface */
39 #define SDL_ALPHA_OPAQUE 255 46 #define SDL_ALPHA_OPAQUE 255
40 #define SDL_ALPHA_TRANSPARENT 0 47 #define SDL_ALPHA_TRANSPARENT 0
41 48
42 /* Useful data types */ 49 /* Useful data types */
43 typedef struct SDL_Rect { 50 typedef struct SDL_Rect
44 Sint16 x, y; 51 {
45 Uint16 w, h; 52 Sint16 x, y;
53 Uint16 w, h;
46 } SDL_Rect; 54 } SDL_Rect;
47
48 typedef struct SDL_Color {
49 Uint8 r;
50 Uint8 g;
51 Uint8 b;
52 Uint8 unused;
53 } SDL_Color;
54 #define SDL_Colour SDL_Color
55
56 typedef struct SDL_Palette {
57 int ncolors;
58 SDL_Color *colors;
59 } SDL_Palette;
60
61 /* Everything in the pixel format structure is read-only */
62 typedef struct SDL_PixelFormat {
63 SDL_Palette *palette;
64 Uint8 BitsPerPixel;
65 Uint8 BytesPerPixel;
66 Uint8 Rloss;
67 Uint8 Gloss;
68 Uint8 Bloss;
69 Uint8 Aloss;
70 Uint8 Rshift;
71 Uint8 Gshift;
72 Uint8 Bshift;
73 Uint8 Ashift;
74 Uint32 Rmask;
75 Uint32 Gmask;
76 Uint32 Bmask;
77 Uint32 Amask;
78
79 /* RGB color key information */
80 Uint32 colorkey;
81 /* Alpha value information (per-surface alpha) */
82 Uint8 alpha;
83 } SDL_PixelFormat;
84 55
85 /* This structure should be treated as read-only, except for 'pixels', 56 /* This structure should be treated as read-only, except for 'pixels',
86 which, if not NULL, contains the raw pixel data for the surface. 57 which, if not NULL, contains the raw pixel data for the surface.
87 */ 58 */
88 typedef struct SDL_Surface { 59 typedef struct SDL_Surface
89 Uint32 flags; /* Read-only */ 60 {
90 SDL_PixelFormat *format; /* Read-only */ 61 Uint32 flags; /* Read-only */
91 int w, h; /* Read-only */ 62 SDL_PixelFormat *format; /* Read-only */
92 Uint16 pitch; /* Read-only */ 63 int w, h; /* Read-only */
93 void *pixels; /* Read-write */ 64 Uint16 pitch; /* Read-only */
94 int offset; /* Private */ 65 void *pixels; /* Read-write */
95 66 int offset; /* Private */
96 /* Hardware-specific surface info */ 67
97 struct private_hwdata *hwdata; 68 /* Hardware-specific surface info */
98 69 struct private_hwdata *hwdata;
99 /* clipping information */ 70
100 SDL_Rect clip_rect; /* Read-only */ 71 /* clipping information */
101 Uint32 unused1; /* for binary compatibility */ 72 SDL_Rect clip_rect; /* Read-only */
102 73 Uint32 unused1; /* for binary compatibility */
103 /* Allow recursive locks */ 74
104 Uint32 locked; /* Private */ 75 /* Allow recursive locks */
105 76 Uint32 locked; /* Private */
106 /* info for fast blit mapping to other surfaces */ 77
107 struct SDL_BlitMap *map; /* Private */ 78 /* info for fast blit mapping to other surfaces */
108 79 struct SDL_BlitMap *map; /* Private */
109 /* format version, bumped at every change to invalidate blit maps */ 80
110 unsigned int format_version; /* Private */ 81 /* format version, bumped at every change to invalidate blit maps */
111 82 unsigned int format_version; /* Private */
112 /* Reference count -- used when freeing surface */ 83
113 int refcount; /* Read-mostly */ 84 /* Reference count -- used when freeing surface */
85 int refcount; /* Read-mostly */
114 } SDL_Surface; 86 } SDL_Surface;
115 87
116 /* These are the currently supported flags for the SDL_surface */ 88 /* The most common video overlay formats.
117 /* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ 89 For an explanation of these pixel formats, see:
118 #define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */ 90 http://www.webartz.com/fourcc/indexyuv.htm
119 #define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */ 91
120 #define SDL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */ 92 For information on the relationship between color spaces, see:
121 /* Available for SDL_SetVideoMode() */ 93 http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
122 #define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */ 94 */
123 #define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */ 95 #define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */
124 #define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */ 96 #define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */
125 #define SDL_FULLSCREEN 0x80000000 /* Surface is a full screen display */ 97 #define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
126 #define SDL_OPENGL 0x00000002 /* Create an OpenGL rendering context */ 98 #define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
127 #define SDL_INTERNALOPENGL 0x00000008 /* SDL uses OpenGL internally for this window */ 99 #define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
128 #define SDL_RESIZABLE 0x00000010 /* This video mode may be resized */ 100
129 #define SDL_NOFRAME 0x00000020 /* No window caption or edge frame */ 101 /* The YUV hardware video overlay */
130 /* Used internally (read-only) */ 102 typedef struct SDL_Overlay
131 #define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */ 103 {
132 #define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */ 104 Uint32 format; /* Read-only */
133 #define SDL_RLEACCELOK 0x00002000 /* Private flag */ 105 int w, h; /* Read-only */
134 #define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */ 106 int planes; /* Read-only */
135 #define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */ 107 Uint16 *pitches; /* Read-only */
136 #define SDL_PREALLOC 0x01000000 /* Surface uses preallocated memory */ 108 Uint8 **pixels; /* Read-write */
109
110 /* Hardware-specific surface info */
111 struct private_yuvhwfuncs *hwfuncs;
112 struct private_yuvhwdata *hwdata;
113
114 /* Special flags */
115 Uint32 hw_overlay:1; /* Flag: This overlay hardware accelerated? */
116 Uint32 UnusedBits:31;
117 } SDL_Overlay;
137 118
138 /* Evaluates to true if the surface needs to be locked before access */ 119 /* Evaluates to true if the surface needs to be locked before access */
139 #define SDL_MUSTLOCK(surface) \ 120 #define SDL_MUSTLOCK(surface) \
140 (surface->offset || \ 121 (surface->offset || \
141 ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) 122 ((surface->flags & (SDL_HWSURFACE|SDL_RLEACCEL)) != 0))
142 123
143 /* typedef for private surface blitting functions */ 124 /* typedef for private surface blitting functions */
144 typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, 125 typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
145 struct SDL_Surface *dst, SDL_Rect *dstrect); 126 struct SDL_Surface * dst, SDL_Rect * dstrect);
146 127
147 128
148 /* Useful for determining the video hardware capabilities */ 129 /* Useful for determining the video hardware capabilities */
149 typedef struct SDL_VideoInfo { 130 typedef struct SDL_VideoInfo
150 Uint32 hw_available :1; /* Flag: Can you create hardware surfaces? */ 131 {
151 Uint32 wm_available :1; /* Flag: Can you talk to a window manager? */ 132 Uint32 hw_available:1; /* Flag: Can you create hardware surfaces? */
152 Uint32 UnusedBits1 :6; 133 Uint32 wm_available:1; /* Flag: Can you talk to a window manager? */
153 Uint32 UnusedBits2 :1; 134 Uint32 UnusedBits1:6;
154 Uint32 blit_hw :1; /* Flag: Accelerated blits HW --> HW */ 135 Uint32 UnusedBits2:1;
155 Uint32 blit_hw_CC :1; /* Flag: Accelerated blits with Colorkey */ 136 Uint32 blit_hw:1; /* Flag: Accelerated blits HW --> HW */
156 Uint32 blit_hw_A :1; /* Flag: Accelerated blits with Alpha */ 137 Uint32 blit_hw_CC:1; /* Flag: Accelerated blits with Colorkey */
157 Uint32 blit_sw :1; /* Flag: Accelerated blits SW --> HW */ 138 Uint32 blit_hw_A:1; /* Flag: Accelerated blits with Alpha */
158 Uint32 blit_sw_CC :1; /* Flag: Accelerated blits with Colorkey */ 139 Uint32 blit_sw:1; /* Flag: Accelerated blits SW --> HW */
159 Uint32 blit_sw_A :1; /* Flag: Accelerated blits with Alpha */ 140 Uint32 blit_sw_CC:1; /* Flag: Accelerated blits with Colorkey */
160 Uint32 blit_fill :1; /* Flag: Accelerated color fill */ 141 Uint32 blit_sw_A:1; /* Flag: Accelerated blits with Alpha */
161 Uint32 UnusedBits3 :16; 142 Uint32 blit_fill:1; /* Flag: Accelerated color fill */
162 Uint32 video_mem; /* The total amount of video memory (in K) */ 143 Uint32 UnusedBits3:16;
163 SDL_PixelFormat *vfmt; /* Value: The format of the video surface */ 144 Uint32 video_mem; /* The total amount of video memory (in K) */
164 int current_w; /* Value: The current video mode width */
165 int current_h; /* Value: The current video mode height */
166 } SDL_VideoInfo; 145 } SDL_VideoInfo;
167 146
168 147 /**
169 /* The most common video overlay formats. 148 * \struct SDL_DisplayMode
170 For an explanation of these pixel formats, see: 149 *
171 http://www.webartz.com/fourcc/indexyuv.htm 150 * \brief The structure that defines a display mode
172 151 *
173 For information on the relationship between color spaces, see: 152 * \sa SDL_GetNumDisplayModes()
174 http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html 153 * \sa SDL_GetDisplayMode()
175 */ 154 * \sa SDL_GetDesktopDisplayMode()
176 #define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */ 155 * \sa SDL_GetCurrentDisplayMode()
177 #define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */ 156 * \sa SDL_GetClosestDisplayMode()
178 #define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */ 157 * \sa SDL_SetDisplayMode()
179 #define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */ 158 */
180 #define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */ 159 typedef struct
181 160 {
182 /* The YUV hardware video overlay */ 161 Uint32 format; /**< pixel format */
183 typedef struct SDL_Overlay { 162 int w; /**< width */
184 Uint32 format; /* Read-only */ 163 int h; /**< height */
185 int w, h; /* Read-only */ 164 int refresh_rate; /**< refresh rate (or zero for unspecified) */
186 int planes; /* Read-only */ 165 } SDL_DisplayMode;
187 Uint16 *pitches; /* Read-only */ 166
188 Uint8 **pixels; /* Read-write */ 167 /**
189 168 * \typedef SDL_WindowID
190 /* Hardware-specific surface info */ 169 *
191 struct private_yuvhwfuncs *hwfuncs; 170 * \brief The type used to identify a window
192 struct private_yuvhwdata *hwdata; 171 *
193 172 * \sa SDL_CreateWindow()
194 /* Special flags */ 173 * \sa SDL_CreateWindowFrom()
195 Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */ 174 * \sa SDL_DestroyWindow()
196 Uint32 UnusedBits :31; 175 * \sa SDL_GetWindowData()
197 } SDL_Overlay; 176 * \sa SDL_GetWindowFlags()
198 177 * \sa SDL_GetWindowGrab()
199 178 * \sa SDL_GetWindowPosition()
200 /* Public enumeration for setting the OpenGL window attributes. */ 179 * \sa SDL_GetWindowSize()
201 typedef enum { 180 * \sa SDL_GetWindowTitle()
181 * \sa SDL_HideWindow()
182 * \sa SDL_MaximizeWindow()
183 * \sa SDL_MinimizeWindow()
184 * \sa SDL_RaiseWindow()
185 * \sa SDL_RestoreWindow()
186 * \sa SDL_SetWindowData()
187 * \sa SDL_SetWindowGrab()
188 * \sa SDL_SetWindowIcon()
189 * \sa SDL_SetWindowPosition()
190 * \sa SDL_SetWindowSize()
191 * \sa SDL_SetWindowTitle()
192 * \sa SDL_ShowWindow()
193 */
194 typedef Uint32 SDL_WindowID;
195
196 /**
197 * \enum SDL_WindowFlags
198 *
199 * \brief The flags on a window
200 */
201 typedef enum
202 {
203 SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window, implies borderless */
204 SDL_WINDOW_BORDERLESS = 0x00000002, /**< no window decoration */
205 SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */
206 SDL_WINDOW_OPENGL = 0x00000008, /**< window usable with OpenGL context */
207 SDL_WINDOW_RESIZABLE = 0x00000010, /**< window can be resized */
208 SDL_WINDOW_MAXIMIZED = 0x00000020, /**< maximized */
209 SDL_WINDOW_MINIMIZED = 0x00000040, /**< minimized */
210 SDL_WINDOW_INPUT_GRABBED = 0x00000080, /**< window has grabbed input focus */
211 SDL_WINDOW_KEYBOARD_FOCUS = 0x00000100, /**< window has keyboard focus */
212 SDL_WINDOW_MOUSE_FOCUS = 0x00000200, /**< window has mouse focus */
213 } SDL_WindowFlags;
214
215 /**
216 * \enum SDL_WindowEventID
217 *
218 * \brief Event subtype for window events
219 */
220 typedef enum
221 {
222 SDL_WINDOWEVENT_NONE, /**< Never used */
223 SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */
224 SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */
225 SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1,data2 */
226 SDL_WINDOWEVENT_RESIZED, /**< Window size changed to data1xdata2 */
227 SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */
228 SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */
229 SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size and position */
230 SDL_WINDOWEVENT_ENTER, /**< The window has gained mouse focus */
231 SDL_WINDOWEVENT_LEAVE, /**< The window has lost mouse focus */
232 SDL_WINDOWEVENT_FOCUS_GAINED, /**< The window has gained keyboard focus */
233 SDL_WINDOWEVENT_FOCUS_LOST, /**< The window has lost keyboard focus */
234 } SDL_WindowEventID;
235
236 /**
237 * \enum SDL_GLattr
238 *
239 * \brief OpenGL configuration attributes
240 */
241 typedef enum
242 {
202 SDL_GL_RED_SIZE, 243 SDL_GL_RED_SIZE,
203 SDL_GL_GREEN_SIZE, 244 SDL_GL_GREEN_SIZE,
204 SDL_GL_BLUE_SIZE, 245 SDL_GL_BLUE_SIZE,
205 SDL_GL_ALPHA_SIZE, 246 SDL_GL_ALPHA_SIZE,
206 SDL_GL_BUFFER_SIZE, 247 SDL_GL_BUFFER_SIZE,
216 SDL_GL_MULTISAMPLESAMPLES, 257 SDL_GL_MULTISAMPLESAMPLES,
217 SDL_GL_ACCELERATED_VISUAL, 258 SDL_GL_ACCELERATED_VISUAL,
218 SDL_GL_SWAP_CONTROL 259 SDL_GL_SWAP_CONTROL
219 } SDL_GLattr; 260 } SDL_GLattr;
220 261
221 /* flags for SDL_SetPalette() */ 262 /* These are the currently supported flags for the SDL_surface */
222 #define SDL_LOGPAL 0x01 263 #define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */
223 #define SDL_PHYSPAL 0x02 264 #define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */
265 /* Available for SDL_CreateWindowSurface() */
266 #define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
267 #define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
268 #define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered surface */
269 /* Used internally (read-only) */
270 #define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
271 #define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
272 #define SDL_RLEACCELOK 0x00002000 /* Private flag */
273 #define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
274 #define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */
275 #define SDL_PREALLOC 0x00100000 /* Surface uses preallocated memory */
276 #define SDL_SCREEN_SURFACE 0x01000000 /* Surface is a window screen surface */
277 #define SDL_SHADOW_SURFACE 0x02000000 /* Surface is a window shadow surface */
224 278
225 /* Function prototypes */ 279 /* Function prototypes */
226 280
227 /* These functions return the list of built in video drivers, in the 281 /**
228 * order that they are normally initialized by default. 282 * \fn int SDL_GetNumVideoDrivers(void)
229 */ 283 *
230 extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); 284 * \brief Get the number of video drivers compiled into SDL
231 extern DECLSPEC const char * SDLCALL SDL_GetVideoDriver(int index); 285 *
232 286 * \sa SDL_GetVideoDriver()
233 /* These functions are used internally, and should not be used unless you 287 */
234 * have a specific need to specify the video driver you want to use. 288 extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers (void);
235 * You should normally use SDL_Init() or SDL_InitSubSystem(). 289
236 * 290 /**
237 * SDL_VideoInit() initializes the video subsystem -- sets up a connection 291 * \fn const char *SDL_GetVideoDriver(int index)
238 * to the window manager, etc, and determines the current video mode and 292 *
239 * pixel format, but does not initialize a window or graphics mode. 293 * \brief Get the name of a built in video driver.
240 * Note that event handling is activated by this routine. 294 *
241 * 295 * \note The video drivers are presented in the order in which they are
242 * If you use both sound and video in your application, you need to call 296 * normally checked during initialization.
243 * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, 297 *
244 * you won't be able to set full-screen display modes. 298 * \sa SDL_GetNumVideoDrivers()
245 */ 299 */
246 extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); 300 extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver (int index);
247 extern DECLSPEC void SDLCALL SDL_VideoQuit(void); 301
248 302 /**
249 /* This function returns the name of the current video driver, or NULL 303 * \fn int SDL_VideoInit(const char *driver_name, Uint32 flags)
250 * if no driver has been initialized. 304 *
251 */ 305 * \brief Initialize the video subsystem, optionally specifying a video driver.
252 extern DECLSPEC const char * SDLCALL SDL_GetCurrentVideoDriver(void); 306 *
253 307 * \param driver_name Initialize a specific driver by name, or NULL for the default video driver.
254 /* 308 * \param flags FIXME: Still needed?
255 * This function returns a pointer to the current display surface. 309 *
256 * If SDL is doing format conversion on the display surface, this 310 * \return 0 on success, -1 on error
257 * function returns the publicly visible surface, not the real video 311 *
258 * surface. 312 * This function initializes the video subsystem; setting up a connection
259 */ 313 * to the window manager, etc, and determines the available display modes
260 extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); 314 * and pixel formats, but does not initialize a window or graphics mode.
261 315 *
262 /* 316 * \sa SDL_VideoQuit()
263 * This function returns a read-only pointer to information about the 317 */
264 * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' 318 extern DECLSPEC int SDLCALL SDL_VideoInit (const char *driver_name,
265 * member of the returned structure will contain the pixel format of the 319 Uint32 flags);
266 * "best" video mode. 320
267 */ 321 /**
268 extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); 322 * \fn void SDL_VideoQuit(void)
269 323 *
270 /* 324 * \brief Shuts down the video subsystem.
271 * Check to see if a particular video mode is supported. 325 *
272 * It returns 0 if the requested mode is not supported under any bit depth, 326 * This function closes all windows, and restores the original video mode.
273 * or returns the bits-per-pixel of the closest available mode with the 327 *
274 * given width and height. If this bits-per-pixel is different from the 328 * \sa SDL_VideoInit()
275 * one used when setting the video mode, SDL_SetVideoMode() will succeed, 329 */
276 * but will emulate the requested bits-per-pixel with a shadow surface. 330 extern DECLSPEC void SDLCALL SDL_VideoQuit (void);
277 * 331
278 * The arguments to SDL_VideoModeOK() are the same ones you would pass to 332 /**
279 * SDL_SetVideoMode() 333 * \fn const char *SDL_GetCurrentVideoDriver(void)
280 */ 334 *
281 extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); 335 * \brief Returns the name of the currently initialized video driver.
282 336 *
283 /* 337 * \return The name of the current video driver or NULL if no driver
284 * Return a pointer to an array of available screen dimensions for the 338 * has been initialized
285 * given format and video flags, sorted largest to smallest. Returns 339 *
286 * NULL if there are no dimensions available for a particular format, 340 * \sa SDL_GetNumVideoDrivers()
287 * or (SDL_Rect **)-1 if any dimension is okay for the given format. 341 * \sa SDL_GetVideoDriver()
288 * 342 */
289 * If 'format' is NULL, the mode list will be for the format given 343 extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver (void);
290 * by SDL_GetVideoInfo()->vfmt 344
291 */ 345 /**
292 extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); 346 * \fn const SDL_VideoInfo *SDL_GetVideoInfo(void)
293 347 *
294 /* 348 * \brief Returns information about the currently initialized video driver.
295 * Set up a video mode with the specified width, height and bits-per-pixel. 349 *
296 * 350 * \return A read-only pointer to information about the video hardware,
297 * If 'bpp' is 0, it is treated as the current display bits per pixel. 351 * or NULL if no video driver has been initialized.
298 * 352 */
299 * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the 353 extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo (void);
300 * requested bits-per-pixel, but will return whatever video pixel format is 354
301 * available. The default is to emulate the requested pixel format if it 355 /**
302 * is not natively available. 356 * \fn int SDL_GetNumVideoDisplays(void)
303 * 357 *
304 * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in 358 * \brief Returns the number of available video displays.
305 * video memory, if possible, and you may have to call SDL_LockSurface() 359 *
306 * in order to access the raw framebuffer. Otherwise, the video surface 360 * \sa SDL_SelectVideoDisplay()
307 * will be created in system memory. 361 */
308 * 362 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays (void);
309 * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle 363
310 * updates asynchronously, but you must always lock before accessing pixels. 364 /**
311 * SDL will wait for updates to complete before returning from the lock. 365 * \fn int SDL_SelectVideoDisplay(int index)
312 * 366 *
313 * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee 367 * \brief Set the index of the currently selected display.
314 * that the colors set by SDL_SetColors() will be the colors you get. 368 *
315 * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all 369 * \note You can query the currently selected display by passing an index of -1.
316 * of the colors exactly the way they are requested, and you should look 370 *
317 * at the video surface structure to determine the actual palette. 371 * \sa SDL_GetNumVideoDisplays()
318 * If SDL cannot guarantee that the colors you request can be set, 372 */
319 * i.e. if the colormap is shared, then the video surface may be created 373 extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay (int index);
320 * under emulation in system memory, overriding the SDL_HWSURFACE flag. 374
321 * 375 /**
322 * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set 376 * \fn int SDL_GetNumDisplayModes(void)
323 * a fullscreen video mode. The default is to create a windowed mode 377 *
324 * if the current graphics system has a window manager. 378 * \brief Returns the number of available display modes for the current display.
325 * If the SDL library is able to set a fullscreen video mode, this flag 379 *
326 * will be set in the surface that is returned. 380 * \sa SDL_GetDisplayMode()
327 * 381 */
328 * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up 382 extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes (void);
329 * two surfaces in video memory and swap between them when you call 383
330 * SDL_Flip(). This is usually slower than the normal single-buffering 384 /**
331 * scheme, but prevents "tearing" artifacts caused by modifying video 385 * \fn const SDL_DisplayMode *SDL_GetDisplayMode(int index)
332 * memory while the monitor is refreshing. It should only be used by 386 *
333 * applications that redraw the entire screen on every update. 387 * \brief Retrieve information about a specific display mode.
334 * 388 *
335 * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the 389 * \note The display modes are sorted in this priority:
336 * window manager, if any, to resize the window at runtime. When this 390 * \li bits per pixel -> more colors to fewer colors
337 * occurs, SDL will send a SDL_VIDEORESIZE event to you application, 391 * \li width -> largest to smallest
338 * and you must respond to the event by re-calling SDL_SetVideoMode() 392 * \li height -> largest to smallest
339 * with the requested size (or another size that suits the application). 393 * \li refresh rate -> highest to lowest
340 * 394 *
341 * If SDL_NOFRAME is set in 'flags', the SDL library will create a window 395 * \sa SDL_GetNumDisplayModes()
342 * without any title bar or frame decoration. Fullscreen video modes have 396 */
343 * this flag set automatically. 397 extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetDisplayMode (int index);
344 * 398
345 * This function returns the video framebuffer surface, or NULL if it fails. 399 /**
346 * 400 * \fn const SDL_DisplayMode *SDL_GetDesktopDisplayMode(void)
347 * If you rely on functionality provided by certain video flags, check the 401 *
348 * flags of the returned surface to make sure that functionality is available. 402 * \brief Retrieve information about the desktop display mode for the current display.
349 * SDL will fall back to reduced functionality if the exact flags you wanted 403 */
350 * are not available. 404 extern DECLSPEC const SDL_DisplayMode *SDLCALL
351 */ 405 SDL_GetDesktopDisplayMode (void);
352 extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode 406
353 (int width, int height, int bpp, Uint32 flags); 407 /**
408 * \fn const SDL_DisplayMode *SDL_GetCurrentDisplayMode(void)
409 *
410 * \brief Retrieve information about the current display mode.
411 */
412 extern DECLSPEC const SDL_DisplayMode *SDLCALL
413 SDL_GetCurrentDisplayMode (void);
414
415 /**
416 * \fn SDL_DisplayMode *SDL_GetClosestDisplayMode(const SDL_DisplayMode *mode, SDL_DisplayMode *closest)
417 *
418 * \brief Get the closest match to the requested display mode.
419 *
420 * \param mode The desired display mode
421 * \param closest A pointer to a display mode to be filled in with the closest match of the available display modes.
422 *
423 * \return The passed in value 'closest', or NULL if no matching video mode was available.
424 *
425 * The available display modes are scanned, and 'closest' is filled in with the closest mode matching the requested mode and returned. The mode format and refresh_rate default to the desktop mode if they are 0. The modes are scanned with size being first priority, format being second priority, and finally checking the refresh_rate. If all the available modes are too small, then NULL is returned.
426 *
427 * \sa SDL_GetNumDisplayModes()
428 * \sa SDL_GetDisplayMode()
429 */
430 extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode (const
431 SDL_DisplayMode
432 * mode,
433 SDL_DisplayMode
434 *
435 closest);
436
437 /**
438 * \fn int SDL_SetDisplayMode(const SDL_DisplayMode *mode)
439 *
440 * \brief Set up the closest available mode on the current display.
441 *
442 * \param mode The desired display mode
443 *
444 * \return 0 on success, or -1 if setting the display mode failed.
445 */
446 extern DECLSPEC int SDLCALL SDL_SetDisplayMode (const SDL_DisplayMode * mode);
447
448 /**
449 * \fn SDL_WindowID SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
450 *
451 * \brief Create a window with the specified position, dimensions, and flags.
452 *
453 * \param title The title of the window
454 * \param x The x position of the window
455 * \param y The y position of the window
456 * \param w The width of the window
457 * \param h The height of the window
458 * \param flags The flags for the window
459 *
460 * \return The id of the window created, or zero if window creation failed.
461 *
462 * \note Setting the position to -1, -1, indicates any position is fine.
463 *
464 * \sa SDL_DestroyWindow()
465 */
466 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindow (const char *title,
467 int x, int y, int w,
468 int h, Uint32 flags);
469
470 /**
471 * \fn SDL_WindowID SDL_CreateWindowFrom(void *data)
472 *
473 * \brief Create an SDL window struct from an existing native window.
474 *
475 * \param data A pointer to driver-dependent window creation data
476 *
477 * \return The id of the window created, or zero if window creation failed.
478 *
479 * \warning This function is NOT SUPPORTED, use at your own risk!
480 *
481 * \sa SDL_DestroyWindow()
482 */
483 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom (void *data);
484
485 /**
486 * \fn Uint32 SDL_GetWindowFlags(SDL_WindowID windowID)
487 *
488 * \brief Get the window flags.
489 */
490 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags (SDL_WindowID windowID);
491
492 /**
493 * \fn void SDL_SetWindowTitle(SDL_WindowID windowID, const char *title)
494 *
495 * \brief Set the title of the window, in UTF-8 format.
496 *
497 * \sa SDL_GetWindowTitle()
498 */
499 extern DECLSPEC void SDLCALL SDL_SetWindowTitle (SDL_WindowID windowID,
500 const char *title);
501
502 /**
503 * \fn const char *SDL_GetWindowTitle(SDL_WindowID windowID)
504 *
505 * \brief Get the title of the window, in UTF-8 format.
506 *
507 * \sa SDL_SetWindowTitle()
508 */
509 extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle (SDL_WindowID
510 windowID);
511
512 /**
513 * \fn void SDL_SetWindowIcon(SDL_Surface *icon)
514 *
515 * \brief Set the icon of the window.
516 *
517 * \param icon The icon for the window
518 *
519 * FIXME: The icon needs to be set before the window is first shown. Should some icon representation be part of the window creation data?
520 */
521 extern DECLSPEC void SDLCALL SDL_SetWindowIcon (SDL_Surface * icon);
522
523 /**
524 * \fn void SDL_SetWindowData(SDL_WindowID windowID, void *userdata)
525 *
526 * \brief Associate an arbitrary pointer with the window.
527 *
528 * \sa SDL_GetWindowData()
529 */
530 extern DECLSPEC void SDLCALL SDL_SetWindowData (SDL_WindowID windowID,
531 void *userdata);
532
533 /**
534 * \fn void *SDL_GetWindowData(SDL_WindowID windowID)
535 *
536 * \brief Retrieve the data pointer associated with the window.
537 *
538 * \sa SDL_SetWindowData()
539 */
540 extern DECLSPEC void *SDLCALL SDL_GetWindowData (SDL_WindowID windowID);
541
542 /**
543 * \fn void SDL_SetWindowPosition(SDL_WindowID windowID, int x, int y)
544 *
545 * \brief Set the position of the window.
546 *
547 * \sa SDL_GetWindowPosition()
548 */
549 extern DECLSPEC void SDLCALL SDL_SetWindowPosition (SDL_WindowID windowID,
550 int x, int y);
551
552 /**
553 * \fn void SDL_GetWindowPosition(SDL_WindowID windowID, int *x, int *y)
554 *
555 * \brief Get the position of the window.
556 *
557 * \sa SDL_SetWindowPosition()
558 */
559 extern DECLSPEC void SDLCALL SDL_GetWindowPosition (SDL_WindowID windowID,
560 int *x, int *y);
561
562 /**
563 * \fn void SDL_SetWindowSize(SDL_WindowID windowID, int w, int w)
564 *
565 * \brief Set the size of the window's client area.
566 *
567 * \note You can't change the size of a fullscreen window, it automatically
568 * matches the size of the display mode.
569 *
570 * \sa SDL_GetWindowSize()
571 */
572 extern DECLSPEC void SDLCALL SDL_SetWindowSize (SDL_WindowID windowID, int w,
573 int h);
574
575 /**
576 * \fn void SDL_GetWindowSize(SDL_WindowID windowID, int *w, int *w)
577 *
578 * \brief Get the size of the window's client area.
579 *
580 * \sa SDL_SetWindowSize()
581 */
582 extern DECLSPEC void SDLCALL SDL_GetWindowSize (SDL_WindowID windowID, int *w,
583 int *h);
584
585 /**
586 * \fn void SDL_ShowWindow(SDL_WindowID windowID)
587 *
588 * \brief Show the window
589 *
590 * \sa SDL_HideWindow()
591 */
592 extern DECLSPEC void SDLCALL SDL_ShowWindow (SDL_WindowID windowID);
593
594 /**
595 * \fn void SDL_HideWindow(SDL_WindowID windowID)
596 *
597 * \brief Hide the window
598 *
599 * \sa SDL_ShowWindow()
600 */
601 extern DECLSPEC void SDLCALL SDL_HideWindow (SDL_WindowID windowID);
602
603 /**
604 * \fn void SDL_RaiseWindow(SDL_WindowID windowID)
605 *
606 * \brief Raise the window so it's above other windows.
607 */
608 extern DECLSPEC void SDLCALL SDL_RaiseWindow (SDL_WindowID windowID);
609
610 /**
611 * \fn void SDL_MaximizeWindow(SDL_WindowID windowID)
612 *
613 * \brief Make the window as large as possible.
614 *
615 * \sa SDL_RestoreWindow()
616 */
617 extern DECLSPEC void SDLCALL SDL_MaximizeWindow (SDL_WindowID windowID);
618
619 /**
620 * \fn void SDL_MinimizeWindow(SDL_WindowID windowID)
621 *
622 * \brief Minimize the window to an iconic representation.
623 *
624 * \sa SDL_RestoreWindow()
625 */
626 extern DECLSPEC void SDLCALL SDL_MinimizeWindow (SDL_WindowID windowID);
627
628 /**
629 * \fn void SDL_RestoreWindow(SDL_WindowID windowID)
630 *
631 * \brief Restore the size and position of a minimized or maximized window.
632 *
633 * \sa SDL_MaximizeWindow()
634 * \sa SDL_MinimizeWindow()
635 */
636 extern DECLSPEC void SDLCALL SDL_RestoreWindow (SDL_WindowID windowID);
637
638 /**
639 * \fn void SDL_SetWindowGrab(SDL_WindowID windowID, int mode)
640 *
641 * \brief Set the window's input grab mode.
642 *
643 * \param mode This is 1 to grab input, and 0 to release input.
644 *
645 * \sa SDL_GrabMode
646 * \sa SDL_GetWindowGrab()
647 */
648 extern DECLSPEC void SDLCALL SDL_SetWindowGrab (SDL_WindowID windowID,
649 int mode);
650
651 /**
652 * \fn int SDL_GetWindowGrab(SDL_WindowID windowID)
653 *
654 * \brief Get the window's input grab mode.
655 *
656 * \return This returns 1 if input is grabbed, and 0 otherwise.
657 *
658 * \sa SDL_GrabMode
659 * \sa SDL_SetWindowGrab()
660 */
661 extern DECLSPEC int SDLCALL SDL_GetWindowGrab (SDL_WindowID windowID);
662
663 /**
664 * \fn void SDL_DestroyWindow(SDL_WindowID windowID)
665 *
666 * \brief Destroy a window.
667 */
668 extern DECLSPEC void SDLCALL SDL_DestroyWindow (SDL_WindowID windowID);
669
670 /**
671 * \fn SDL_Surface *SDL_CreateWindowSurface (SDL_WindowID windowID, Uint32 format, Uint32 flags)
672 *
673 * \brief Create an SDL_Surface representing the drawing area of the window.
674 */
675 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateWindowSurface (SDL_WindowID
676 windowID,
677 Uint32 format,
678 Uint32 flags);
354 679
355 /* 680 /*
356 * Makes sure the given list of rectangles is updated on the given screen. 681 * Makes sure the given list of rectangles is updated on the given screen.
357 * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire 682 * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
358 * screen. 683 * screen.
359 * These functions should not be called while 'screen' is locked. 684 * These functions should not be called while 'screen' is locked.
360 */ 685 */
361 extern DECLSPEC void SDLCALL SDL_UpdateRects 686 extern DECLSPEC void SDLCALL SDL_UpdateRects
362 (SDL_Surface *screen, int numrects, SDL_Rect *rects); 687 (SDL_Surface * screen, int numrects, SDL_Rect * rects);
363 extern DECLSPEC void SDLCALL SDL_UpdateRect 688 extern DECLSPEC void SDLCALL SDL_UpdateRect
364 (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); 689 (SDL_Surface * screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
365 690
366 /* 691 /*
367 * On hardware that supports double-buffering, this function sets up a flip 692 * On hardware that supports double-buffering, this function sets up a flip
368 * and returns. The hardware will wait for vertical retrace, and then swap 693 * and returns. The hardware will wait for vertical retrace, and then swap
369 * video buffers before the next video surface blit or lock will return. 694 * video buffers before the next video surface blit or lock will return.
371 * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); 696 * to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
372 * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when 697 * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
373 * setting the video mode for this function to perform hardware flipping. 698 * setting the video mode for this function to perform hardware flipping.
374 * This function returns 0 if successful, or -1 if there was an error. 699 * This function returns 0 if successful, or -1 if there was an error.
375 */ 700 */
376 extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); 701 extern DECLSPEC int SDLCALL SDL_Flip (SDL_Surface * screen);
377 702
378 /* 703 /*
379 * Set the gamma correction for each of the color channels. 704 * Set the gamma correction for each of the color channels.
380 * The gamma values range (approximately) between 0.1 and 10.0 705 * The gamma values range (approximately) between 0.1 and 10.0
381 * 706 *
382 * If this function isn't supported directly by the hardware, it will 707 * If this function isn't supported directly by the hardware, it will
383 * be emulated using gamma ramps, if available. If successful, this 708 * be emulated using gamma ramps, if available. If successful, this
384 * function returns 0, otherwise it returns -1. 709 * function returns 0, otherwise it returns -1.
385 */ 710 */
386 extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); 711 extern DECLSPEC int SDLCALL SDL_SetGamma (float red, float green, float blue);
387 712
388 /* 713 /*
389 * Set the gamma translation table for the red, green, and blue channels 714 * Set the gamma translation table for the red, green, and blue channels
390 * of the video hardware. Each table is an array of 256 16-bit quantities, 715 * of the video hardware. Each table is an array of 256 16-bit quantities,
391 * representing a mapping between the input and output for that channel. 716 * representing a mapping between the input and output for that channel.
395 * You may pass NULL for any of the channels to leave it unchanged. 720 * You may pass NULL for any of the channels to leave it unchanged.
396 * If the call succeeds, it will return 0. If the display driver or 721 * If the call succeeds, it will return 0. If the display driver or
397 * hardware does not support gamma translation, or otherwise fails, 722 * hardware does not support gamma translation, or otherwise fails,
398 * this function will return -1. 723 * this function will return -1.
399 */ 724 */
400 extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); 725 extern DECLSPEC int SDLCALL SDL_SetGammaRamp (const Uint16 * red,
726 const Uint16 * green,
727 const Uint16 * blue);
401 728
402 /* 729 /*
403 * Retrieve the current values of the gamma translation tables. 730 * Retrieve the current values of the gamma translation tables.
404 * 731 *
405 * You must pass in valid pointers to arrays of 256 16-bit quantities. 732 * You must pass in valid pointers to arrays of 256 16-bit quantities.
406 * Any of the pointers may be NULL to ignore that channel. 733 * Any of the pointers may be NULL to ignore that channel.
407 * If the call succeeds, it will return 0. If the display driver or 734 * If the call succeeds, it will return 0. If the display driver or
408 * hardware does not support gamma translation, or otherwise fails, 735 * hardware does not support gamma translation, or otherwise fails,
409 * this function will return -1. 736 * this function will return -1.
410 */ 737 */
411 extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); 738 extern DECLSPEC int SDLCALL SDL_GetGammaRamp (Uint16 * red, Uint16 * green,
739 Uint16 * blue);
412 740
413 /* 741 /*
414 * Sets a portion of the colormap for the given 8-bit surface. If 'surface' 742 * Sets a portion of the colormap for the given 8-bit surface. If 'surface'
415 * is not a palettized surface, this function does nothing, returning 0. 743 * is not a palettized surface, this function does nothing, returning 0.
416 * If all of the colors were set as passed to SDL_SetColors(), it will 744 * If all of the colors were set as passed to SDL_SetColors(), it will
423 * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() 751 * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
424 * will always return 1, and the palette is guaranteed to be set the way 752 * will always return 1, and the palette is guaranteed to be set the way
425 * you desire, even if the window colormap has to be warped or run under 753 * you desire, even if the window colormap has to be warped or run under
426 * emulation. 754 * emulation.
427 */ 755 */
428 extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, 756 extern DECLSPEC int SDLCALL SDL_SetColors (SDL_Surface * surface,
429 SDL_Color *colors, int firstcolor, int ncolors); 757 SDL_Color * colors, int firstcolor,
430 758 int ncolors);
431 /*
432 * Sets a portion of the colormap for a given 8-bit surface.
433 * 'flags' is one or both of:
434 * SDL_LOGPAL -- set logical palette, which controls how blits are mapped
435 * to/from the surface,
436 * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
437 * the screen
438 * Only screens have physical palettes. Separate change of physical/logical
439 * palettes is only possible if the screen has SDL_HWPALETTE set.
440 *
441 * The return value is 1 if all colours could be set as requested, and 0
442 * otherwise.
443 *
444 * SDL_SetColors() is equivalent to calling this function with
445 * flags = (SDL_LOGPAL|SDL_PHYSPAL).
446 */
447 extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
448 SDL_Color *colors, int firstcolor,
449 int ncolors);
450 759
451 /* 760 /*
452 * Maps an RGB triple to an opaque pixel value for a given pixel format 761 * Maps an RGB triple to an opaque pixel value for a given pixel format
453 */ 762 */
454 extern DECLSPEC Uint32 SDLCALL SDL_MapRGB 763 extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
455 (SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b); 764 (SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b);
456 765
457 /* 766 /*
458 * Maps an RGBA quadruple to a pixel value for a given pixel format 767 * Maps an RGBA quadruple to a pixel value for a given pixel format
459 */ 768 */
460 extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(SDL_PixelFormat *format, 769 extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA (SDL_PixelFormat * format,
461 Uint8 r, Uint8 g, Uint8 b, Uint8 a); 770 Uint8 r, Uint8 g, Uint8 b,
771 Uint8 a);
462 772
463 /* 773 /*
464 * Maps a pixel value into the RGB components for a given pixel format 774 * Maps a pixel value into the RGB components for a given pixel format
465 */ 775 */
466 extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, 776 extern DECLSPEC void SDLCALL SDL_GetRGB (Uint32 pixel, SDL_PixelFormat * fmt,
467 Uint8 *r, Uint8 *g, Uint8 *b); 777 Uint8 * r, Uint8 * g, Uint8 * b);
468 778
469 /* 779 /*
470 * Maps a pixel value into the RGBA components for a given pixel format 780 * Maps a pixel value into the RGBA components for a given pixel format
471 */ 781 */
472 extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, 782 extern DECLSPEC void SDLCALL SDL_GetRGBA (Uint32 pixel, SDL_PixelFormat * fmt,
473 Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); 783 Uint8 * r, Uint8 * g, Uint8 * b,
784 Uint8 * a);
474 785
475 /* 786 /*
476 * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) 787 * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
477 * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. 788 * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
478 * If the depth is greater than 8 bits, the pixel format is set using the 789 * If the depth is greater than 8 bits, the pixel format is set using the
505 * will be set in the flags member of the returned surface. If for some 816 * will be set in the flags member of the returned surface. If for some
506 * reason the surface could not be placed in video memory, it will not have 817 * reason the surface could not be placed in video memory, it will not have
507 * the SDL_HWSURFACE flag set, and will be created in system memory instead. 818 * the SDL_HWSURFACE flag set, and will be created in system memory instead.
508 */ 819 */
509 #define SDL_AllocSurface SDL_CreateRGBSurface 820 #define SDL_AllocSurface SDL_CreateRGBSurface
510 extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface 821 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
511 (Uint32 flags, int width, int height, int depth, 822 (Uint32 flags, int width, int height, int depth,
512 Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); 823 Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
513 extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, 824 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom (void *pixels,
514 int width, int height, int depth, int pitch, 825 int width,
515 Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); 826 int height,
516 extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); 827 int depth,
828 int pitch,
829 Uint32 Rmask,
830 Uint32 Gmask,
831 Uint32 Bmask,
832 Uint32 Amask);
833 extern DECLSPEC void SDLCALL SDL_FreeSurface (SDL_Surface * surface);
517 834
518 /* 835 /*
519 * SDL_LockSurface() sets up a surface for directly accessing the pixels. 836 * SDL_LockSurface() sets up a surface for directly accessing the pixels.
520 * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write 837 * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
521 * to and read from 'surface->pixels', using the pixel format stored in 838 * to and read from 'surface->pixels', using the pixel format stored in
531 * No operating system or library calls should be made between lock/unlock 848 * No operating system or library calls should be made between lock/unlock
532 * pairs, as critical system locks may be held during this time. 849 * pairs, as critical system locks may be held during this time.
533 * 850 *
534 * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. 851 * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
535 */ 852 */
536 extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); 853 extern DECLSPEC int SDLCALL SDL_LockSurface (SDL_Surface * surface);
537 extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); 854 extern DECLSPEC void SDLCALL SDL_UnlockSurface (SDL_Surface * surface);
538 855
539 /* 856 /*
540 * Load a surface from a seekable SDL data source (memory or file.) 857 * Load a surface from a seekable SDL data source (memory or file.)
541 * If 'freesrc' is non-zero, the source will be closed after being read. 858 * If 'freesrc' is non-zero, the source will be closed after being read.
542 * Returns the new surface, or NULL if there was an error. 859 * Returns the new surface, or NULL if there was an error.
543 * The new surface should be freed with SDL_FreeSurface(). 860 * The new surface should be freed with SDL_FreeSurface().
544 */ 861 */
545 extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); 862 extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW (SDL_RWops * src,
863 int freesrc);
546 864
547 /* Convenience macro -- load a surface from a file */ 865 /* Convenience macro -- load a surface from a file */
548 #define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) 866 #define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
549 867
550 /* 868 /*
551 * Save a surface to a seekable SDL data source (memory or file.) 869 * Save a surface to a seekable SDL data source (memory or file.)
552 * If 'freedst' is non-zero, the source will be closed after being written. 870 * If 'freedst' is non-zero, the source will be closed after being written.
553 * Returns 0 if successful or -1 if there was an error. 871 * Returns 0 if successful or -1 if there was an error.
554 */ 872 */
555 extern DECLSPEC int SDLCALL SDL_SaveBMP_RW 873 extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
556 (SDL_Surface *surface, SDL_RWops *dst, int freedst); 874 (SDL_Surface * surface, SDL_RWops * dst, int freedst);
557 875
558 /* Convenience macro -- save a surface to a file */ 876 /* Convenience macro -- save a surface to a file */
559 #define SDL_SaveBMP(surface, file) \ 877 #define SDL_SaveBMP(surface, file) \
560 SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) 878 SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
561 879
567 * and removes RLE acceleration if absent. 885 * and removes RLE acceleration if absent.
568 * If 'flag' is 0, this function clears any current color key. 886 * If 'flag' is 0, this function clears any current color key.
569 * This function returns 0, or -1 if there was an error. 887 * This function returns 0, or -1 if there was an error.
570 */ 888 */
571 extern DECLSPEC int SDLCALL SDL_SetColorKey 889 extern DECLSPEC int SDLCALL SDL_SetColorKey
572 (SDL_Surface *surface, Uint32 flag, Uint32 key); 890 (SDL_Surface * surface, Uint32 flag, Uint32 key);
573 891
574 /* 892 /*
575 * This function sets the alpha value for the entire surface, as opposed to 893 * This function sets the alpha value for the entire surface, as opposed to
576 * using the alpha component of each pixel. This value measures the range 894 * using the alpha component of each pixel. This value measures the range
577 * of transparency of the surface, 0 being completely transparent to 255 895 * of transparency of the surface, 0 being completely transparent to 255
584 * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the 902 * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
585 * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. 903 * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
586 * 904 *
587 * The 'alpha' parameter is ignored for surfaces that have an alpha channel. 905 * The 'alpha' parameter is ignored for surfaces that have an alpha channel.
588 */ 906 */
589 extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); 907 extern DECLSPEC int SDLCALL SDL_SetAlpha (SDL_Surface * surface, Uint32 flag,
908 Uint8 alpha);
590 909
591 /* 910 /*
592 * Sets the clipping rectangle for the destination surface in a blit. 911 * Sets the clipping rectangle for the destination surface in a blit.
593 * 912 *
594 * If the clip rectangle is NULL, clipping will be disabled. 913 * If the clip rectangle is NULL, clipping will be disabled.
598 * the intersection of the surface area and the clipping rectangle. 917 * the intersection of the surface area and the clipping rectangle.
599 * 918 *
600 * Note that blits are automatically clipped to the edges of the source 919 * Note that blits are automatically clipped to the edges of the source
601 * and destination surfaces. 920 * and destination surfaces.
602 */ 921 */
603 extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); 922 extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect (SDL_Surface * surface,
923 const SDL_Rect * rect);
604 924
605 /* 925 /*
606 * Gets the clipping rectangle for the destination surface in a blit. 926 * Gets the clipping rectangle for the destination surface in a blit.
607 * 'rect' must be a pointer to a valid rectangle which will be filled 927 * 'rect' must be a pointer to a valid rectangle which will be filled
608 * with the correct values. 928 * with the correct values.
609 */ 929 */
610 extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); 930 extern DECLSPEC void SDLCALL SDL_GetClipRect (SDL_Surface * surface,
931 SDL_Rect * rect);
611 932
612 /* 933 /*
613 * Creates a new surface of the specified format, and then copies and maps 934 * Creates a new surface of the specified format, and then copies and maps
614 * the given surface to it so the blit of the converted surface will be as 935 * the given surface to it so the blit of the converted surface will be as
615 * fast as possible. If this function fails, it returns NULL. 936 * fast as possible. If this function fails, it returns NULL.
619 * SDL will try to RLE accelerate colorkey and alpha blits in the resulting 940 * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
620 * surface. 941 * surface.
621 * 942 *
622 * This function is used internally by SDL_DisplayFormat(). 943 * This function is used internally by SDL_DisplayFormat().
623 */ 944 */
624 extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface 945 extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
625 (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); 946 (SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags);
626 947
627 /* 948 /*
628 * This performs a fast blit from the source surface to the destination 949 * This performs a fast blit from the source surface to the destination
629 * surface. It assumes that the source and destination rectangles are 950 * surface. It assumes that the source and destination rectangles are
630 * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire 951 * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
697 1018
698 /* This is the public blit function, SDL_BlitSurface(), and it performs 1019 /* This is the public blit function, SDL_BlitSurface(), and it performs
699 rectangle validation and clipping before passing it to SDL_LowerBlit() 1020 rectangle validation and clipping before passing it to SDL_LowerBlit()
700 */ 1021 */
701 extern DECLSPEC int SDLCALL SDL_UpperBlit 1022 extern DECLSPEC int SDLCALL SDL_UpperBlit
702 (SDL_Surface *src, SDL_Rect *srcrect, 1023 (SDL_Surface * src, SDL_Rect * srcrect,
703 SDL_Surface *dst, SDL_Rect *dstrect); 1024 SDL_Surface * dst, SDL_Rect * dstrect);
704 /* This is a semi-private blit function and it performs low-level surface 1025 /* This is a semi-private blit function and it performs low-level surface
705 blitting only. 1026 blitting only.
706 */ 1027 */
707 extern DECLSPEC int SDLCALL SDL_LowerBlit 1028 extern DECLSPEC int SDLCALL SDL_LowerBlit
708 (SDL_Surface *src, SDL_Rect *srcrect, 1029 (SDL_Surface * src, SDL_Rect * srcrect,
709 SDL_Surface *dst, SDL_Rect *dstrect); 1030 SDL_Surface * dst, SDL_Rect * dstrect);
710 1031
711 /* 1032 /*
712 * This function performs a fast fill of the given rectangle with 'color' 1033 * This function performs a fast fill of the given rectangle with 'color'
713 * The given rectangle is clipped to the destination surface clip area 1034 * The given rectangle is clipped to the destination surface clip area
714 * and the final fill rectangle is saved in the passed in pointer. 1035 * and the final fill rectangle is saved in the passed in pointer.
716 * The color should be a pixel of the format used by the surface, and 1037 * The color should be a pixel of the format used by the surface, and
717 * can be generated by the SDL_MapRGB() function. 1038 * can be generated by the SDL_MapRGB() function.
718 * This function returns 0 on success, or -1 on error. 1039 * This function returns 0 on success, or -1 on error.
719 */ 1040 */
720 extern DECLSPEC int SDLCALL SDL_FillRect 1041 extern DECLSPEC int SDLCALL SDL_FillRect
721 (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); 1042 (SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color);
722 1043
723 /* 1044 /*
724 * This function takes a surface and copies it to a new surface of the 1045 * This function takes a surface and copies it to a new surface of the
725 * pixel format and colors of the video framebuffer, suitable for fast 1046 * pixel format and colors of the video framebuffer, suitable for fast
726 * blitting onto the display surface. It calls SDL_ConvertSurface() 1047 * blitting onto the display surface. It calls SDL_ConvertSurface()
729 * acceleration, you should set the colorkey and alpha value before 1050 * acceleration, you should set the colorkey and alpha value before
730 * calling this function. 1051 * calling this function.
731 * 1052 *
732 * If the conversion fails or runs out of memory, it returns NULL 1053 * If the conversion fails or runs out of memory, it returns NULL
733 */ 1054 */
734 extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); 1055 extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormat (SDL_Surface *
1056 surface);
735 1057
736 /* 1058 /*
737 * This function takes a surface and copies it to a new surface of the 1059 * This function takes a surface and copies it to a new surface of the
738 * pixel format and colors of the video framebuffer (if possible), 1060 * pixel format and colors of the video framebuffer (if possible),
739 * suitable for fast alpha blitting onto the display surface. 1061 * suitable for fast alpha blitting onto the display surface.
743 * acceleration, you should set the colorkey and alpha value before 1065 * acceleration, you should set the colorkey and alpha value before
744 * calling this function. 1066 * calling this function.
745 * 1067 *
746 * If the conversion fails or runs out of memory, it returns NULL 1068 * If the conversion fails or runs out of memory, it returns NULL
747 */ 1069 */
748 extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); 1070 extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormatAlpha (SDL_Surface *
1071 surface);
749 1072
750 1073
751 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1074 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
752 /* YUV video surface overlay functions */ 1075 /* YUV video surface overlay functions */
753 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1076 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
755 /* This function creates a video output overlay 1078 /* This function creates a video output overlay
756 Calling the returned surface an overlay is something of a misnomer because 1079 Calling the returned surface an overlay is something of a misnomer because
757 the contents of the display surface underneath the area where the overlay 1080 the contents of the display surface underneath the area where the overlay
758 is shown is undefined - it may be overwritten with the converted YUV data. 1081 is shown is undefined - it may be overwritten with the converted YUV data.
759 */ 1082 */
760 extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, 1083 extern DECLSPEC SDL_Overlay *SDLCALL SDL_CreateYUVOverlay (int width,
761 Uint32 format, SDL_Surface *display); 1084 int height,
1085 Uint32 format,
1086 SDL_Surface *
1087 display);
762 1088
763 /* Lock an overlay for direct access, and unlock it when you are done */ 1089 /* Lock an overlay for direct access, and unlock it when you are done */
764 extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); 1090 extern DECLSPEC int SDLCALL SDL_LockYUVOverlay (SDL_Overlay * overlay);
765 extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); 1091 extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay (SDL_Overlay * overlay);
766 1092
767 /* Blit a video overlay to the display surface. 1093 /* Blit a video overlay to the display surface.
768 The contents of the video surface underneath the blit destination are 1094 The contents of the video surface underneath the blit destination are
769 not defined. 1095 not defined.
770 The width and height of the destination rectangle may be different from 1096 The width and height of the destination rectangle may be different from
771 that of the overlay, but currently only 2x scaling is supported. 1097 that of the overlay, but currently only 2x scaling is supported.
772 */ 1098 */
773 extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); 1099 extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay (SDL_Overlay * overlay,
1100 SDL_Rect * dstrect);
774 1101
775 /* Free a video overlay */ 1102 /* Free a video overlay */
776 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); 1103 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay (SDL_Overlay * overlay);
777 1104
778 1105
779 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1106 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
780 /* OpenGL support functions. */ 1107 /* OpenGL support functions. */
781 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1108 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
784 * Dynamically load an OpenGL library, or the default one if path is NULL 1111 * Dynamically load an OpenGL library, or the default one if path is NULL
785 * 1112 *
786 * If you do this, you need to retrieve all of the GL functions used in 1113 * If you do this, you need to retrieve all of the GL functions used in
787 * your program from the dynamic library using SDL_GL_GetProcAddress(). 1114 * your program from the dynamic library using SDL_GL_GetProcAddress().
788 */ 1115 */
789 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); 1116 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary (const char *path);
790 1117
791 /* 1118 /*
792 * Get the address of a GL function 1119 * Get the address of a GL function
793 */ 1120 */
794 extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); 1121 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress (const char *proc);
795 1122
796 /* 1123 /*
797 * Set an attribute of the OpenGL subsystem before intialization. 1124 * Set an attribute of the OpenGL subsystem before window creation.
798 */ 1125 */
799 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); 1126 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute (SDL_GLattr attr, int value);
800 1127
801 /* 1128 /*
802 * Get an attribute of the OpenGL subsystem from the windowing 1129 * Get an attribute of the OpenGL subsystem from the windowing
803 * interface, such as glX. This is of course different from getting 1130 * interface, such as glX. This is of course different from getting
804 * the values from SDL's internal OpenGL subsystem, which only 1131 * the values from SDL's internal OpenGL subsystem, which only
805 * stores the values you request before initialization. 1132 * stores the values you request before initialization.
806 * 1133 *
807 * Developers should track the values they pass into SDL_GL_SetAttribute 1134 * Developers should track the values they pass into SDL_GL_SetAttribute
808 * themselves if they want to retrieve these values. 1135 * themselves if they want to retrieve these values.
809 */ 1136 */
810 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); 1137 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute (SDL_GLattr attr, int *value);
811 1138
812 /* 1139 /*
813 * Swap the OpenGL buffers, if double-buffering is supported. 1140 * Swap the OpenGL buffers, if double-buffering is supported.
814 */ 1141 */
815 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); 1142 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers (void);
816
817 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
818 /* These functions allow interaction with the window manager, if any. */
819 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
820
821 /*
822 * Sets/Gets the title and icon text of the display window (UTF-8 encoded)
823 */
824 extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);
825 extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
826
827 /*
828 * Sets the icon for the display window.
829 * This function must be called before the first call to SDL_SetVideoMode().
830 * It takes an icon surface, and a mask in MSB format.
831 * If 'mask' is NULL, the entire icon surface will be used as the icon.
832 */
833 extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
834
835 /*
836 * This function iconifies the window, and returns 1 if it succeeded.
837 * If the function succeeds, it generates an SDL_APPACTIVE loss event.
838 * This function is a noop and returns 0 in non-windowed environments.
839 */
840 extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
841
842 /*
843 * Toggle fullscreen mode without changing the contents of the screen.
844 * If the display surface does not require locking before accessing
845 * the pixel information, then the memory pointers will not change.
846 *
847 * If this function was able to toggle fullscreen mode (change from
848 * running in a window to fullscreen, or vice-versa), it will return 1.
849 * If it is not implemented, or fails, it returns 0.
850 *
851 * The next call to SDL_SetVideoMode() will set the mode fullscreen
852 * attribute based on the flags parameter - if SDL_FULLSCREEN is not
853 * set, then the display will be windowed by default where supported.
854 *
855 * This is currently only implemented in the X11 video driver.
856 */
857 extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
858
859 /*
860 * This function allows you to set and query the input grab state of
861 * the application. It returns the new input grab state.
862 */
863 typedef enum {
864 SDL_GRAB_QUERY = -1,
865 SDL_GRAB_OFF = 0,
866 SDL_GRAB_ON = 1,
867 SDL_GRAB_FULLSCREEN /* Used internally */
868 } SDL_GrabMode;
869 /*
870 * Grabbing means that the mouse is confined to the application window,
871 * and nearly all keyboard input is passed directly to the application,
872 * and not interpreted by a window manager, if any.
873 */
874 extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
875 1143
876 /* Not in public API at the moment - do not use! */ 1144 /* Not in public API at the moment - do not use! */
877 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, 1145 extern DECLSPEC int SDLCALL SDL_SoftStretch (SDL_Surface * src,
878 SDL_Surface *dst, SDL_Rect *dstrect); 1146 SDL_Rect * srcrect,
879 1147 SDL_Surface * dst,
1148 SDL_Rect * dstrect);
1149
880 /* Ends C function definitions when using C++ */ 1150 /* Ends C function definitions when using C++ */
881 #ifdef __cplusplus 1151 #ifdef __cplusplus
1152 /* *INDENT-OFF* */
882 } 1153 }
1154 /* *INDENT-ON* */
883 #endif 1155 #endif
884 #include "close_code.h" 1156 #include "close_code.h"
885 1157
886 #endif /* _SDL_video_h */ 1158 #endif /* _SDL_video_h */
1159
1160 /* vi: set ts=4 sw=4 expandtab: */