comparison include/SDL_video.h @ 3407:d3baf5ac4e37

Partial fix for bug #859 Header file update from Ken for improved doxygen output
author Sam Lantinga <slouken@libsdl.org>
date Mon, 19 Oct 2009 13:31:58 +0000
parents 4ec48602f1db
children 9f62f47d989b
comparison
equal deleted inserted replaced
3406:8ae607392409 3407:d3baf5ac4e37
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /** 23 /**
24 * \file SDL_video.h 24 * \file SDL_video.h
25 * 25 *
26 * Header file for SDL video functions. 26 * Header file for SDL video functions.
27 */ 27 */
28 28
29 #ifndef _SDL_video_h 29 #ifndef _SDL_video_h
30 #define _SDL_video_h 30 #define _SDL_video_h
31 31
41 extern "C" { 41 extern "C" {
42 /* *INDENT-ON* */ 42 /* *INDENT-ON* */
43 #endif 43 #endif
44 44
45 /** 45 /**
46 * \struct SDL_DisplayMode 46 * \brief The structure that defines a display mode
47 * 47 *
48 * \brief The structure that defines a display mode 48 * \sa SDL_GetNumDisplayModes()
49 * 49 * \sa SDL_GetDisplayMode()
50 * \sa SDL_GetNumDisplayModes() 50 * \sa SDL_GetDesktopDisplayMode()
51 * \sa SDL_GetDisplayMode() 51 * \sa SDL_GetCurrentDisplayMode()
52 * \sa SDL_GetDesktopDisplayMode() 52 * \sa SDL_GetClosestDisplayMode()
53 * \sa SDL_GetCurrentDisplayMode() 53 * \sa SDL_SetDisplayMode()
54 * \sa SDL_GetClosestDisplayMode()
55 * \sa SDL_SetDisplayMode()
56 */ 54 */
57 typedef struct 55 typedef struct
58 { 56 {
59 Uint32 format; /**< pixel format */ 57 Uint32 format; /**< pixel format */
60 int w; /**< width */ 58 int w; /**< width */
62 int refresh_rate; /**< refresh rate (or zero for unspecified) */ 60 int refresh_rate; /**< refresh rate (or zero for unspecified) */
63 void *driverdata; /**< driver-specific data, initialize to 0 */ 61 void *driverdata; /**< driver-specific data, initialize to 0 */
64 } SDL_DisplayMode; 62 } SDL_DisplayMode;
65 63
66 /** 64 /**
67 * \typedef SDL_WindowID 65 * \brief The type used to identify a window
68 * 66 *
69 * \brief The type used to identify a window 67 * \sa SDL_CreateWindow()
70 * 68 * \sa SDL_CreateWindowFrom()
71 * \sa SDL_CreateWindow() 69 * \sa SDL_DestroyWindow()
72 * \sa SDL_CreateWindowFrom() 70 * \sa SDL_GetWindowData()
73 * \sa SDL_DestroyWindow() 71 * \sa SDL_GetWindowFlags()
74 * \sa SDL_GetWindowData() 72 * \sa SDL_GetWindowGrab()
75 * \sa SDL_GetWindowFlags() 73 * \sa SDL_GetWindowPosition()
76 * \sa SDL_GetWindowGrab() 74 * \sa SDL_GetWindowSize()
77 * \sa SDL_GetWindowPosition() 75 * \sa SDL_GetWindowTitle()
78 * \sa SDL_GetWindowSize() 76 * \sa SDL_HideWindow()
79 * \sa SDL_GetWindowTitle() 77 * \sa SDL_MaximizeWindow()
80 * \sa SDL_HideWindow() 78 * \sa SDL_MinimizeWindow()
81 * \sa SDL_MaximizeWindow() 79 * \sa SDL_RaiseWindow()
82 * \sa SDL_MinimizeWindow() 80 * \sa SDL_RestoreWindow()
83 * \sa SDL_RaiseWindow() 81 * \sa SDL_SetWindowData()
84 * \sa SDL_RestoreWindow() 82 * \sa SDL_SetWindowFullscreen()
85 * \sa SDL_SetWindowData() 83 * \sa SDL_SetWindowGrab()
86 * \sa SDL_SetWindowFullscreen() 84 * \sa SDL_SetWindowIcon()
87 * \sa SDL_SetWindowGrab() 85 * \sa SDL_SetWindowPosition()
88 * \sa SDL_SetWindowIcon() 86 * \sa SDL_SetWindowSize()
89 * \sa SDL_SetWindowPosition() 87 * \sa SDL_SetWindowTitle()
90 * \sa SDL_SetWindowSize() 88 * \sa SDL_ShowWindow()
91 * \sa SDL_SetWindowTitle()
92 * \sa SDL_ShowWindow()
93 */ 89 */
94 typedef Uint32 SDL_WindowID; 90 typedef Uint32 SDL_WindowID;
95 91
96 /** 92 /**
97 * \enum SDL_WindowFlags 93 * \brief The flags on a window
98 * 94 *
99 * \brief The flags on a window 95 * \sa SDL_GetWindowFlags()
100 *
101 * \sa SDL_GetWindowFlags()
102 */ 96 */
103 typedef enum 97 typedef enum
104 { 98 {
105 SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window, implies borderless */ 99 SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window, implies borderless */
106 SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ 100 SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */
114 SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ 108 SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */
115 SDL_WINDOW_FOREIGN = 0x00000800 /**< window not created by SDL */ 109 SDL_WINDOW_FOREIGN = 0x00000800 /**< window not created by SDL */
116 } SDL_WindowFlags; 110 } SDL_WindowFlags;
117 111
118 /** 112 /**
119 * \def SDL_WINDOWPOS_UNDEFINED 113 * \brief Used to indicate that you don't care what the window position is.
120 * \brief Used to indicate that you don't care what the window position is.
121 */ 114 */
122 #define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF 115 #define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF
123 /** 116
124 * \def SDL_WINDOWPOS_CENTERED 117 /**
125 * \brief Used to indicate that the window position should be centered. 118 * \brief Used to indicate that the window position should be centered.
126 */ 119 */
127 #define SDL_WINDOWPOS_CENTERED 0x7FFFFFE 120 #define SDL_WINDOWPOS_CENTERED 0x7FFFFFE
128 121
129 /** 122 /**
130 * \enum SDL_WindowEventID 123 * \brief Event subtype for window events
131 *
132 * \brief Event subtype for window events
133 */ 124 */
134 typedef enum 125 typedef enum
135 { 126 {
136 SDL_WINDOWEVENT_NONE, /**< Never used */ 127 SDL_WINDOWEVENT_NONE, /**< Never used */
137 SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ 128 SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */
138 SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ 129 SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */
139 SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be redrawn */ 130 SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be
140 SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1,data2 */ 131 redrawn */
141 SDL_WINDOWEVENT_RESIZED, /**< Window size changed to data1xdata2 */ 132 SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2
142 SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ 133 */
143 SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ 134 SDL_WINDOWEVENT_RESIZED, /**< Window size changed to data1xdata2 */
144 SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size and position */ 135 SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */
145 SDL_WINDOWEVENT_ENTER, /**< The window has gained mouse focus */ 136 SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */
146 SDL_WINDOWEVENT_LEAVE, /**< The window has lost mouse focus */ 137 SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size
147 SDL_WINDOWEVENT_FOCUS_GAINED, /**< The window has gained keyboard focus */ 138 and position */
148 SDL_WINDOWEVENT_FOCUS_LOST, /**< The window has lost keyboard focus */ 139 SDL_WINDOWEVENT_ENTER, /**< The window has gained mouse focus */
149 SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the window be closed */ 140 SDL_WINDOWEVENT_LEAVE, /**< The window has lost mouse focus */
141 SDL_WINDOWEVENT_FOCUS_GAINED, /**< The window has gained keyboard focus */
142 SDL_WINDOWEVENT_FOCUS_LOST, /**< The window has lost keyboard focus */
143 SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the
144 window be closed */
150 } SDL_WindowEventID; 145 } SDL_WindowEventID;
151 146
152 /** 147 /**
153 * \enum SDL_RendererFlags 148 * \brief Flags used when creating a rendering context
154 *
155 * \brief Flags used when creating a rendering context
156 */ 149 */
157 typedef enum 150 typedef enum
158 { 151 {
159 SDL_RENDERER_SINGLEBUFFER = 0x00000001, /**< Render directly to the window, if possible */ 152 SDL_RENDERER_SINGLEBUFFER = 0x00000001, /**< Render directly to the
160 SDL_RENDERER_PRESENTCOPY = 0x00000002, /**< Present uses a copy from back buffer to the front buffer */ 153 window, if possible */
161 SDL_RENDERER_PRESENTFLIP2 = 0x00000004, /**< Present uses a flip, swapping back buffer and front buffer */ 154
162 SDL_RENDERER_PRESENTFLIP3 = 0x00000008, /**< Present uses a flip, rotating between two back buffers and a front buffer */ 155 SDL_RENDERER_PRESENTCOPY = 0x00000002, /**< Present uses a copy from
163 SDL_RENDERER_PRESENTDISCARD = 0x00000010, /**< Present leaves the contents of the backbuffer undefined */ 156 back buffer to the front
164 SDL_RENDERER_PRESENTVSYNC = 0x00000020, /**< Present is synchronized with the refresh rate */ 157 buffer */
165 SDL_RENDERER_ACCELERATED = 0x00000040 /**< The renderer uses hardware acceleration */ 158
166 } SDL_RendererFlags; 159 SDL_RENDERER_PRESENTFLIP2 = 0x00000004, /**< Present uses a flip,
167 160 swapping back buffer and
168 /** 161 front buffer */
169 * \struct SDL_RendererInfo 162
170 * 163 SDL_RENDERER_PRESENTFLIP3 = 0x00000008, /**< Present uses a flip,
171 * \brief Information on the capabilities of a render driver or context 164 rotating between two back
165 buffers and a front buffer
166 */
167
168 SDL_RENDERER_PRESENTDISCARD = 0x00000010, /**< Present leaves the contents
169 of the backbuffer undefined
170 */
171
172 SDL_RENDERER_PRESENTVSYNC = 0x00000020, /**< Present is synchronized
173 with the refresh rate */
174
175 SDL_RENDERER_ACCELERATED = 0x00000040 /**< The renderer uses hardware
176 acceleration */
177
178 } SDL_RendererFlags;
179
180 /**
181 * \brief Information on the capabilities of a render driver or context.
172 */ 182 */
173 typedef struct SDL_RendererInfo 183 typedef struct SDL_RendererInfo
174 { 184 {
175 const char *name; /**< The name of the renderer */ 185 const char *name; /**< The name of the renderer */
176 Uint32 flags; /**< Supported SDL_RendererFlags */ 186 Uint32 flags; /**< Supported ::SDL_RendererFlags */
177 Uint32 mod_modes; /**< A mask of supported channel modulation */ 187 Uint32 mod_modes; /**< A mask of supported channel modulation */
178 Uint32 blend_modes; /**< A mask of supported blend modes */ 188 Uint32 blend_modes; /**< A mask of supported blend modes */
179 Uint32 scale_modes; /**< A mask of supported scale modes */ 189 Uint32 scale_modes; /**< A mask of supported scale modes */
180 Uint32 num_texture_formats; /**< The number of available texture formats */ 190 Uint32 num_texture_formats; /**< The number of available texture formats */
181 Uint32 texture_formats[20]; /**< The available texture formats */ 191 Uint32 texture_formats[20]; /**< The available texture formats */
182 int max_texture_width; /**< The maximimum texture width */ 192 int max_texture_width; /**< The maximimum texture width */
183 int max_texture_height; /**< The maximimum texture height */ 193 int max_texture_height; /**< The maximimum texture height */
184 } SDL_RendererInfo; 194 } SDL_RendererInfo;
185 195
186 /** 196 /**
187 * \enum SDL_TextureAccess 197 * \brief The access pattern allowed for a texture.
188 *
189 * \brief The access pattern allowed for a texture
190 */ 198 */
191 typedef enum 199 typedef enum
192 { 200 {
193 SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ 201 SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */
194 SDL_TEXTUREACCESS_STREAMING /**< Changes frequently, lockable */ 202 SDL_TEXTUREACCESS_STREAMING /**< Changes frequently, lockable */
195 } SDL_TextureAccess; 203 } SDL_TextureAccess;
196 204
197 /** 205 /**
198 * \enum SDL_TextureModulate 206 * \brief The texture channel modulation used in SDL_RenderCopy().
199 *
200 * \brief The texture channel modulation used in SDL_RenderCopy()
201 */ 207 */
202 typedef enum 208 typedef enum
203 { 209 {
204 SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ 210 SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */
205 SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ 211 SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */
206 SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ 212 SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
207 } SDL_TextureModulate; 213 } SDL_TextureModulate;
208 214
209 /** 215 /**
210 * \enum SDL_BlendMode 216 * \brief The blend mode used in SDL_RenderCopy() and drawing operations.
211 *
212 * \brief The blend mode used in SDL_RenderCopy() and drawing operations
213 */ 217 */
214 typedef enum 218 typedef enum
215 { 219 {
216 SDL_BLENDMODE_NONE = 0x00000000, /**< No blending */ 220 SDL_BLENDMODE_NONE = 0x00000000, /**< No blending */
217 SDL_BLENDMODE_MASK = 0x00000001, /**< dst = A ? src : dst (alpha is mask) */ 221 SDL_BLENDMODE_MASK = 0x00000001, /**< dst = A ? src : dst
222 (alpha is mask) */
223
218 SDL_BLENDMODE_BLEND = 0x00000002, /**< dst = (src * A) + (dst * (1-A)) */ 224 SDL_BLENDMODE_BLEND = 0x00000002, /**< dst = (src * A) + (dst * (1-A)) */
219 SDL_BLENDMODE_ADD = 0x00000004, /**< dst = (src * A) + dst */ 225 SDL_BLENDMODE_ADD = 0x00000004, /**< dst = (src * A) + dst */
220 SDL_BLENDMODE_MOD = 0x00000008 /**< dst = src * dst */ 226 SDL_BLENDMODE_MOD = 0x00000008 /**< dst = src * dst */
221 } SDL_BlendMode; 227 } SDL_BlendMode;
222 228
223 /** 229 /**
224 * \enum SDL_TextureScaleMode 230 * \brief The texture scale mode used in SDL_RenderCopy().
225 *
226 * \brief The texture scale mode used in SDL_RenderCopy()
227 */ 231 */
228 typedef enum 232 typedef enum
229 { 233 {
230 SDL_TEXTURESCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must match dimensions */ 234 SDL_TEXTURESCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must
231 SDL_TEXTURESCALEMODE_FAST = 0x00000001, /**< Point sampling or equivalent algorithm */ 235 match dimensions */
232 SDL_TEXTURESCALEMODE_SLOW = 0x00000002, /**< Linear filtering or equivalent algorithm */ 236
233 SDL_TEXTURESCALEMODE_BEST = 0x00000004 /**< Bicubic filtering or equivalent algorithm */ 237 SDL_TEXTURESCALEMODE_FAST = 0x00000001, /**< Point sampling or
238 equivalent algorithm */
239
240 SDL_TEXTURESCALEMODE_SLOW = 0x00000002, /**< Linear filtering or
241 equivalent algorithm */
242
243 SDL_TEXTURESCALEMODE_BEST = 0x00000004 /**< Bicubic filtering or
244 equivalent algorithm */
234 } SDL_TextureScaleMode; 245 } SDL_TextureScaleMode;
235 246
236 /** 247 /**
237 * \typedef SDL_TextureID 248 * \brief An efficient driver-specific representation of pixel data
238 *
239 * \brief An efficient driver-specific representation of pixel data
240 */ 249 */
241 typedef Uint32 SDL_TextureID; 250 typedef Uint32 SDL_TextureID;
242 251
243 /** 252 /**
244 * \typedef SDL_GLContext 253 * \brief An opaque handle to an OpenGL context.
245 *
246 * \brief An opaque handle to an OpenGL context.
247 */ 254 */
248 typedef void *SDL_GLContext; 255 typedef void *SDL_GLContext;
249 256
250 /** 257 /**
251 * \enum SDL_GLattr 258 * \brief OpenGL configuration attributes
252 *
253 * \brief OpenGL configuration attributes
254 */ 259 */
255 typedef enum 260 typedef enum
256 { 261 {
257 SDL_GL_RED_SIZE, 262 SDL_GL_RED_SIZE,
258 SDL_GL_GREEN_SIZE, 263 SDL_GL_GREEN_SIZE,
277 282
278 283
279 /* Function prototypes */ 284 /* Function prototypes */
280 285
281 /** 286 /**
282 * \fn int SDL_GetNumVideoDrivers(void) 287 * \brief Get the number of video drivers compiled into SDL
283 * 288 *
284 * \brief Get the number of video drivers compiled into SDL 289 * \sa SDL_GetVideoDriver()
285 *
286 * \sa SDL_GetVideoDriver()
287 */ 290 */
288 extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); 291 extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
289 292
290 /** 293 /**
291 * \fn const char *SDL_GetVideoDriver(int index) 294 * \brief Get the name of a built in video driver.
292 * 295 *
293 * \brief Get the name of a built in video driver. 296 * \note The video drivers are presented in the order in which they are
294 * 297 * normally checked during initialization.
295 * \note The video drivers are presented in the order in which they are 298 *
296 * normally checked during initialization. 299 * \sa SDL_GetNumVideoDrivers()
297 *
298 * \sa SDL_GetNumVideoDrivers()
299 */ 300 */
300 extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); 301 extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
301 302
302 /** 303 /**
303 * \fn int SDL_VideoInit(const char *driver_name, Uint32 flags) 304 * \brief Initialize the video subsystem, optionally specifying a video driver.
304 * 305 *
305 * \brief Initialize the video subsystem, optionally specifying a video driver. 306 * \param driver_name Initialize a specific driver by name, or NULL for the
306 * 307 * default video driver.
307 * \param driver_name Initialize a specific driver by name, or NULL for the default video driver. 308 *
308 * \param flags FIXME: Still needed? 309 * \param flags FIXME: Still needed?
309 * 310 *
310 * \return 0 on success, -1 on error 311 * \return 0 on success, -1 on error
311 * 312 *
312 * This function initializes the video subsystem; setting up a connection 313 * This function initializes the video subsystem; setting up a connection
313 * to the window manager, etc, and determines the available display modes 314 * to the window manager, etc, and determines the available display modes
314 * and pixel formats, but does not initialize a window or graphics mode. 315 * and pixel formats, but does not initialize a window or graphics mode.
315 * 316 *
316 * \sa SDL_VideoQuit() 317 * \sa SDL_VideoQuit()
317 */ 318 */
318 extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, 319 extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name,
319 Uint32 flags); 320 Uint32 flags);
320 321
321 /** 322 /**
322 * \fn void SDL_VideoQuit(void) 323 * \brief Shuts down the video subsystem.
323 * 324 *
324 * \brief Shuts down the video subsystem. 325 * This function closes all windows, and restores the original video mode.
325 * 326 *
326 * This function closes all windows, and restores the original video mode. 327 * \sa SDL_VideoInit()
327 *
328 * \sa SDL_VideoInit()
329 */ 328 */
330 extern DECLSPEC void SDLCALL SDL_VideoQuit(void); 329 extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
331 330
332 /** 331 /**
333 * \fn const char *SDL_GetCurrentVideoDriver(void) 332 * \brief Returns the name of the currently initialized video driver.
334 * 333 *
335 * \brief Returns the name of the currently initialized video driver. 334 * \return The name of the current video driver or NULL if no driver
336 * 335 * has been initialized
337 * \return The name of the current video driver or NULL if no driver 336 *
338 * has been initialized 337 * \sa SDL_GetNumVideoDrivers()
339 * 338 * \sa SDL_GetVideoDriver()
340 * \sa SDL_GetNumVideoDrivers()
341 * \sa SDL_GetVideoDriver()
342 */ 339 */
343 extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); 340 extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
344 341
345 /** 342 /**
346 * \fn int SDL_GetNumVideoDisplays(void) 343 * \brief Returns the number of available video displays.
347 * 344 *
348 * \brief Returns the number of available video displays. 345 * \sa SDL_SelectVideoDisplay()
349 *
350 * \sa SDL_SelectVideoDisplay()
351 */ 346 */
352 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); 347 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
353 348
354 /** 349 /**
355 * \fn int SDL_SelectVideoDisplay(int index) 350 * \brief Set the index of the currently selected display.
356 * 351 *
357 * \brief Set the index of the currently selected display. 352 * \return 0 on success, or -1 if the index is out of range.
358 * 353 *
359 * \return 0 on success, or -1 if the index is out of range. 354 * \sa SDL_GetNumVideoDisplays()
360 * 355 * \sa SDL_GetCurrentVideoDisplay()
361 * \sa SDL_GetNumVideoDisplays()
362 * \sa SDL_GetCurrentVideoDisplay()
363 */ 356 */
364 extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index); 357 extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index);
365 358
366 /** 359 /**
367 * \fn int SDL_GetCurrentVideoDisplay(void) 360 * \brief Get the index of the currently selected display.
368 * 361 *
369 * \brief Get the index of the currently selected display. 362 * \return The index of the currently selected display.
370 * 363 *
371 * \return The index of the currently selected display. 364 * \sa SDL_GetNumVideoDisplays()
372 * 365 * \sa SDL_SelectVideoDisplay()
373 * \sa SDL_GetNumVideoDisplays()
374 * \sa SDL_SelectVideoDisplay()
375 */ 366 */
376 extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void); 367 extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void);
377 368
378 /** 369 /**
379 * \fn int SDL_GetNumDisplayModes(void) 370 * \brief Returns the number of available display modes for the current display.
380 * 371 *
381 * \brief Returns the number of available display modes for the current display. 372 * \sa SDL_GetDisplayMode()
382 *
383 * \sa SDL_GetDisplayMode()
384 */ 373 */
385 extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void); 374 extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void);
386 375
387 /** 376 /**
388 * \fn int SDL_GetDisplayMode(int index, SDL_DisplayMode *mode) 377 * \brief Fill in information about a specific display mode.
389 * 378 *
390 * \brief Fill in information about a specific display mode. 379 * \note The display modes are sorted in this priority:
391 * 380 * \li bits per pixel -> more colors to fewer colors
392 * \note The display modes are sorted in this priority: 381 * \li width -> largest to smallest
393 * \li bits per pixel -> more colors to fewer colors 382 * \li height -> largest to smallest
394 * \li width -> largest to smallest 383 * \li refresh rate -> highest to lowest
395 * \li height -> largest to smallest 384 *
396 * \li refresh rate -> highest to lowest 385 * \sa SDL_GetNumDisplayModes()
397 *
398 * \sa SDL_GetNumDisplayModes()
399 */ 386 */
400 extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index, 387 extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index,
401 SDL_DisplayMode * mode); 388 SDL_DisplayMode * mode);
402 389
403 /** 390 /**
404 * \fn int SDL_GetDesktopDisplayMode(SDL_DisplayMode *mode) 391 * \brief Fill in information about the desktop display mode for the current
405 * 392 * display.
406 * \brief Fill in information about the desktop display mode for the current display.
407 */ 393 */
408 extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode); 394 extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode);
409 395
410 /** 396 /**
411 * \fn int SDL_GetCurrentDisplayMode(SDL_DisplayMode *mode) 397 * \brief Fill in information about the current display mode.
412 *
413 * \brief Fill in information about the current display mode.
414 */ 398 */
415 extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode); 399 extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode);
416 400
417 401
418 /** 402 /**
419 * \fn SDL_DisplayMode SDL_GetClosestDisplayMode(const SDL_DisplayMode mode, SDL_DisplayMode closest) 403 * \brief Get the closest match to the requested display mode.
420 * 404 *
421 * \brief Get the closest match to the requested display mode. 405 * \param mode The desired display mode
422 * 406 * \param closest A pointer to a display mode to be filled in with the closest
423 * \param mode The desired display mode 407 * match of the available display modes.
424 * \param closest A pointer to a display mode to be filled in with the closest match of the available display modes. 408 *
425 * 409 * \return The passed in value \c closest, or NULL if no matching video mode
426 * \return The passed in value 'closest', or NULL if no matching video mode was available. 410 * was available.
427 * 411 *
428 * 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. 412 * The available display modes are scanned, and \c closest is filled in with the
429 * 413 * closest mode matching the requested mode and returned. The mode format and
430 * \sa SDL_GetNumDisplayModes() 414 * refresh_rate default to the desktop mode if they are 0. The modes are
431 * \sa SDL_GetDisplayMode() 415 * scanned with size being first priority, format being second priority, and
416 * finally checking the refresh_rate. If all the available modes are too
417 * small, then NULL is returned.
418 *
419 * \sa SDL_GetNumDisplayModes()
420 * \sa SDL_GetDisplayMode()
432 */ 421 */
433 extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const 422 extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const
434 SDL_DisplayMode 423 SDL_DisplayMode
435 * mode, 424 * mode,
436 SDL_DisplayMode 425 SDL_DisplayMode
437 * closest); 426 * closest);
438 427
439 /** 428 /**
440 * \fn int SDL_SetFullscreenDisplayMode(const SDL_DisplayMode *mode) 429 * \brief Set the display mode used when a fullscreen window is visible
441 * 430 * on the currently selected display.
442 * \brief Set the display mode used when a fullscreen window is visible 431 *
443 * on the currently selected display. 432 * \param mode The mode to use, or NULL for the desktop mode.
444 * 433 *
445 * \param mode The mode to use, or NULL for the desktop mode. 434 * \return 0 on success, or -1 if setting the display mode failed.
446 * 435 *
447 * \return 0 on success, or -1 if setting the display mode failed. 436 * \sa SDL_SetWindowFullscreen()
448 *
449 * \sa SDL_SetWindowFullscreen()
450 */ 437 */
451 extern DECLSPEC int SDLCALL SDL_SetFullscreenDisplayMode(const SDL_DisplayMode 438 extern DECLSPEC int SDLCALL SDL_SetFullscreenDisplayMode(const SDL_DisplayMode
452 * mode); 439 * mode);
453 440
454 /** 441 /**
455 * \fn int SDL_GetFullscreenDisplayMode(SDL_DisplayMode *mode) 442 * \brief Fill in information about the display mode used when a fullscreen
456 * 443 * window is visible on the currently selected display.
457 * \brief Fill in information about the display mode used when a fullscreen
458 * window is visible on the currently selected display.
459 */ 444 */
460 extern DECLSPEC int SDLCALL SDL_GetFullscreenDisplayMode(SDL_DisplayMode * 445 extern DECLSPEC int SDLCALL SDL_GetFullscreenDisplayMode(SDL_DisplayMode *
461 mode); 446 mode);
462 447
463 /** 448 /**
464 * \fn int SDL_SetDisplayPalette(const SDL_Color *colors, int firstcolor, int ncolors) 449 * \brief Set the palette entries for indexed display modes.
465 * 450 *
466 * \brief Set the palette entries for indexed display modes. 451 * \return 0 on success, or -1 if the display mode isn't palettized or the
467 * 452 * colors couldn't be set.
468 * \return 0 on success, or -1 if the display mode isn't palettized or the colors couldn't be set.
469 */ 453 */
470 extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors, 454 extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors,
471 int firstcolor, 455 int firstcolor,
472 int ncolors); 456 int ncolors);
473 457
474 /** 458 /**
475 * \fn int SDL_GetDisplayPalette(SDL_Color *colors, int firstcolor, int ncolors) 459 * \brief Gets the palette entries for indexed display modes.
476 * 460 *
477 * \brief Gets the palette entries for indexed display modes. 461 * \return 0 on success, or -1 if the display mode isn't palettized
478 *
479 * \return 0 on success, or -1 if the display mode isn't palettized
480 */ 462 */
481 extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors, 463 extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors,
482 int firstcolor, 464 int firstcolor,
483 int ncolors); 465 int ncolors);
484 466
485 /** 467 /**
486 * \fn int SDL_SetGamma(float red, float green, float blue) 468 * \brief Set the gamma correction for each of the color channels on the
487 * 469 * currently selected display.
488 * \brief Set the gamma correction for each of the color channels on the currently selected display. 470 *
489 * 471 * \return 0 on success, or -1 if setting the gamma isn't supported.
490 * \return 0 on success, or -1 if setting the gamma isn't supported. 472 *
491 * 473 * \sa SDL_SetGammaRamp()
492 * \sa SDL_SetGammaRamp()
493 */ 474 */
494 extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); 475 extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
495 476
496 /** 477 /**
497 * \fn int SDL_SetGammaRamp(const Uint16 * red, const Uint16 * green, const Uint16 * blue) 478 * \brief Set the gamma ramp for the currently selected display.
498 * 479 *
499 * \brief Set the gamma ramp for the currently selected display. 480 * \param red The translation table for the red channel, or NULL.
500 * 481 * \param green The translation table for the green channel, or NULL.
501 * \param red The translation table for the red channel, or NULL 482 * \param blue The translation table for the blue channel, or NULL.
502 * \param green The translation table for the green channel, or NULL 483 *
503 * \param blue The translation table for the blue channel, or NULL 484 * \return 0 on success, or -1 if gamma ramps are unsupported.
504 * 485 *
505 * \return 0 on success, or -1 if gamma ramps are unsupported. 486 * Set the gamma translation table for the red, green, and blue channels
506 * 487 * of the video hardware. Each table is an array of 256 16-bit quantities,
507 * Set the gamma translation table for the red, green, and blue channels 488 * representing a mapping between the input and output for that channel.
508 * of the video hardware. Each table is an array of 256 16-bit quantities, 489 * The input is the index into the array, and the output is the 16-bit
509 * representing a mapping between the input and output for that channel. 490 * gamma value at that index, scaled to the output color precision.
510 * The input is the index into the array, and the output is the 16-bit 491 *
511 * gamma value at that index, scaled to the output color precision. 492 * \sa SDL_GetGammaRamp()
512 *
513 * \sa SDL_GetGammaRamp()
514 */ 493 */
515 extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red, 494 extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
516 const Uint16 * green, 495 const Uint16 * green,
517 const Uint16 * blue); 496 const Uint16 * blue);
518 497
519 /** 498 /**
520 * \fn int SDL_GetGammaRamp(Uint16 * red, Uint16 * green, Uint16 * blue) 499 * \brief Get the gamma ramp for the currently selected display.
521 * 500 *
522 * \brief Get the gamma ramp for the currently selected display. 501 * \param red A pointer to a 256 element array of 16-bit quantities to hold
523 * 502 * the translation table for the red channel, or NULL.
524 * \param red A pointer to a 256 element array of 16-bit quantities to hold the translation table for the red channel, or NULL. 503 * \param green A pointer to a 256 element array of 16-bit quantities to hold
525 * \param green A pointer to a 256 element array of 16-bit quantities to hold the translation table for the green channel, or NULL. 504 * the translation table for the green channel, or NULL.
526 * \param blue A pointer to a 256 element array of 16-bit quantities to hold the translation table for the blue channel, or NULL. 505 * \param blue A pointer to a 256 element array of 16-bit quantities to hold
527 * 506 * the translation table for the blue channel, or NULL.
528 * \return 0 on success, or -1 if gamma ramps are unsupported. 507 *
529 * 508 * \return 0 on success, or -1 if gamma ramps are unsupported.
530 * \sa SDL_SetGammaRamp() 509 *
510 * \sa SDL_SetGammaRamp()
531 */ 511 */
532 extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green, 512 extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
533 Uint16 * blue); 513 Uint16 * blue);
534 514
535 515
536 /** 516 /**
537 * \fn SDL_WindowID SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) 517 * \brief Create a window with the specified position, dimensions, and flags.
538 * 518 *
539 * \brief Create a window with the specified position, dimensions, and flags. 519 * \param title The title of the window, in UTF-8 encoding.
540 * 520 * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
541 * \param title The title of the window, in UTF-8 encoding 521 * ::SDL_WINDOWPOS_UNDEFINED.
542 * \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED 522 * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
543 * \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED 523 * ::SDL_WINDOWPOS_UNDEFINED.
544 * \param w The width of the window 524 * \param w The width of the window.
545 * \param h The height of the window 525 * \param h The height of the window.
546 * \param flags The flags for the window, a mask of any of the following: SDL_WINDOW_FULLSCREEN, SDL_WINDOW_OPENGL, SDL_WINDOW_SHOWN, SDL_WINDOW_BORDERLESS, SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED, SDL_WINDOW_MINIMIZED, SDL_WINDOW_INPUT_GRABBED 526 * \param flags The flags for the window, a mask of any of the following:
547 * 527 * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL,
548 * \return The id of the window created, or zero if window creation failed. 528 * ::SDL_WINDOW_SHOWN, ::SDL_WINDOW_BORDERLESS,
549 * 529 * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
550 * \sa SDL_DestroyWindow() 530 * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED.
531 *
532 * \return The id of the window created, or zero if window creation failed.
533 *
534 * \sa SDL_DestroyWindow()
551 */ 535 */
552 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindow(const char *title, 536 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindow(const char *title,
553 int x, int y, int w, 537 int x, int y, int w,
554 int h, Uint32 flags); 538 int h, Uint32 flags);
555 539
556 /** 540 /**
557 * \fn SDL_WindowID SDL_CreateWindowFrom(void *data) 541 * \brief Create an SDL window struct from an existing native window.
558 * 542 *
559 * \brief Create an SDL window struct from an existing native window. 543 * \param data A pointer to driver-dependent window creation data
560 * 544 *
561 * \param data A pointer to driver-dependent window creation data 545 * \return The id of the window created, or zero if window creation failed.
562 * 546 *
563 * \return The id of the window created, or zero if window creation failed. 547 * \warning This function is NOT SUPPORTED, use at your own risk!
564 * 548 *
565 * \warning This function is NOT SUPPORTED, use at your own risk! 549 * \sa SDL_DestroyWindow()
566 *
567 * \sa SDL_DestroyWindow()
568 */ 550 */
569 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(const void *data); 551 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(const void *data);
570 552
571 /** 553 /**
572 * \fn Uint32 SDL_GetWindowFlags(SDL_WindowID windowID) 554 * \brief Get the window flags.
573 *
574 * \brief Get the window flags.
575 */ 555 */
576 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_WindowID windowID); 556 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_WindowID windowID);
577 557
578 /** 558 /**
579 * \fn void SDL_SetWindowTitle(SDL_WindowID windowID, const char *title) 559 * \brief Set the title of the window, in UTF-8 format.
580 * 560 *
581 * \brief Set the title of the window, in UTF-8 format. 561 * \sa SDL_GetWindowTitle()
582 *
583 * \sa SDL_GetWindowTitle()
584 */ 562 */
585 extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_WindowID windowID, 563 extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_WindowID windowID,
586 const char *title); 564 const char *title);
587 565
588 /** 566 /**
589 * \fn const char *SDL_GetWindowTitle(SDL_WindowID windowID) 567 * \brief Get the title of the window, in UTF-8 format.
590 * 568 *
591 * \brief Get the title of the window, in UTF-8 format. 569 * \sa SDL_SetWindowTitle()
592 *
593 * \sa SDL_SetWindowTitle()
594 */ 570 */
595 extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_WindowID windowID); 571 extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_WindowID windowID);
596 572
597 /** 573 /**
598 * \fn void SDL_SetWindowIcon(SDL_WindowID windowID, SDL_Surface *icon) 574 * \brief Set the icon of the window.
599 * 575 *
600 * \brief Set the icon of the window. 576 * \param icon The icon for the window.
601 *
602 * \param icon The icon for the window
603 */ 577 */
604 extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_WindowID windowID, 578 extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_WindowID windowID,
605 SDL_Surface * icon); 579 SDL_Surface * icon);
606 580
607 /** 581 /**
608 * \fn void SDL_SetWindowData(SDL_WindowID windowID, void *userdata) 582 * \brief Associate an arbitrary pointer with the window.
609 * 583 *
610 * \brief Associate an arbitrary pointer with the window. 584 * \sa SDL_GetWindowData()
611 *
612 * \sa SDL_GetWindowData()
613 */ 585 */
614 extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_WindowID windowID, 586 extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_WindowID windowID,
615 void *userdata); 587 void *userdata);
616 588
617 /** 589 /**
618 * \fn void *SDL_GetWindowData(SDL_WindowID windowID) 590 * \brief Retrieve the data pointer associated with the window.
619 * 591 *
620 * \brief Retrieve the data pointer associated with the window. 592 * \sa SDL_SetWindowData()
621 *
622 * \sa SDL_SetWindowData()
623 */ 593 */
624 extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_WindowID windowID); 594 extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_WindowID windowID);
625 595
626 /** 596 /**
627 * \fn void SDL_SetWindowPosition(SDL_WindowID windowID, int x, int y) 597 * \brief Set the position of the window.
628 * 598 *
629 * \brief Set the position of the window. 599 * \param windowID The window to reposition.
630 * 600 * \param x The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
631 * \param windowID The window to reposition 601 ::SDL_WINDOWPOS_UNDEFINED.
632 * \param x The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED 602 * \param y The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
633 * \param y The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED 603 ::SDL_WINDOWPOS_UNDEFINED.
634 * 604 *
635 * \note The window coordinate origin is the upper left of the display. 605 * \note The window coordinate origin is the upper left of the display.
636 * 606 *
637 * \sa SDL_GetWindowPosition() 607 * \sa SDL_GetWindowPosition()
638 */ 608 */
639 extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_WindowID windowID, 609 extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_WindowID windowID,
640 int x, int y); 610 int x, int y);
641 611
642 /** 612 /**
643 * \fn void SDL_GetWindowPosition(SDL_WindowID windowID, int *x, int *y) 613 * \brief Get the position of the window.
644 * 614 *
645 * \brief Get the position of the window. 615 * \sa SDL_SetWindowPosition()
646 *
647 * \sa SDL_SetWindowPosition()
648 */ 616 */
649 extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_WindowID windowID, 617 extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_WindowID windowID,
650 int *x, int *y); 618 int *x, int *y);
651 619
652 /** 620 /**
653 * \fn void SDL_SetWindowSize(SDL_WindowID windowID, int w, int w) 621 * \brief Set the size of the window's client area.
654 * 622 *
655 * \brief Set the size of the window's client area. 623 * \note You can't change the size of a fullscreen window, it automatically
656 * 624 * matches the size of the display mode.
657 * \note You can't change the size of a fullscreen window, it automatically 625 *
658 * matches the size of the display mode. 626 * \sa SDL_GetWindowSize()
659 *
660 * \sa SDL_GetWindowSize()
661 */ 627 */
662 extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_WindowID windowID, int w, 628 extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_WindowID windowID, int w,
663 int h); 629 int h);
664 630
665 /** 631 /**
666 * \fn void SDL_GetWindowSize(SDL_WindowID windowID, int *w, int *h) 632 * \brief Get the size of the window's client area.
667 * 633 *
668 * \brief Get the size of the window's client area. 634 * \sa SDL_SetWindowSize()
669 *
670 * \sa SDL_SetWindowSize()
671 */ 635 */
672 extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_WindowID windowID, int *w, 636 extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_WindowID windowID, int *w,
673 int *h); 637 int *h);
674 638
675 /** 639 /**
676 * \fn void SDL_ShowWindow(SDL_WindowID windowID) 640 * \brief Show the window.
677 * 641 *
678 * \brief Show the window 642 * \sa SDL_HideWindow()
679 *
680 * \sa SDL_HideWindow()
681 */ 643 */
682 extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_WindowID windowID); 644 extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_WindowID windowID);
683 645
684 /** 646 /**
685 * \fn void SDL_HideWindow(SDL_WindowID windowID) 647 * \brief Hide the window.
686 * 648 *
687 * \brief Hide the window 649 * \sa SDL_ShowWindow()
688 *
689 * \sa SDL_ShowWindow()
690 */ 650 */
691 extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_WindowID windowID); 651 extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_WindowID windowID);
692 652
693 /** 653 /**
694 * \fn void SDL_RaiseWindow(SDL_WindowID windowID) 654 * \brief Raise the window above other windows and set the input focus.
695 *
696 * \brief Raise the window above other windows and set the input focus.
697 */ 655 */
698 extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_WindowID windowID); 656 extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_WindowID windowID);
699 657
700 /** 658 /**
701 * \fn void SDL_MaximizeWindow(SDL_WindowID windowID) 659 * \brief Make the window as large as possible.
702 * 660 *
703 * \brief Make the window as large as possible. 661 * \sa SDL_RestoreWindow()
704 *
705 * \sa SDL_RestoreWindow()
706 */ 662 */
707 extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_WindowID windowID); 663 extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_WindowID windowID);
708 664
709 /** 665 /**
710 * \fn void SDL_MinimizeWindow(SDL_WindowID windowID) 666 * \brief Minimize the window to an iconic representation.
711 * 667 *
712 * \brief Minimize the window to an iconic representation. 668 * \sa SDL_RestoreWindow()
713 *
714 * \sa SDL_RestoreWindow()
715 */ 669 */
716 extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_WindowID windowID); 670 extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_WindowID windowID);
717 671
718 /** 672 /**
719 * \fn void SDL_RestoreWindow(SDL_WindowID windowID) 673 * \brief Restore the size and position of a minimized or maximized window.
720 * 674 *
721 * \brief Restore the size and position of a minimized or maximized window. 675 * \sa SDL_MaximizeWindow()
722 * 676 * \sa SDL_MinimizeWindow()
723 * \sa SDL_MaximizeWindow()
724 * \sa SDL_MinimizeWindow()
725 */ 677 */
726 extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_WindowID windowID); 678 extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_WindowID windowID);
727 679
728 /** 680 /**
729 * \fn int SDL_SetWindowFullscreen(SDL_WindowID windowID, int fullscreen) 681 * \brief Set the window's fullscreen state.
730 * 682 *
731 * \brief Set the window's fullscreen state. 683 * \return 0 on success, or -1 if setting the display mode failed.
732 * 684 *
733 * \return 0 on success, or -1 if setting the display mode failed. 685 * \sa SDL_SetFullscreenDisplayMode()
734 *
735 * \sa SDL_SetFullscreenDisplayMode()
736 */ 686 */
737 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_WindowID windowID, 687 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_WindowID windowID,
738 int fullscreen); 688 int fullscreen);
739 689
740 /** 690 /**
741 * \fn void SDL_SetWindowGrab(SDL_WindowID windowID, int mode) 691 * \brief Set the window's input grab mode.
742 * 692 *
743 * \brief Set the window's input grab mode. 693 * \param mode This is 1 to grab input, and 0 to release input.
744 * 694 *
745 * \param mode This is 1 to grab input, and 0 to release input. 695 * \sa SDL_GetWindowGrab()
746 *
747 * \sa SDL_GetWindowGrab()
748 */ 696 */
749 extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_WindowID windowID, 697 extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_WindowID windowID,
750 int mode); 698 int mode);
751 699
752 /** 700 /**
753 * \fn int SDL_GetWindowGrab(SDL_WindowID windowID) 701 * \brief Get the window's input grab mode.
754 * 702 *
755 * \brief Get the window's input grab mode. 703 * \return This returns 1 if input is grabbed, and 0 otherwise.
756 * 704 *
757 * \return This returns 1 if input is grabbed, and 0 otherwise. 705 * \sa SDL_SetWindowGrab()
758 *
759 * \sa SDL_SetWindowGrab()
760 */ 706 */
761 extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_WindowID windowID); 707 extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_WindowID windowID);
762 708
763 /** 709 /**
764 * \fn SDL_bool SDL_GetWindowWMInfo(SDL_WindowID windowID, struct SDL_SysWMinfo * info) 710 * \brief Get driver specific information about a window.
765 * 711 *
766 * \brief Get driver specific information about a window. 712 * \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo.
767 *
768 * \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo.
769 */ 713 */
770 struct SDL_SysWMinfo; 714 struct SDL_SysWMinfo;
771 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID, 715 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID,
772 struct SDL_SysWMinfo 716 struct SDL_SysWMinfo
773 *info); 717 *info);
774 718
775 /** 719 /**
776 * \fn void SDL_DestroyWindow(SDL_WindowID windowID) 720 * \brief Destroy a window.
777 *
778 * \brief Destroy a window.
779 */ 721 */
780 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_WindowID windowID); 722 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_WindowID windowID);
781 723
782 /** 724 /**
783 * \fn int SDL_GetNumRenderDrivers(void) 725 * \brief Get the number of 2D rendering drivers available for the current
784 * 726 * display.
785 * \brief Get the number of 2D rendering drivers available for the current display. 727 *
786 * 728 * A render driver is a set of code that handles rendering and texture
787 * A render driver is a set of code that handles rendering and texture 729 * management on a particular display. Normally there is only one, but
788 * management on a particular display. Normally there is only one, but 730 * some drivers may have several available with different capabilities.
789 * some drivers may have several available with different capabilities. 731 *
790 * 732 * \sa SDL_GetRenderDriverInfo()
791 * \sa SDL_GetRenderDriverInfo() 733 * \sa SDL_CreateRenderer()
792 * \sa SDL_CreateRenderer()
793 */ 734 */
794 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); 735 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
795 736
796 /** 737 /**
797 * \fn int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info) 738 * \brief Get information about a specific 2D rendering driver for the current
798 * 739 * display.
799 * \brief Get information about a specific 2D rendering driver for the current display. 740 *
800 * 741 * \param index The index of the driver to query information about.
801 * \param index The index of the driver to query information about. 742 * \param info A pointer to an SDL_RendererInfo struct to be filled with
802 * \param info A pointer to an SDL_RendererInfo struct to be filled with information on the rendering driver. 743 * information on the rendering driver.
803 * 744 *
804 * \return 0 on success, -1 if the index was out of range 745 * \return 0 on success, -1 if the index was out of range.
805 * 746 *
806 * \sa SDL_CreateRenderer() 747 * \sa SDL_CreateRenderer()
807 */ 748 */
808 extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, 749 extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
809 SDL_RendererInfo * info); 750 SDL_RendererInfo * info);
810 751
811 /** 752 /**
812 * \fn int SDL_CreateRenderer(SDL_WindowID window, int index, Uint32 flags) 753 * \brief Create and make active a 2D rendering context for a window.
813 * 754 *
814 * \brief Create and make active a 2D rendering context for a window. 755 * \param windowID The window used for rendering.
815 * 756 * \param index The index of the rendering driver to initialize, or -1 to
816 * \param windowID The window used for rendering 757 * initialize the first one supporting the requested flags.
817 * \param index The index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags. 758 * \param flags ::SDL_RendererFlags.
818 * \param flags SDL_RendererFlags 759 *
819 * 760 * \return 0 on success, -1 if there was an error creating the renderer.
820 * \return 0 on success, -1 if there was an error creating the renderer. 761 *
821 * 762 * \sa SDL_SelectRenderer()
822 * \sa SDL_SelectRenderer() 763 * \sa SDL_GetRendererInfo()
823 * \sa SDL_GetRendererInfo() 764 * \sa SDL_DestroyRenderer()
824 * \sa SDL_DestroyRenderer()
825 */ 765 */
826 extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_WindowID windowID, 766 extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_WindowID windowID,
827 int index, Uint32 flags); 767 int index, Uint32 flags);
828 768
829 /** 769 /**
830 * \fn int SDL_SelectRenderer(SDL_WindowID windowID) 770 * \brief Select the rendering context for a particular window.
831 * 771 *
832 * \brief Select the rendering context for a particular window. 772 * \return 0 on success, -1 if the selected window doesn't have a
833 * 773 * rendering context.
834 * \return 0 on success, -1 if the selected window doesn't have a
835 * rendering context.
836 */ 774 */
837 extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_WindowID windowID); 775 extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_WindowID windowID);
838 776
839 /** 777 /**
840 * \fn int SDL_GetRendererInfo(SDL_RendererInfo *info) 778 * \brief Get information about the current rendering context.
841 *
842 * \brief Get information about the current rendering context.
843 */ 779 */
844 extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info); 780 extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
845 781
846 /** 782 /**
847 * \fn SDL_TextureID SDL_CreateTexture(Uint32 format, int access, int w, int h) 783 * \brief Create a texture for the current rendering context.
848 * 784 *
849 * \brief Create a texture for the current rendering context. 785 * \param format The format of the texture.
850 * 786 * \param access One of the enumerated values in ::SDL_TextureAccess.
851 * \param format The format of the texture 787 * \param w The width of the texture in pixels.
852 * \param access One of the enumerated values in SDL_TextureAccess 788 * \param h The height of the texture in pixels.
853 * \param w The width of the texture in pixels 789 *
854 * \param h The height of the texture in pixels 790 * \return The created texture is returned, or 0 if no rendering context was
855 * 791 * active, the format was unsupported, or the width or height were out
856 * \return The created texture is returned, or 0 if no rendering context was active, the format was unsupported, or the width or height were out of range. 792 * of range.
857 * 793 *
858 * \sa SDL_QueryTexture() 794 * \sa SDL_QueryTexture()
859 * \sa SDL_DestroyTexture() 795 * \sa SDL_DestroyTexture()
860 */ 796 */
861 extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTexture(Uint32 format, 797 extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTexture(Uint32 format,
862 int access, int w, 798 int access, int w,
863 int h); 799 int h);
864 800
865 /** 801 /**
866 * \fn SDL_TextureID SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface *surface) 802 * \brief Create a texture from an existing surface.
867 * 803 *
868 * \brief Create a texture from an existing surface. 804 * \param format The format of the texture, or 0 to pick an appropriate format.
869 * 805 * \param surface The surface containing pixel data used to fill the texture.
870 * \param format The format of the texture, or 0 to pick an appropriate format 806 *
871 * \param surface The surface containing pixel data used to fill the texture 807 * \return The created texture is returned, or 0 if no rendering context was
872 * 808 * active, the format was unsupported, or the surface width or height
873 * \return The created texture is returned, or 0 if no rendering context was active, the format was unsupported, or the surface width or height were out of range. 809 * were out of range.
874 * 810 *
875 * \note The surface is not modified or freed by this function. 811 * \note The surface is not modified or freed by this function.
876 * 812 *
877 * \sa SDL_QueryTexture() 813 * \sa SDL_QueryTexture()
878 * \sa SDL_DestroyTexture() 814 * \sa SDL_DestroyTexture()
879 */ 815 */
880 extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTextureFromSurface(Uint32 816 extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTextureFromSurface(Uint32
881 format, 817 format,
882 SDL_Surface 818 SDL_Surface
883 * surface); 819 * surface);
884 820
885 /** 821 /**
886 * \fn int SDL_QueryTexture(SDL_TextureID textureID, Uint32 *format, int *access, int *w, int *h) 822 * \brief Query the attributes of a texture
887 * 823 *
888 * \brief Query the attributes of a texture 824 * \param textureID A texture to be queried.
889 * 825 * \param format A pointer filled in with the raw format of the texture. The
890 * \param texture A texture to be queried 826 * actual format may differ, but pixel transfers will use this
891 * \param format A pointer filled in with the raw format of the texture. The actual format may differ, but pixel transfers will use this format. 827 * format.
892 * \param access A pointer filled in with the actual access to the texture. 828 * \param access A pointer filled in with the actual access to the texture.
893 * \param w A pointer filled in with the width of the texture in pixels 829 * \param w A pointer filled in with the width of the texture in pixels.
894 * \param h A pointer filled in with the height of the texture in pixels 830 * \param h A pointer filled in with the height of the texture in pixels.
895 * 831 *
896 * \return 0 on success, or -1 if the texture is not valid 832 * \return 0 on success, or -1 if the texture is not valid.
897 */ 833 */
898 extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_TextureID textureID, 834 extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_TextureID textureID,
899 Uint32 * format, int *access, 835 Uint32 * format, int *access,
900 int *w, int *h); 836 int *w, int *h);
901 837
902 /** 838 /**
903 * \fn int SDL_QueryTexturePixels(SDL_TextureID textureID, void **pixels, int pitch) 839 * \brief Query the pixels of a texture, if the texture does not need to be
904 * 840 * locked for pixel access.
905 * \brief Query the pixels of a texture, if the texture does not need to be locked for pixel access. 841 *
906 * 842 * \param textureID A texture to be queried, which was created with
907 * \param texture A texture to be queried, which was created with SDL_TEXTUREACCESS_STREAMING 843 * ::SDL_TEXTUREACCESS_STREAMING.
908 * \param pixels A pointer filled with a pointer to the pixels for the texture 844 * \param pixels A pointer filled with a pointer to the pixels for the
909 * \param pitch A pointer filled in with the pitch of the pixel data 845 * texture.
910 * 846 * \param pitch A pointer filled in with the pitch of the pixel data.
911 * \return 0 on success, or -1 if the texture is not valid, or must be locked for pixel access. 847 *
848 * \return 0 on success, or -1 if the texture is not valid, or must be locked
849 * for pixel access.
912 */ 850 */
913 extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_TextureID textureID, 851 extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_TextureID textureID,
914 void **pixels, int *pitch); 852 void **pixels, int *pitch);
915 853
916 /** 854 /**
917 * \fn int SDL_SetTexturePalette(SDL_TextureID textureID, const SDL_Color * colors, int firstcolor, int ncolors) 855 * \brief Set the color palette of an indexed texture.
918 * 856 *
919 * \brief Set the color palette of an indexed texture. 857 * \param textureID The texture to update.
920 * 858 * \param colors The array of RGB color data.
921 * \param texture The texture to update 859 * \param firstcolor The first index to update.
922 * \param colors The array of RGB color data 860 * \param ncolors The number of palette entries to fill with the color data.
923 * \param firstcolor The first index to update 861 *
924 * \param ncolors The number of palette entries to fill with the color data 862 * \return 0 on success, or -1 if the texture is not valid or not an indexed
925 * 863 * texture.
926 * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
927 */ 864 */
928 extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID, 865 extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID,
929 const SDL_Color * colors, 866 const SDL_Color * colors,
930 int firstcolor, 867 int firstcolor,
931 int ncolors); 868 int ncolors);
932 869
933 /** 870 /**
934 * \fn int SDL_GetTexturePalette(SDL_TextureID textureID, SDL_Color * colors, int firstcolor, int ncolors) 871 * \brief Get the color palette from an indexed texture if it has one.
935 * 872 *
936 * \brief Get the color palette from an indexed texture if it has one. 873 * \param textureID The texture to update.
937 * 874 * \param colors The array to fill with RGB color data.
938 * \param texture The texture to update 875 * \param firstcolor The first index to retrieve.
939 * \param colors The array to fill with RGB color data 876 * \param ncolors The number of palette entries to retrieve.
940 * \param firstcolor The first index to retrieve 877 *
941 * \param ncolors The number of palette entries to retrieve 878 * \return 0 on success, or -1 if the texture is not valid or not an indexed
942 * 879 * texture.
943 * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
944 */ 880 */
945 extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID, 881 extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID,
946 SDL_Color * colors, 882 SDL_Color * colors,
947 int firstcolor, 883 int firstcolor,
948 int ncolors); 884 int ncolors);
949 885
950 /** 886 /**
951 * \fn int SDL_SetTextureColorMod(SDL_TextureID textureID, Uint8 r, Uint8 g, Uint8 b) 887 * \brief Set an additional color value used in render copy operations.
952 * 888 *
953 * \brief Set an additional color value used in render copy operations 889 * \param textureID The texture to update.
954 * 890 * \param r The red source color value multiplied into copy operations.
955 * \param texture The texture to update 891 * \param g The green source color value multiplied into copy operations.
956 * \param r The red source color value multiplied into copy operations 892 * \param b The blue source color value multiplied into copy operations.
957 * \param g The green source color value multiplied into copy operations 893 *
958 * \param b The blue source color value multiplied into copy operations 894 * \return 0 on success, or -1 if the texture is not valid or color modulation
959 * 895 * is not supported.
960 * \return 0 on success, or -1 if the texture is not valid or color modulation is not supported 896 *
961 * 897 * \sa SDL_GetTextureColorMod()
962 * \sa SDL_GetTextureColorMod()
963 */ 898 */
964 extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID, 899 extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID,
965 Uint8 r, Uint8 g, Uint8 b); 900 Uint8 r, Uint8 g, Uint8 b);
966 901
967 902
968 /** 903 /**
969 * \fn int SDL_GetTextureColorMod(SDL_TextureID textureID, Uint8 *r, Uint8 *g, Uint8 *b) 904 * \brief Get the additional color value used in render copy operations.
970 * 905 *
971 * \brief Get the additional color value used in render copy operations 906 * \param textureID The texture to query.
972 * 907 * \param r A pointer filled in with the source red color value.
973 * \param texture The texture to query 908 * \param g A pointer filled in with the source green color value.
974 * \param r A pointer filled in with the source red color value 909 * \param b A pointer filled in with the source blue color value.
975 * \param g A pointer filled in with the source green color value 910 *
976 * \param b A pointer filled in with the source blue color value 911 * \return 0 on success, or -1 if the texture is not valid.
977 * 912 *
978 * \return 0 on success, or -1 if the texture is not valid 913 * \sa SDL_SetTextureColorMod()
979 *
980 * \sa SDL_SetTextureColorMod()
981 */ 914 */
982 extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID, 915 extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID,
983 Uint8 * r, Uint8 * g, 916 Uint8 * r, Uint8 * g,
984 Uint8 * b); 917 Uint8 * b);
985 918
986 /** 919 /**
987 * \fn int SDL_SetTextureAlphaMod(SDL_TextureID textureID, Uint8 alpha) 920 * \brief Set an additional alpha value used in render copy operations.
988 * 921 *
989 * \brief Set an additional alpha value used in render copy operations 922 * \param textureID The texture to update.
990 * 923 * \param alpha The source alpha value multiplied into copy operations.
991 * \param texture The texture to update 924 *
992 * \param alpha The source alpha value multiplied into copy operations. 925 * \return 0 on success, or -1 if the texture is not valid or alpha modulation
993 * 926 * is not supported.
994 * \return 0 on success, or -1 if the texture is not valid or alpha modulation is not supported 927 *
995 * 928 * \sa SDL_GetTextureAlphaMod()
996 * \sa SDL_GetTextureAlphaMod()
997 */ 929 */
998 extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID, 930 extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID,
999 Uint8 alpha); 931 Uint8 alpha);
1000 932
1001 /** 933 /**
1002 * \fn int SDL_GetTextureAlphaMod(SDL_TextureID textureID, Uint8 *alpha) 934 * \brief Get the additional alpha value used in render copy operations.
1003 * 935 *
1004 * \brief Get the additional alpha value used in render copy operations 936 * \param textureID The texture to query.
1005 * 937 * \param alpha A pointer filled in with the source alpha value.
1006 * \param texture The texture to query 938 *
1007 * \param alpha A pointer filled in with the source alpha value 939 * \return 0 on success, or -1 if the texture is not valid.
1008 * 940 *
1009 * \return 0 on success, or -1 if the texture is not valid 941 * \sa SDL_SetTextureAlphaMod()
1010 *
1011 * \sa SDL_SetTextureAlphaMod()
1012 */ 942 */
1013 extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID, 943 extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID,
1014 Uint8 * alpha); 944 Uint8 * alpha);
1015 945
1016 /** 946 /**
1017 * \fn int SDL_SetTextureBlendMode(SDL_TextureID textureID, int blendMode) 947 * \brief Set the blend mode used for texture copy operations.
1018 * 948 *
1019 * \brief Set the blend mode used for texture copy operations 949 * \param textureID The texture to update.
1020 * 950 * \param blendMode ::SDL_BlendMode to use for texture blending.
1021 * \param texture The texture to update 951 *
1022 * \param blendMode SDL_TextureBlendMode to use for texture blending 952 * \return 0 on success, or -1 if the texture is not valid or the blend mode is
1023 * 953 * not supported.
1024 * \return 0 on success, or -1 if the texture is not valid or the blend mode is not supported 954 *
1025 * 955 * \note If the blend mode is not supported, the closest supported mode is
1026 * \note If the blend mode is not supported, the closest supported mode is chosen. 956 * chosen.
1027 * 957 *
1028 * \sa SDL_GetTextureBlendMode() 958 * \sa SDL_GetTextureBlendMode()
1029 */ 959 */
1030 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID, 960 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID,
1031 int blendMode); 961 int blendMode);
1032 962
1033 /** 963 /**
1034 * \fn int SDL_GetTextureBlendMode(SDL_TextureID textureID, int *blendMode) 964 * \brief Get the blend mode used for texture copy operations.
1035 * 965 *
1036 * \brief Get the blend mode used for texture copy operations 966 * \param textureID The texture to query.
1037 * 967 * \param blendMode A pointer filled in with the current blend mode.
1038 * \param texture The texture to query 968 *
1039 * \param blendMode A pointer filled in with the current blend mode 969 * \return 0 on success, or -1 if the texture is not valid.
1040 * 970 *
1041 * \return 0 on success, or -1 if the texture is not valid 971 * \sa SDL_SetTextureBlendMode()
1042 *
1043 * \sa SDL_SetTextureBlendMode()
1044 */ 972 */
1045 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID, 973 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID,
1046 int *blendMode); 974 int *blendMode);
1047 975
1048 /** 976 /**
1049 * \fn int SDL_SetTextureScaleMode(SDL_TextureID textureID, int scaleMode) 977 * \brief Set the scale mode used for texture copy operations.
1050 * 978 *
1051 * \brief Set the scale mode used for texture copy operations 979 * \param textureID The texture to update.
1052 * 980 * \param scaleMode ::SDL_TextureScaleMode to use for texture scaling.
1053 * \param texture The texture to update 981 *
1054 * \param scaleMode SDL_TextureScaleMode to use for texture scaling 982 * \return 0 on success, or -1 if the texture is not valid or the scale mode is
1055 * 983 * not supported.
1056 * \return 0 on success, or -1 if the texture is not valid or the scale mode is not supported 984 *
1057 * 985 * \note If the scale mode is not supported, the closest supported mode is
1058 * \note If the scale mode is not supported, the closest supported mode is chosen. 986 * chosen.
1059 * 987 *
1060 * \sa SDL_GetTextureScaleMode() 988 * \sa SDL_GetTextureScaleMode()
1061 */ 989 */
1062 extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID, 990 extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID,
1063 int scaleMode); 991 int scaleMode);
1064 992
1065 /** 993 /**
1066 * \fn int SDL_GetTextureScaleMode(SDL_TextureID textureID, int *scaleMode) 994 * \brief Get the scale mode used for texture copy operations.
1067 * 995 *
1068 * \brief Get the scale mode used for texture copy operations 996 * \param textureID The texture to query.
1069 * 997 * \param scaleMode A pointer filled in with the current scale mode.
1070 * \param texture The texture to query 998 *
1071 * \param scaleMode A pointer filled in with the current scale mode 999 * \return 0 on success, or -1 if the texture is not valid.
1072 * 1000 *
1073 * \return 0 on success, or -1 if the texture is not valid 1001 * \sa SDL_SetTextureScaleMode()
1074 *
1075 * \sa SDL_SetTextureScaleMode()
1076 */ 1002 */
1077 extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID, 1003 extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID,
1078 int *scaleMode); 1004 int *scaleMode);
1079 1005
1080 /** 1006 /**
1081 * \fn int SDL_UpdateTexture(SDL_TextureID textureID, const SDL_Rect *rect, const void *pixels, int pitch) 1007 * \brief Update the given texture rectangle with new pixel data.
1082 * 1008 *
1083 * \brief Update the given texture rectangle with new pixel data. 1009 * \param textureID The texture to update
1084 * 1010 * \param rect A pointer to the rectangle of pixels to update, or NULL to
1085 * \param texture The texture to update 1011 * update the entire texture.
1086 * \param rect A pointer to the rectangle of pixels to update, or NULL to update the entire texture. 1012 * \param pixels The raw pixel data.
1087 * \param pixels The raw pixel data 1013 * \param pitch The number of bytes between rows of pixel data.
1088 * \param pitch The number of bytes between rows of pixel data 1014 *
1089 * 1015 * \return 0 on success, or -1 if the texture is not valid.
1090 * \return 0 on success, or -1 if the texture is not valid 1016 *
1091 * 1017 * \note This is a fairly slow function.
1092 * \note This is a fairly slow function.
1093 */ 1018 */
1094 extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID, 1019 extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID,
1095 const SDL_Rect * rect, 1020 const SDL_Rect * rect,
1096 const void *pixels, int pitch); 1021 const void *pixels, int pitch);
1097 1022
1098 /** 1023 /**
1099 * \fn void SDL_LockTexture(SDL_TextureID textureID, const SDL_Rect *rect, int markDirty, void **pixels, int *pitch) 1024 * \brief Lock a portion of the texture for pixel access.
1100 * 1025 *
1101 * \brief Lock a portion of the texture for pixel access. 1026 * \param textureID The texture to lock for access, which was created with
1102 * 1027 * ::SDL_TEXTUREACCESS_STREAMING.
1103 * \param textureID The texture to lock for access, which was created with SDL_TEXTUREACCESS_STREAMING. 1028 * \param rect A pointer to the rectangle to lock for access. If the rect
1104 * \param rect A pointer to the rectangle to lock for access. If the rect is NULL, the entire texture will be locked. 1029 * is NULL, the entire texture will be locked.
1105 * \param markDirty If this is nonzero, the locked area will be marked dirty when the texture is unlocked. 1030 * \param markDirty If this is nonzero, the locked area will be marked dirty
1106 * \param pixels This is filled in with a pointer to the locked pixels, appropriately offset by the locked area. 1031 * when the texture is unlocked.
1107 * \param pitch This is filled in with the pitch of the locked pixels. 1032 * \param pixels This is filled in with a pointer to the locked pixels,
1108 * 1033 * appropriately offset by the locked area.
1109 * \return 0 on success, or -1 if the texture is not valid or was created with SDL_TEXTUREACCESS_STATIC 1034 * \param pitch This is filled in with the pitch of the locked pixels.
1110 * 1035 *
1111 * \sa SDL_DirtyTexture() 1036 * \return 0 on success, or -1 if the texture is not valid or was created with
1112 * \sa SDL_UnlockTexture() 1037 * ::SDL_TEXTUREACCESS_STATIC.
1038 *
1039 * \sa SDL_DirtyTexture()
1040 * \sa SDL_UnlockTexture()
1113 */ 1041 */
1114 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID, 1042 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID,
1115 const SDL_Rect * rect, 1043 const SDL_Rect * rect,
1116 int markDirty, void **pixels, 1044 int markDirty, void **pixels,
1117 int *pitch); 1045 int *pitch);
1118 1046
1119 /** 1047 /**
1120 * \fn void SDL_UnlockTexture(SDL_TextureID textureID) 1048 * \brief Unlock a texture, uploading the changes to video memory, if needed.
1121 * 1049 *
1122 * \brief Unlock a texture, uploading the changes to video memory, if needed. 1050 * \sa SDL_LockTexture()
1123 * 1051 * \sa SDL_DirtyTexture()
1124 * \sa SDL_LockTexture()
1125 * \sa SDL_DirtyTexture()
1126 */ 1052 */
1127 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID); 1053 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID);
1128 1054
1129 /** 1055 /**
1130 * \fn void SDL_DirtyTexture(SDL_TextureID textureID, int numrects, const SDL_Rect * rects) 1056 * \brief Mark the specified rectangles of the texture as dirty.
1131 * 1057 *
1132 * \brief Mark the specified rectangles of the texture as dirty. 1058 * \param textureID The texture to mark dirty, which was created with
1133 * 1059 * ::SDL_TEXTUREACCESS_STREAMING.
1134 * \param textureID The texture to mark dirty, which was created with SDL_TEXTUREACCESS_STREAMING. 1060 * \param numrects The number of rectangles pointed to by rects.
1135 * \param numrects The number of rectangles pointed to by rects. 1061 * \param rects The pointer to an array of dirty rectangles.
1136 * \param rects The pointer to an array of dirty rectangles. 1062 *
1137 * 1063 * \sa SDL_LockTexture()
1138 * \sa SDL_LockTexture() 1064 * \sa SDL_UnlockTexture()
1139 * \sa SDL_UnlockTexture()
1140 */ 1065 */
1141 extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID, 1066 extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID,
1142 int numrects, 1067 int numrects,
1143 const SDL_Rect * rects); 1068 const SDL_Rect * rects);
1144 1069
1145 /** 1070 /**
1146 * \fn int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a) 1071 * \brief Set the color used for drawing operations (Fill and Line).
1147 * 1072 *
1148 * \brief Set the color used for drawing operations (Fill and Line). 1073 * \param r The red value used to draw on the rendering target.
1149 * 1074 * \param g The green value used to draw on the rendering target.
1150 * \param r The red value used to draw on the rendering target 1075 * \param b The blue value used to draw on the rendering target.
1151 * \param g The green value used to draw on the rendering target 1076 * \param a The alpha value used to draw on the rendering target, usually
1152 * \param b The blue value used to draw on the rendering target 1077 * ::SDL_ALPHA_OPAQUE (255).
1153 * \param a The alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255) 1078 *
1154 * \return 0 on success, or -1 if there is no rendering context current 1079 * \return 0 on success, or -1 if there is no rendering context current.
1155 */ 1080 */
1156 extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, 1081 extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
1157 Uint8 a); 1082 Uint8 a);
1158 1083
1159 /** 1084 /**
1160 * \fn int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) 1085 * \brief Get the color used for drawing operations (Fill and Line).
1161 * 1086 *
1162 * \brief Get the color used for drawing operations (Fill and Line). 1087 * \param r A pointer to the red value used to draw on the rendering target.
1163 * 1088 * \param g A pointer to the green value used to draw on the rendering target.
1164 * \param r A pointer to the red value used to draw on the rendering target 1089 * \param b A pointer to the blue value used to draw on the rendering target.
1165 * \param g A pointer to the green value used to draw on the rendering target 1090 * \param a A pointer to the alpha value used to draw on the rendering target,
1166 * \param b A pointer to the blue value used to draw on the rendering target 1091 * usually ::SDL_ALPHA_OPAQUE (255).
1167 * \param a A pointer to the alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255) 1092 *
1168 * \return 0 on success, or -1 if there is no rendering context current 1093 * \return 0 on success, or -1 if there is no rendering context current.
1169 */ 1094 */
1170 extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b, 1095 extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
1171 Uint8 * a); 1096 Uint8 * a);
1172 1097
1173 /** 1098 /**
1174 * \fn int SDL_SetRenderDrawBlendMode(int blendMode) 1099 * \brief Set the blend mode used for drawing operations (Fill and Line).
1175 * 1100 *
1176 * \brief Set the blend mode used for drawing operations (Fill and Line). 1101 * \param blendMode ::SDL_BlendMode to use for blending.
1177 * 1102 *
1178 * \param blendMode SDL_BlendMode to use for blending 1103 * \return 0 on success, or -1 if there is no rendering context current.
1179 * 1104 *
1180 * \return 0 on success, or -1 if there is no rendering context current 1105 * \note If the blend mode is not supported, the closest supported mode is
1181 * 1106 * chosen.
1182 * \note If the blend mode is not supported, the closest supported mode is chosen. 1107 *
1183 * 1108 * \sa SDL_GetRenderDrawBlendMode()
1184 * \sa SDL_SetRenderDrawBlendMode()
1185 */ 1109 */
1186 extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode); 1110 extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode);
1187 1111
1188 /** 1112 /**
1189 * \fn int SDL_GetRenderDrawBlendMode(int *blendMode) 1113 * \brief Get the blend mode used for drawing operations.
1190 * 1114 *
1191 * \brief Get the blend mode used for drawing operations 1115 * \param blendMode A pointer filled in with the current blend mode.
1192 * 1116 *
1193 * \param blendMode A pointer filled in with the current blend mode 1117 * \return 0 on success, or -1 if there is no rendering context current.
1194 * 1118 *
1195 * \return 0 on success, or -1 if there is no rendering context current 1119 * \sa SDL_SetRenderDrawBlendMode()
1196 *
1197 * \sa SDL_SetRenderDrawBlendMode()
1198 */ 1120 */
1199 extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode); 1121 extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode);
1200 1122
1201 /** 1123 /**
1202 * \fn int SDL_RenderPoint(int x, int y) 1124 * \brief Draw a point on the current rendering target.
1203 * 1125 *
1204 * \brief Draw a point on the current rendering target. 1126 * \param x The x coordinate of the point.
1205 * 1127 * \param y The y coordinate of the point.
1206 * \param x The x coordinate of the point 1128 *
1207 * \param y The y coordinate of the point 1129 * \return 0 on success, or -1 if there is no rendering context current.
1208 *
1209 * \return 0 on success, or -1 if there is no rendering context current
1210 */ 1130 */
1211 extern DECLSPEC int SDLCALL SDL_RenderPoint(int x, int y); 1131 extern DECLSPEC int SDLCALL SDL_RenderPoint(int x, int y);
1212 1132
1213 /** 1133 /**
1214 * \fn int SDL_RenderLine(int x1, int y1, int x2, int y2) 1134 * \brief Draw a line on the current rendering target.
1215 * 1135 *
1216 * \brief Draw a line on the current rendering target. 1136 * \param x1 The x coordinate of the start point.
1217 * 1137 * \param y1 The y coordinate of the start point.
1218 * \param x1 The x coordinate of the start point 1138 * \param x2 The x coordinate of the end point.
1219 * \param y1 The y coordinate of the start point 1139 * \param y2 The y coordinate of the end point.
1220 * \param x2 The x coordinate of the end point 1140 *
1221 * \param y2 The y coordinate of the end point 1141 * \return 0 on success, or -1 if there is no rendering context current.
1222 *
1223 * \return 0 on success, or -1 if there is no rendering context current
1224 */ 1142 */
1225 extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2); 1143 extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2);
1226 1144
1227 /** 1145 /**
1228 * \fn void SDL_RenderFill(const SDL_Rect *rect) 1146 * \brief Fill the current rendering target with the drawing color.
1229 * 1147 *
1230 * \brief Fill the current rendering target with the drawing color. 1148 * \param rect A pointer to the destination rectangle, or NULL for the entire
1231 * 1149 * rendering target.
1232 * \param rect A pointer to the destination rectangle, or NULL for the entire rendering target. 1150 *
1233 * 1151 * \return 0 on success, or -1 if there is no rendering context current.
1234 * \return 0 on success, or -1 if there is no rendering context current
1235 */ 1152 */
1236 extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect); 1153 extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect);
1237 1154
1238 /** 1155 /**
1239 * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect) 1156 * \brief Copy a portion of the texture to the current rendering target.
1240 * 1157 *
1241 * \brief Copy a portion of the texture to the current rendering target. 1158 * \param textureID The source texture.
1242 * 1159 * \param srcrect A pointer to the source rectangle, or NULL for the entire
1243 * \param texture The source texture. 1160 * texture.
1244 * \param srcrect A pointer to the source rectangle, or NULL for the entire texture. 1161 * \param dstrect A pointer to the destination rectangle, or NULL for the
1245 * \param dstrect A pointer to the destination rectangle, or NULL for the entire rendering target. 1162 * entire rendering target.
1246 * 1163 *
1247 * \return 0 on success, or -1 if there is no rendering context current, or the driver doesn't support the requested operation. 1164 * \return 0 on success, or -1 if there is no rendering context current, or the
1165 * driver doesn't support the requested operation.
1248 */ 1166 */
1249 extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID, 1167 extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID,
1250 const SDL_Rect * srcrect, 1168 const SDL_Rect * srcrect,
1251 const SDL_Rect * dstrect); 1169 const SDL_Rect * dstrect);
1252 1170
1253 /** 1171 /**
1254 * \fn int SDL_RenderReadPixels(const SDL_Rect *rect, void *pixels, int pitch) 1172 * \brief Read pixels from the current rendering target.
1255 * 1173 *
1256 * \brief Read pixels from the current rendering target. 1174 * \param rect A pointer to the rectangle to read, or NULL for the entire
1257 * 1175 * render target.
1258 * \param rect A pointer to the rectangle to read, or NULL for the entire render target 1176 * \param pixels A pointer to be filled in with the pixel data in the rendering
1259 * \param pixels A pointer to be filled in with the pixel data in the rendering target format 1177 * target format.
1260 * \param pitch The pitch of the pixels parameter 1178 * \param pitch The pitch of the pixels parameter.
1261 * 1179 *
1262 * \return 0 on success, or -1 if pixel reading is not supported. 1180 * \return 0 on success, or -1 if pixel reading is not supported.
1263 * 1181 *
1264 * \warning This is a very slow operation, and should not be used frequently. 1182 * \warning This is a very slow operation, and should not be used frequently.
1265 */ 1183 */
1266 extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect, 1184 extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
1267 void *pixels, int pitch); 1185 void *pixels, int pitch);
1268 1186
1269 /** 1187 /**
1270 * \fn int SDL_RenderWritePixels(const SDL_Rect *rect, const void *pixels, int pitch) 1188 * \brief Write pixels to the current rendering target.
1271 * 1189 *
1272 * \brief Write pixels to the current rendering target. 1190 * \param rect A pointer to the rectangle to write, or NULL for the entire
1273 * 1191 * render target.
1274 * \param rect A pointer to the rectangle to write, or NULL for the entire render target 1192 * \param pixels A pointer to the pixel data to write.
1275 * \param pixels A pointer to the pixel data to write 1193 * \param pitch The pitch of the pixels parameter.
1276 * \param pitch The pitch of the pixels parameter 1194 *
1277 * 1195 * \return 0 on success, or -1 if pixel writing is not supported.
1278 * \return 0 on success, or -1 if pixel writing is not supported. 1196 *
1279 * 1197 * \warning This is a very slow operation, and should not be used frequently.
1280 * \warning This is a very slow operation, and should not be used frequently.
1281 */ 1198 */
1282 extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect, 1199 extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
1283 const void *pixels, 1200 const void *pixels,
1284 int pitch); 1201 int pitch);
1285 1202
1286 /** 1203 /**
1287 * \fn void SDL_RenderPresent(void) 1204 * \brief Update the screen with rendering performed.
1288 *
1289 * \brief Update the screen with rendering performed.
1290 */ 1205 */
1291 extern DECLSPEC void SDLCALL SDL_RenderPresent(void); 1206 extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
1292 1207
1293 /** 1208 /**
1294 * \fn void SDL_DestroyTexture(SDL_TextureID textureID); 1209 * \brief Destroy the specified texture.
1295 * 1210 *
1296 * \brief Destroy the specified texture. 1211 * \sa SDL_CreateTexture()
1297 * 1212 * \sa SDL_CreateTextureFromSurface()
1298 * \sa SDL_CreateTexture()
1299 * \sa SDL_CreateTextureFromSurface()
1300 */ 1213 */
1301 extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_TextureID textureID); 1214 extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_TextureID textureID);
1302 1215
1303 /** 1216 /**
1304 * \fn void SDL_DestroyRenderer(SDL_WindowID windowID); 1217 * \brief Destroy the rendering context for a window and free associated
1305 * 1218 * textures.
1306 * \brief Destroy the rendering context for a window and free associated 1219 *
1307 * textures. 1220 * \sa SDL_CreateRenderer()
1308 *
1309 * \sa SDL_CreateRenderer()
1310 */ 1221 */
1311 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID); 1222 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID);
1312 1223
1313 /** 1224 /**
1314 * \fn SDL_bool SDL_IsScreenSaverEnabled(); 1225 * \brief Returns whether the screensaver is currently enabled (default off).
1315 * 1226 *
1316 * \brief Returns whether the screensaver is currently enabled (default off). 1227 * \sa SDL_EnableScreenSaver()
1317 * 1228 * \sa SDL_DisableScreenSaver()
1318 * \sa SDL_EnableScreenSaver()
1319 * \sa SDL_DisableScreenSaver()
1320 */ 1229 */
1321 extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); 1230 extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void);
1322 1231
1323 /** 1232 /**
1324 * \fn void SDL_EnableScreenSaver(); 1233 * \brief Allow the screen to be blanked by a screensaver
1325 * 1234 *
1326 * \brief Allow the screen to be blanked by a screensaver 1235 * \sa SDL_IsScreenSaverEnabled()
1327 * 1236 * \sa SDL_DisableScreenSaver()
1328 * \sa SDL_IsScreenSaverEnabled()
1329 * \sa SDL_DisableScreenSaver()
1330 */ 1237 */
1331 extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); 1238 extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
1332 1239
1333 /** 1240 /**
1334 * \fn void SDL_DisableScreenSaver(); 1241 * \brief Prevent the screen from being blanked by a screensaver
1335 * 1242 *
1336 * \brief Prevent the screen from being blanked by a screensaver 1243 * \sa SDL_IsScreenSaverEnabled()
1337 * 1244 * \sa SDL_EnableScreenSaver()
1338 * \sa SDL_IsScreenSaverEnabled()
1339 * \sa SDL_EnableScreenSaver()
1340 */ 1245 */
1341 extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); 1246 extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void);
1342 1247
1343 1248
1344 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1249 /**
1345 /* OpenGL support functions. */ 1250 * \name OpenGL support functions
1346 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1251 */
1347 1252 /*@{*/
1348 /** 1253
1349 * \fn int SDL_GL_LoadLibrary(const char *path) 1254 /**
1350 * 1255 * \brief Dynamically load an OpenGL library.
1351 * \brief Dynamically load an OpenGL library. 1256 *
1352 * 1257 * \param path The platform dependent OpenGL library name, or NULL to open the
1353 * \param path The platform dependent OpenGL library name, or NULL to open the default OpenGL library 1258 * default OpenGL library.
1354 * 1259 *
1355 * \return 0 on success, or -1 if the library couldn't be loaded 1260 * \return 0 on success, or -1 if the library couldn't be loaded.
1356 * 1261 *
1357 * This should be done after initializing the video driver, but before 1262 * This should be done after initializing the video driver, but before
1358 * creating any OpenGL windows. If no OpenGL library is loaded, the default 1263 * creating any OpenGL windows. If no OpenGL library is loaded, the default
1359 * library will be loaded upon creation of the first OpenGL window. 1264 * library will be loaded upon creation of the first OpenGL window.
1360 * 1265 *
1361 * \note If you do this, you need to retrieve all of the GL functions used in 1266 * \note If you do this, you need to retrieve all of the GL functions used in
1362 * your program from the dynamic library using SDL_GL_GetProcAddress(). 1267 * your program from the dynamic library using SDL_GL_GetProcAddress().
1363 * 1268 *
1364 * \sa SDL_GL_GetProcAddress() 1269 * \sa SDL_GL_GetProcAddress()
1365 * \sa SDL_GL_UnloadLibrary() 1270 * \sa SDL_GL_UnloadLibrary()
1366 */ 1271 */
1367 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); 1272 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
1368 1273
1369 /** 1274 /**
1370 * \fn void *SDL_GL_GetProcAddress(const char *proc) 1275 * \brief Get the address of an OpenGL function.
1371 *
1372 * \brief Get the address of an OpenGL function.
1373 */ 1276 */
1374 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); 1277 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
1375 1278
1376 /** 1279 /**
1377 * \fn void SDL_GL_UnloadLibrary(void) 1280 * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
1378 * 1281 *
1379 * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary() 1282 * \sa SDL_GL_LoadLibrary()
1380 *
1381 * \sa SDL_GL_LoadLibrary()
1382 */ 1283 */
1383 extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); 1284 extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
1384 1285
1385 /** 1286 /**
1386 * \fn SDL_bool SDL_GL_ExtensionSupported(const char *extension) 1287 * \brief Return true if an OpenGL extension is supported for the current
1387 * 1288 * context.
1388 * \brief Return true if an OpenGL extension is supported for the current context.
1389 */ 1289 */
1390 extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char 1290 extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
1391 *extension); 1291 *extension);
1392 1292
1393 /** 1293 /**
1394 * \fn int SDL_GL_SetAttribute(SDL_GLattr attr, int value) 1294 * \brief Set an OpenGL window attribute before window creation.
1395 *
1396 * \brief Set an OpenGL window attribute before window creation.
1397 */ 1295 */
1398 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); 1296 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
1399 1297
1400 /** 1298 /**
1401 * \fn int SDL_GL_GetWindowAttribute(SDL_WindowID windowID, SDL_GLattr attr, int *value) 1299 * \brief Get the actual value for an attribute from the current context.
1402 *
1403 * \brief Get the actual value for an attribute from the current context.
1404 */ 1300 */
1405 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); 1301 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
1406 1302
1407 /** 1303 /**
1408 * \fn SDL_GLContext SDL_GL_CreateContext(SDL_WindowID windowID) 1304 * \brief Create an OpenGL context for use with an OpenGL window, and make it
1409 * 1305 * current.
1410 * \brief Create an OpenGL context for use with an OpenGL window, and make it current. 1306 *
1411 * 1307 * \sa SDL_GL_DeleteContext()
1412 * \sa SDL_GL_DeleteContext()
1413 */ 1308 */
1414 extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID 1309 extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID
1415 windowID); 1310 windowID);
1416 1311
1417 /** 1312 /**
1418 * \fn int SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context) 1313 * \brief Set up an OpenGL context for rendering into an OpenGL window.
1419 * 1314 *
1420 * \brief Set up an OpenGL context for rendering into an OpenGL window. 1315 * \note The context must have been created with a compatible window.
1421 *
1422 * \note The context must have been created with a compatible window.
1423 */ 1316 */
1424 extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID, 1317 extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID,
1425 SDL_GLContext context); 1318 SDL_GLContext context);
1426 1319
1427 /** 1320 /**
1428 * \fn int SDL_GL_SetSwapInterval(int interval) 1321 * \brief Set the swap interval for the current OpenGL context.
1429 * 1322 *
1430 * \brief Set the swap interval for the current OpenGL context. 1323 * \param interval 0 for immediate updates, 1 for updates synchronized with the
1431 * 1324 * vertical retrace.
1432 * \param interval 0 for immediate updates, 1 for updates synchronized with the vertical retrace 1325 *
1433 * 1326 * \return 0 on success, or -1 if setting the swap interval is not supported.
1434 * \return 0 on success, or -1 if setting the swap interval is not supported. 1327 *
1435 * 1328 * \sa SDL_GL_GetSwapInterval()
1436 * \sa SDL_GL_GetSwapInterval()
1437 */ 1329 */
1438 extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); 1330 extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
1439 1331
1440 /** 1332 /**
1441 * \fn int SDL_GL_GetSwapInterval(void) 1333 * \brief Get the swap interval for the current OpenGL context.
1442 * 1334 *
1443 * \brief Get the swap interval for the current OpenGL context. 1335 * \return 0 if there is no vertical retrace synchronization, 1 if the buffer
1444 * 1336 * swap is synchronized with the vertical retrace, and -1 if getting
1445 * \return 0 if there is no vertical retrace synchronization, 1 if the buffer swap is synchronized with the vertical retrace, and -1 if getting the swap interval is not supported. 1337 * the swap interval is not supported.
1446 * 1338 *
1447 * \sa SDL_GL_SetSwapInterval() 1339 * \sa SDL_GL_SetSwapInterval()
1448 */ 1340 */
1449 extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); 1341 extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
1450 1342
1451 /** 1343 /**
1452 * \fn void SDL_GL_SwapWindow(SDL_WindowID windowID) 1344 * \brief Swap the OpenGL buffers for the window, if double-buffering is
1453 * 1345 * supported.
1454 * \brief Swap the OpenGL buffers for the window, if double-buffering is supported.
1455 */ 1346 */
1456 extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_WindowID windowID); 1347 extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_WindowID windowID);
1457 1348
1458 /** 1349 /**
1459 * \fn void SDL_GL_DeleteContext(SDL_GLContext context) 1350 * \brief Delete an OpenGL context.
1460 * 1351 *
1461 * \brief Delete an OpenGL context. 1352 * \sa SDL_GL_CreateContext()
1462 *
1463 * \sa SDL_GL_CreateContext()
1464 */ 1353 */
1465 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); 1354 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
1355
1356 /*@}*//*OpenGL support functions*/
1466 1357
1467 1358
1468 /* Ends C function definitions when using C++ */ 1359 /* Ends C function definitions when using C++ */
1469 #ifdef __cplusplus 1360 #ifdef __cplusplus
1470 /* *INDENT-OFF* */ 1361 /* *INDENT-OFF* */