include/SDL_video.h
changeset 0 74212992fb08
child 47 45b1c4303f87
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_video.h	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,887 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Library General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Library General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Library General Public
    1.19 +    License along with this library; if not, write to the Free
    1.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@devolution.com
    1.24 +*/
    1.25 +
    1.26 +#ifdef SAVE_RCSID
    1.27 +static char rcsid =
    1.28 + "@(#) $Id$";
    1.29 +#endif
    1.30 +
    1.31 +/* Header file for access to the SDL raw framebuffer window */
    1.32 +
    1.33 +#ifndef _SDL_video_h
    1.34 +#define _SDL_video_h
    1.35 +
    1.36 +#include <stdio.h>
    1.37 +
    1.38 +#include "SDL_types.h"
    1.39 +#include "SDL_mutex.h"
    1.40 +#include "SDL_rwops.h"
    1.41 +
    1.42 +#include "begin_code.h"
    1.43 +/* Set up for C function definitions, even when using C++ */
    1.44 +#ifdef __cplusplus
    1.45 +extern "C" {
    1.46 +#endif
    1.47 +
    1.48 +/* Transparency definitions: These define alpha as the opacity of a surface */
    1.49 +#define SDL_ALPHA_OPAQUE 255
    1.50 +#define SDL_ALPHA_TRANSPARENT 0
    1.51 +
    1.52 +/* Useful data types */
    1.53 +typedef struct {
    1.54 +	Sint16 x, y;
    1.55 +	Uint16 w, h;
    1.56 +} SDL_Rect;
    1.57 +
    1.58 +typedef struct {
    1.59 +	Uint8 r;
    1.60 +	Uint8 g;
    1.61 +	Uint8 b;
    1.62 +	Uint8 unused;
    1.63 +} SDL_Color;
    1.64 +
    1.65 +typedef struct {
    1.66 +	int       ncolors;
    1.67 +	SDL_Color *colors;
    1.68 +} SDL_Palette;
    1.69 +
    1.70 +/* Everything in the pixel format structure is read-only */
    1.71 +typedef struct SDL_PixelFormat {
    1.72 +	SDL_Palette *palette;
    1.73 +	Uint8  BitsPerPixel;
    1.74 +	Uint8  BytesPerPixel;
    1.75 +	Uint8  Rloss;
    1.76 +	Uint8  Gloss;
    1.77 +	Uint8  Bloss;
    1.78 +	Uint8  Aloss;
    1.79 +	Uint8  Rshift;
    1.80 +	Uint8  Gshift;
    1.81 +	Uint8  Bshift;
    1.82 +	Uint8  Ashift;
    1.83 +	Uint32 Rmask;
    1.84 +	Uint32 Gmask;
    1.85 +	Uint32 Bmask;
    1.86 +	Uint32 Amask;
    1.87 +
    1.88 +	/* RGB color key information */
    1.89 +	Uint32 colorkey;
    1.90 +	/* Alpha value information (per-surface alpha) */
    1.91 +	Uint8  alpha;
    1.92 +} SDL_PixelFormat;
    1.93 +
    1.94 +/* typedef for private surface blitting functions */
    1.95 +struct SDL_Surface;
    1.96 +typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
    1.97 +			struct SDL_Surface *dst, SDL_Rect *dstrect);
    1.98 +
    1.99 +/* This structure should be treated as read-only, except for 'pixels',
   1.100 +   which, if not NULL, contains the raw pixel data for the surface.
   1.101 +*/
   1.102 +typedef struct SDL_Surface {
   1.103 +	Uint32 flags;				/* Read-only */
   1.104 +	SDL_PixelFormat *format;		/* Read-only */
   1.105 +	int w, h;				/* Read-only */
   1.106 +	Uint16 pitch;				/* Read-only */
   1.107 +	void *pixels;				/* Read-write */
   1.108 +	int offset;				/* Private */
   1.109 +
   1.110 +	/* Hardware-specific surface info */
   1.111 +	struct private_hwdata *hwdata;
   1.112 +
   1.113 +	/* clipping information */
   1.114 +	SDL_Rect clip_rect;			/* Read-only */
   1.115 +	Uint32 unused1;				/* for binary compatibility */
   1.116 +
   1.117 +	/* Allow recursive locks */
   1.118 +	Uint32 locked;				/* Private */
   1.119 +
   1.120 +	/* info for fast blit mapping to other surfaces */
   1.121 +	struct SDL_BlitMap *map;		/* Private */
   1.122 +
   1.123 +	/* format version, bumped at every change to invalidate blit maps */
   1.124 +	unsigned int format_version;		/* Private */
   1.125 +
   1.126 +	/* Reference count -- used when freeing surface */
   1.127 +	int refcount;				/* Read-mostly */
   1.128 +} SDL_Surface;
   1.129 +
   1.130 +/* These are the currently supported flags for the SDL_surface */
   1.131 +/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
   1.132 +#define SDL_SWSURFACE	0x00000000	/* Surface is in system memory */
   1.133 +#define SDL_HWSURFACE	0x00000001	/* Surface is in video memory */
   1.134 +#define SDL_ASYNCBLIT	0x00000004	/* Use asynchronous blits if possible */
   1.135 +/* Available for SDL_SetVideoMode() */
   1.136 +#define SDL_ANYFORMAT	0x10000000	/* Allow any video depth/pixel-format */
   1.137 +#define SDL_HWPALETTE	0x20000000	/* Surface has exclusive palette */
   1.138 +#define SDL_DOUBLEBUF	0x40000000	/* Set up double-buffered video mode */
   1.139 +#define SDL_FULLSCREEN	0x80000000	/* Surface is a full screen display */
   1.140 +#define SDL_OPENGL      0x00000002      /* Create an OpenGL rendering context */
   1.141 +#define SDL_OPENGLBLIT	0x0000000A	/* Create an OpenGL rendering context and use it for blitting */
   1.142 +#define SDL_RESIZABLE	0x00000010	/* This video mode may be resized */
   1.143 +#define SDL_NOFRAME	0x00000020	/* No window caption or edge frame */
   1.144 +/* Used internally (read-only) */
   1.145 +#define SDL_HWACCEL	0x00000100	/* Blit uses hardware acceleration */
   1.146 +#define SDL_SRCCOLORKEY	0x00001000	/* Blit uses a source color key */
   1.147 +#define SDL_RLEACCELOK	0x00002000	/* Private flag */
   1.148 +#define SDL_RLEACCEL	0x00004000	/* Surface is RLE encoded */
   1.149 +#define SDL_SRCALPHA	0x00010000	/* Blit uses source alpha blending */
   1.150 +#define SDL_PREALLOC	0x01000000	/* Surface uses preallocated memory */
   1.151 +
   1.152 +/* Evaluates to true if the surface needs to be locked before access */
   1.153 +#define SDL_MUSTLOCK(surface)	\
   1.154 +  (surface->offset ||		\
   1.155 +  ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
   1.156 +
   1.157 +
   1.158 +/* Useful for determining the video hardware capabilities */
   1.159 +typedef struct {
   1.160 +	Uint32 hw_available :1;	/* Flag: Can you create hardware surfaces? */
   1.161 +	Uint32 wm_available :1;	/* Flag: Can you talk to a window manager? */
   1.162 +	Uint32 UnusedBits1  :6;
   1.163 +	Uint32 UnusedBits2  :1;
   1.164 +	Uint32 blit_hw      :1;	/* Flag: Accelerated blits HW --> HW */
   1.165 +	Uint32 blit_hw_CC   :1;	/* Flag: Accelerated blits with Colorkey */
   1.166 +	Uint32 blit_hw_A    :1;	/* Flag: Accelerated blits with Alpha */
   1.167 +	Uint32 blit_sw      :1;	/* Flag: Accelerated blits SW --> HW */
   1.168 +	Uint32 blit_sw_CC   :1;	/* Flag: Accelerated blits with Colorkey */
   1.169 +	Uint32 blit_sw_A    :1;	/* Flag: Accelerated blits with Alpha */
   1.170 +	Uint32 blit_fill    :1;	/* Flag: Accelerated color fill */
   1.171 +	Uint32 UnusedBits3  :16;
   1.172 +	Uint32 video_mem;	/* The total amount of video memory (in K) */
   1.173 +	SDL_PixelFormat *vfmt;	/* Value: The format of the video surface */
   1.174 +} SDL_VideoInfo;
   1.175 +
   1.176 +
   1.177 +/* The most common video overlay formats.
   1.178 +   For an explanation of these pixel formats, see:
   1.179 +	http://www.webartz.com/fourcc/indexyuv.htm
   1.180 +
   1.181 +   For information on the relationship between color spaces, see:
   1.182 +   http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
   1.183 + */
   1.184 +#define SDL_YV12_OVERLAY  0x32315659	/* Planar mode: Y + V + U  (3 planes) */
   1.185 +#define SDL_IYUV_OVERLAY  0x56555949	/* Planar mode: Y + U + V  (3 planes) */
   1.186 +#define SDL_YUY2_OVERLAY  0x32595559	/* Packed mode: Y0+U0+Y1+V0 (1 plane) */
   1.187 +#define SDL_UYVY_OVERLAY  0x59565955	/* Packed mode: U0+Y0+V0+Y1 (1 plane) */
   1.188 +#define SDL_YVYU_OVERLAY  0x55595659	/* Packed mode: Y0+V0+Y1+U0 (1 plane) */
   1.189 +
   1.190 +/* The YUV hardware video overlay */
   1.191 +typedef struct SDL_Overlay {
   1.192 +	Uint32 format;				/* Read-only */
   1.193 +	int w, h;				/* Read-only */
   1.194 +	int planes;				/* Read-only */
   1.195 +	Uint16 *pitches;			/* Read-only */
   1.196 +	Uint8 **pixels;				/* Read-write */
   1.197 +
   1.198 +	/* Hardware-specific surface info */
   1.199 +	struct private_yuvhwfuncs *hwfuncs;
   1.200 +	struct private_yuvhwdata *hwdata;
   1.201 +
   1.202 +	/* Special flags */
   1.203 +	Uint32 hw_overlay :1;	/* Flag: This overlay hardware accelerated? */
   1.204 +	Uint32 UnusedBits :31;
   1.205 +} SDL_Overlay;
   1.206 +
   1.207 +
   1.208 +/* Public enumeration for setting the OpenGL window attributes. */
   1.209 +typedef enum {
   1.210 +    SDL_GL_RED_SIZE,
   1.211 +    SDL_GL_GREEN_SIZE,
   1.212 +    SDL_GL_BLUE_SIZE,
   1.213 +    SDL_GL_ALPHA_SIZE,
   1.214 +    SDL_GL_BUFFER_SIZE,
   1.215 +    SDL_GL_DOUBLEBUFFER,
   1.216 +    SDL_GL_DEPTH_SIZE,
   1.217 +    SDL_GL_STENCIL_SIZE,
   1.218 +    SDL_GL_ACCUM_RED_SIZE,
   1.219 +    SDL_GL_ACCUM_GREEN_SIZE,
   1.220 +    SDL_GL_ACCUM_BLUE_SIZE,
   1.221 +    SDL_GL_ACCUM_ALPHA_SIZE
   1.222 +} SDL_GLattr;
   1.223 +
   1.224 +/* flags for SDL_SetPalette() */
   1.225 +#define SDL_LOGPAL 0x01
   1.226 +#define SDL_PHYSPAL 0x02
   1.227 +
   1.228 +/* Function prototypes */
   1.229 +
   1.230 +/* These functions are used internally, and should not be used unless you
   1.231 + * have a specific need to specify the video driver you want to use.
   1.232 + * You should normally use SDL_Init() or SDL_InitSubSystem().
   1.233 + *
   1.234 + * SDL_VideoInit() initializes the video subsystem -- sets up a connection
   1.235 + * to the window manager, etc, and determines the current video mode and
   1.236 + * pixel format, but does not initialize a window or graphics mode.
   1.237 + * Note that event handling is activated by this routine.
   1.238 + *
   1.239 + * If you use both sound and video in your application, you need to call
   1.240 + * SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
   1.241 + * you won't be able to set full-screen display modes.
   1.242 + */
   1.243 +extern DECLSPEC int SDL_VideoInit(const char *driver_name, Uint32 flags);
   1.244 +extern DECLSPEC void SDL_VideoQuit(void);
   1.245 +
   1.246 +/* This function fills the given character buffer with the name of the
   1.247 + * video driver, and returns a pointer to it if the video driver has
   1.248 + * been initialized.  It returns NULL if no driver has been initialized.
   1.249 + */
   1.250 +extern DECLSPEC char *SDL_VideoDriverName(char *namebuf, int maxlen);
   1.251 +
   1.252 +/*
   1.253 + * This function returns a pointer to the current display surface.
   1.254 + * If SDL is doing format conversion on the display surface, this
   1.255 + * function returns the publicly visible surface, not the real video
   1.256 + * surface.
   1.257 + */
   1.258 +extern DECLSPEC SDL_Surface * SDL_GetVideoSurface(void);
   1.259 +
   1.260 +/*
   1.261 + * This function returns a read-only pointer to information about the
   1.262 + * video hardware.  If this is called before SDL_SetVideoMode(), the 'vfmt'
   1.263 + * member of the returned structure will contain the pixel format of the
   1.264 + * "best" video mode.
   1.265 + */
   1.266 +extern DECLSPEC const SDL_VideoInfo * SDL_GetVideoInfo(void);
   1.267 +
   1.268 +/* 
   1.269 + * Check to see if a particular video mode is supported.
   1.270 + * It returns 0 if the requested mode is not supported under any bit depth,
   1.271 + * or returns the bits-per-pixel of the closest available mode with the
   1.272 + * given width and height.  If this bits-per-pixel is different from the
   1.273 + * one used when setting the video mode, SDL_SetVideoMode() will succeed,
   1.274 + * but will emulate the requested bits-per-pixel with a shadow surface.
   1.275 + *
   1.276 + * The arguments to SDL_VideoModeOK() are the same ones you would pass to
   1.277 + * SDL_SetVideoMode()
   1.278 + */
   1.279 +extern DECLSPEC int SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
   1.280 +
   1.281 +/*
   1.282 + * Return a pointer to an array of available screen dimensions for the
   1.283 + * given format and video flags, sorted largest to smallest.  Returns 
   1.284 + * NULL if there are no dimensions available for a particular format, 
   1.285 + * or (SDL_Rect **)-1 if any dimension is okay for the given format.
   1.286 + *
   1.287 + * If 'format' is NULL, the mode list will be for the format given 
   1.288 + * by SDL_GetVideoInfo()->vfmt
   1.289 + */
   1.290 +extern DECLSPEC SDL_Rect ** SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
   1.291 +
   1.292 +/*
   1.293 + * Set up a video mode with the specified width, height and bits-per-pixel.
   1.294 + *
   1.295 + * If 'bpp' is 0, it is treated as the current display bits per pixel.
   1.296 + *
   1.297 + * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
   1.298 + * requested bits-per-pixel, but will return whatever video pixel format is
   1.299 + * available.  The default is to emulate the requested pixel format if it
   1.300 + * is not natively available.
   1.301 + *
   1.302 + * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
   1.303 + * video memory, if possible, and you may have to call SDL_LockSurface()
   1.304 + * in order to access the raw framebuffer.  Otherwise, the video surface
   1.305 + * will be created in system memory.
   1.306 + *
   1.307 + * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
   1.308 + * updates asynchronously, but you must always lock before accessing pixels.
   1.309 + * SDL will wait for updates to complete before returning from the lock.
   1.310 + *
   1.311 + * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
   1.312 + * that the colors set by SDL_SetColors() will be the colors you get.
   1.313 + * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
   1.314 + * of the colors exactly the way they are requested, and you should look
   1.315 + * at the video surface structure to determine the actual palette.
   1.316 + * If SDL cannot guarantee that the colors you request can be set, 
   1.317 + * i.e. if the colormap is shared, then the video surface may be created
   1.318 + * under emulation in system memory, overriding the SDL_HWSURFACE flag.
   1.319 + *
   1.320 + * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
   1.321 + * a fullscreen video mode.  The default is to create a windowed mode
   1.322 + * if the current graphics system has a window manager.
   1.323 + * If the SDL library is able to set a fullscreen video mode, this flag 
   1.324 + * will be set in the surface that is returned.
   1.325 + *
   1.326 + * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
   1.327 + * two surfaces in video memory and swap between them when you call 
   1.328 + * SDL_Flip().  This is usually slower than the normal single-buffering
   1.329 + * scheme, but prevents "tearing" artifacts caused by modifying video 
   1.330 + * memory while the monitor is refreshing.  It should only be used by 
   1.331 + * applications that redraw the entire screen on every update.
   1.332 + *
   1.333 + * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
   1.334 + * window manager, if any, to resize the window at runtime.  When this
   1.335 + * occurs, SDL will send a SDL_VIDEORESIZE event to you application,
   1.336 + * and you must respond to the event by re-calling SDL_SetVideoMode()
   1.337 + * with the requested size (or another size that suits the application).
   1.338 + *
   1.339 + * If SDL_NOFRAME is set in 'flags', the SDL library will create a window
   1.340 + * without any title bar or frame decoration.  Fullscreen video modes have
   1.341 + * this flag set automatically.
   1.342 + *
   1.343 + * This function returns the video framebuffer surface, or NULL if it fails.
   1.344 + *
   1.345 + * If you rely on functionality provided by certain video flags, check the
   1.346 + * flags of the returned surface to make sure that functionality is available.
   1.347 + * SDL will fall back to reduced functionality if the exact flags you wanted
   1.348 + * are not available.
   1.349 + */
   1.350 +extern DECLSPEC SDL_Surface *SDL_SetVideoMode
   1.351 +			(int width, int height, int bpp, Uint32 flags);
   1.352 +
   1.353 +/*
   1.354 + * Makes sure the given list of rectangles is updated on the given screen.
   1.355 + * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
   1.356 + * screen.
   1.357 + * These functions should not be called while 'screen' is locked.
   1.358 + */
   1.359 +extern DECLSPEC void SDL_UpdateRects
   1.360 +		(SDL_Surface *screen, int numrects, SDL_Rect *rects);
   1.361 +extern DECLSPEC void SDL_UpdateRect
   1.362 +		(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
   1.363 +
   1.364 +/*
   1.365 + * On hardware that supports double-buffering, this function sets up a flip
   1.366 + * and returns.  The hardware will wait for vertical retrace, and then swap
   1.367 + * video buffers before the next video surface blit or lock will return.
   1.368 + * On hardware that doesn not support double-buffering, this is equivalent
   1.369 + * to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
   1.370 + * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
   1.371 + * setting the video mode for this function to perform hardware flipping.
   1.372 + * This function returns 0 if successful, or -1 if there was an error.
   1.373 + */
   1.374 +extern DECLSPEC int SDL_Flip(SDL_Surface *screen);
   1.375 +
   1.376 +/*
   1.377 + * Set the gamma correction for each of the color channels.
   1.378 + * The gamma values range (approximately) between 0.1 and 10.0
   1.379 + * 
   1.380 + * If this function isn't supported directly by the hardware, it will
   1.381 + * be emulated using gamma ramps, if available.  If successful, this
   1.382 + * function returns 0, otherwise it returns -1.
   1.383 + */
   1.384 +extern DECLSPEC int SDL_SetGamma(float red, float green, float blue);
   1.385 +
   1.386 +/*
   1.387 + * Set the gamma translation table for the red, green, and blue channels
   1.388 + * of the video hardware.  Each table is an array of 256 16-bit quantities,
   1.389 + * representing a mapping between the input and output for that channel.
   1.390 + * The input is the index into the array, and the output is the 16-bit
   1.391 + * gamma value at that index, scaled to the output color precision.
   1.392 + * 
   1.393 + * You may pass NULL for any of the channels to leave it unchanged.
   1.394 + * If the call succeeds, it will return 0.  If the display driver or
   1.395 + * hardware does not support gamma translation, or otherwise fails,
   1.396 + * this function will return -1.
   1.397 + */
   1.398 +extern DECLSPEC int SDL_SetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
   1.399 +
   1.400 +/*
   1.401 + * Retrieve the current values of the gamma translation tables.
   1.402 + * 
   1.403 + * You must pass in valid pointers to arrays of 256 16-bit quantities.
   1.404 + * Any of the pointers may be NULL to ignore that channel.
   1.405 + * If the call succeeds, it will return 0.  If the display driver or
   1.406 + * hardware does not support gamma translation, or otherwise fails,
   1.407 + * this function will return -1.
   1.408 + */
   1.409 +extern DECLSPEC int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
   1.410 +
   1.411 +/*
   1.412 + * Sets a portion of the colormap for the given 8-bit surface.  If 'surface'
   1.413 + * is not a palettized surface, this function does nothing, returning 0.
   1.414 + * If all of the colors were set as passed to SDL_SetColors(), it will
   1.415 + * return 1.  If not all the color entries were set exactly as given,
   1.416 + * it will return 0, and you should look at the surface palette to
   1.417 + * determine the actual color palette.
   1.418 + *
   1.419 + * When 'surface' is the surface associated with the current display, the
   1.420 + * display colormap will be updated with the requested colors.  If 
   1.421 + * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
   1.422 + * will always return 1, and the palette is guaranteed to be set the way
   1.423 + * you desire, even if the window colormap has to be warped or run under
   1.424 + * emulation.
   1.425 + */
   1.426 +extern DECLSPEC int SDL_SetColors(SDL_Surface *surface, 
   1.427 +			SDL_Color *colors, int firstcolor, int ncolors);
   1.428 +
   1.429 +/*
   1.430 + * Sets a portion of the colormap for a given 8-bit surface.
   1.431 + * 'flags' is one or both of:
   1.432 + * SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
   1.433 + *                to/from the surface,
   1.434 + * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
   1.435 + *                the screen
   1.436 + * Only screens have physical palettes. Separate change of physical/logical
   1.437 + * palettes is only possible if the screen has SDL_HWPALETTE set.
   1.438 + *
   1.439 + * The return value is 1 if all colours could be set as requested, and 0
   1.440 + * otherwise.
   1.441 + *
   1.442 + * SDL_SetColors() is equivalent to calling this function with
   1.443 + *     flags = (SDL_LOGPAL|SDL_PHYSPAL).
   1.444 + */
   1.445 +extern DECLSPEC int SDL_SetPalette(SDL_Surface *surface, int flags,
   1.446 +				   SDL_Color *colors, int firstcolor,
   1.447 +				   int ncolors);
   1.448 +
   1.449 +/*
   1.450 + * Maps an RGB triple to an opaque pixel value for a given pixel format
   1.451 + */
   1.452 +extern DECLSPEC Uint32 SDL_MapRGB
   1.453 +			(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b);
   1.454 +
   1.455 +/*
   1.456 + * Maps an RGBA quadruple to a pixel value for a given pixel format
   1.457 + */
   1.458 +extern DECLSPEC Uint32 SDL_MapRGBA(SDL_PixelFormat *format,
   1.459 +				   Uint8 r, Uint8 g, Uint8 b, Uint8 a);
   1.460 +
   1.461 +/*
   1.462 + * Maps a pixel value into the RGB components for a given pixel format
   1.463 + */
   1.464 +extern DECLSPEC void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt,
   1.465 +				Uint8 *r, Uint8 *g, Uint8 *b);
   1.466 +
   1.467 +/*
   1.468 + * Maps a pixel value into the RGBA components for a given pixel format
   1.469 + */
   1.470 +extern DECLSPEC void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt,
   1.471 +				 Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
   1.472 +
   1.473 +/*
   1.474 + * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
   1.475 + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
   1.476 + * If the depth is greater than 8 bits, the pixel format is set using the
   1.477 + * flags '[RGB]mask'.
   1.478 + * If the function runs out of memory, it will return NULL.
   1.479 + *
   1.480 + * The 'flags' tell what kind of surface to create.
   1.481 + * SDL_SWSURFACE means that the surface should be created in system memory.
   1.482 + * SDL_HWSURFACE means that the surface should be created in video memory,
   1.483 + * with the same format as the display surface.  This is useful for surfaces
   1.484 + * that will not change much, to take advantage of hardware acceleration
   1.485 + * when being blitted to the display surface.
   1.486 + * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
   1.487 + * this surface, but you must always lock it before accessing the pixels.
   1.488 + * SDL will wait for current blits to finish before returning from the lock.
   1.489 + * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
   1.490 + * If the hardware supports acceleration of colorkey blits between
   1.491 + * two surfaces in video memory, SDL will try to place the surface in
   1.492 + * video memory. If this isn't possible or if there is no hardware
   1.493 + * acceleration available, the surface will be placed in system memory.
   1.494 + * SDL_SRCALPHA means that the surface will be used for alpha blits and 
   1.495 + * if the hardware supports hardware acceleration of alpha blits between
   1.496 + * two surfaces in video memory, to place the surface in video memory
   1.497 + * if possible, otherwise it will be placed in system memory.
   1.498 + * If the surface is created in video memory, blits will be _much_ faster,
   1.499 + * but the surface format must be identical to the video surface format,
   1.500 + * and the only way to access the pixels member of the surface is to use
   1.501 + * the SDL_LockSurface() and SDL_UnlockSurface() calls.
   1.502 + * If the requested surface actually resides in video memory, SDL_HWSURFACE
   1.503 + * will be set in the flags member of the returned surface.  If for some
   1.504 + * reason the surface could not be placed in video memory, it will not have
   1.505 + * the SDL_HWSURFACE flag set, and will be created in system memory instead.
   1.506 + */
   1.507 +#define SDL_AllocSurface    SDL_CreateRGBSurface
   1.508 +extern DECLSPEC SDL_Surface *SDL_CreateRGBSurface
   1.509 +			(Uint32 flags, int width, int height, int depth, 
   1.510 +			Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
   1.511 +extern DECLSPEC SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels,
   1.512 +			int width, int height, int depth, int pitch,
   1.513 +			Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
   1.514 +extern DECLSPEC void SDL_FreeSurface(SDL_Surface *surface);
   1.515 +
   1.516 +/*
   1.517 + * SDL_LockSurface() sets up a surface for directly accessing the pixels.
   1.518 + * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
   1.519 + * to and read from 'surface->pixels', using the pixel format stored in 
   1.520 + * 'surface->format'.  Once you are done accessing the surface, you should 
   1.521 + * use SDL_UnlockSurface() to release it.
   1.522 + *
   1.523 + * Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
   1.524 + * to 0, then you can read and write to the surface at any time, and the
   1.525 + * pixel format of the surface will not change.  In particular, if the
   1.526 + * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
   1.527 + * will not need to lock the display surface before accessing it.
   1.528 + * 
   1.529 + * No operating system or library calls should be made between lock/unlock
   1.530 + * pairs, as critical system locks may be held during this time.
   1.531 + *
   1.532 + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
   1.533 + */
   1.534 +extern DECLSPEC int SDL_LockSurface(SDL_Surface *surface);
   1.535 +extern DECLSPEC void SDL_UnlockSurface(SDL_Surface *surface);
   1.536 +
   1.537 +/*
   1.538 + * Load a surface from a seekable SDL data source (memory or file.)
   1.539 + * If 'freesrc' is non-zero, the source will be closed after being read.
   1.540 + * Returns the new surface, or NULL if there was an error.
   1.541 + * The new surface should be freed with SDL_FreeSurface().
   1.542 + */
   1.543 +extern DECLSPEC SDL_Surface * SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
   1.544 +
   1.545 +/* Convenience macro -- load a surface from a file */
   1.546 +#define SDL_LoadBMP(file)	SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
   1.547 +
   1.548 +/*
   1.549 + * Save a surface to a seekable SDL data source (memory or file.)
   1.550 + * If 'freedst' is non-zero, the source will be closed after being written.
   1.551 + * Returns 0 if successful or -1 if there was an error.
   1.552 + */
   1.553 +extern DECLSPEC int SDL_SaveBMP_RW
   1.554 +		(SDL_Surface *surface, SDL_RWops *dst, int freedst);
   1.555 +
   1.556 +/* Convenience macro -- save a surface to a file */
   1.557 +#define SDL_SaveBMP(surface, file) \
   1.558 +		SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
   1.559 +
   1.560 +/*
   1.561 + * Sets the color key (transparent pixel) in a blittable surface.
   1.562 + * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), 
   1.563 + * 'key' will be the transparent pixel in the source image of a blit.
   1.564 + * SDL_RLEACCEL requests RLE acceleration for the surface if present,
   1.565 + * and removes RLE acceleration if absent.
   1.566 + * If 'flag' is 0, this function clears any current color key.
   1.567 + * This function returns 0, or -1 if there was an error.
   1.568 + */
   1.569 +extern DECLSPEC int SDL_SetColorKey
   1.570 +			(SDL_Surface *surface, Uint32 flag, Uint32 key);
   1.571 +
   1.572 +/*
   1.573 + * This function sets the alpha value for the entire surface, as opposed to
   1.574 + * using the alpha component of each pixel. This value measures the range
   1.575 + * of transparency of the surface, 0 being completely transparent to 255
   1.576 + * being completely opaque. An 'alpha' value of 255 causes blits to be
   1.577 + * opaque, the source pixels copied to the destination (the default). Note
   1.578 + * that per-surface alpha can be combined with colorkey transparency.
   1.579 + *
   1.580 + * If 'flag' is 0, alpha blending is disabled for the surface.
   1.581 + * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
   1.582 + * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
   1.583 + * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
   1.584 + */
   1.585 +extern DECLSPEC int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
   1.586 +
   1.587 +/*
   1.588 + * Sets the clipping rectangle for the destination surface in a blit.
   1.589 + *
   1.590 + * If the clip rectangle is NULL, clipping will be disabled.
   1.591 + * If the clip rectangle doesn't intersect the surface, the function will
   1.592 + * return SDL_FALSE and blits will be completely clipped.  Otherwise the
   1.593 + * function returns SDL_TRUE and blits to the surface will be clipped to
   1.594 + * the intersection of the surface area and the clipping rectangle.
   1.595 + *
   1.596 + * Note that blits are automatically clipped to the edges of the source
   1.597 + * and destination surfaces.
   1.598 + */
   1.599 +extern DECLSPEC SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect);
   1.600 +
   1.601 +/*
   1.602 + * Gets the clipping rectangle for the destination surface in a blit.
   1.603 + * 'rect' must be a pointer to a valid rectangle which will be filled
   1.604 + * with the correct values.
   1.605 + */
   1.606 +extern DECLSPEC void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
   1.607 +
   1.608 +/*
   1.609 + * Creates a new surface of the specified format, and then copies and maps 
   1.610 + * the given surface to it so the blit of the converted surface will be as 
   1.611 + * fast as possible.  If this function fails, it returns NULL.
   1.612 + *
   1.613 + * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those 
   1.614 + * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
   1.615 + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
   1.616 + * surface.
   1.617 + *
   1.618 + * This function is used internally by SDL_DisplayFormat().
   1.619 + */
   1.620 +extern DECLSPEC SDL_Surface *SDL_ConvertSurface
   1.621 +			(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
   1.622 +
   1.623 +/*
   1.624 + * This performs a fast blit from the source surface to the destination
   1.625 + * surface.  It assumes that the source and destination rectangles are
   1.626 + * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
   1.627 + * surface (src or dst) is copied.  The final blit rectangles are saved
   1.628 + * in 'srcrect' and 'dstrect' after all clipping is performed.
   1.629 + * If the blit is successful, it returns 0, otherwise it returns -1.
   1.630 + *
   1.631 + * The blit function should not be called on a locked surface.
   1.632 + *
   1.633 + * The blit semantics for surfaces with and without alpha and colorkey
   1.634 + * are defined as follows:
   1.635 + *
   1.636 + * RGBA->RGB:
   1.637 + *     SDL_SRCALPHA set:
   1.638 + * 	alpha-blend (using alpha-channel).
   1.639 + * 	SDL_SRCCOLORKEY ignored.
   1.640 + *     SDL_SRCALPHA not set:
   1.641 + * 	copy RGB.
   1.642 + * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   1.643 + * 	RGB values of the source colour key, ignoring alpha in the
   1.644 + * 	comparison.
   1.645 + * 
   1.646 + * RGB->RGBA:
   1.647 + *     SDL_SRCALPHA set:
   1.648 + * 	alpha-blend (using the source per-surface alpha value);
   1.649 + * 	set destination alpha to opaque.
   1.650 + *     SDL_SRCALPHA not set:
   1.651 + * 	copy RGB, set destination alpha to opaque.
   1.652 + *     both:
   1.653 + * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   1.654 + * 	source colour key.
   1.655 + * 
   1.656 + * RGBA->RGBA:
   1.657 + *     SDL_SRCALPHA set:
   1.658 + * 	alpha-blend (using the source alpha channel) the RGB values;
   1.659 + * 	leave destination alpha untouched. [Note: is this correct?]
   1.660 + * 	SDL_SRCCOLORKEY ignored.
   1.661 + *     SDL_SRCALPHA not set:
   1.662 + * 	copy all of RGBA to the destination.
   1.663 + * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   1.664 + * 	RGB values of the source colour key, ignoring alpha in the
   1.665 + * 	comparison.
   1.666 + * 
   1.667 + * RGB->RGB: 
   1.668 + *     SDL_SRCALPHA set:
   1.669 + * 	alpha-blend (using the source per-surface alpha value).
   1.670 + *     SDL_SRCALPHA not set:
   1.671 + * 	copy RGB.
   1.672 + *     both:
   1.673 + * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   1.674 + * 	source colour key.
   1.675 + *
   1.676 + * If either of the surfaces were in video memory, and the blit returns -2,
   1.677 + * the video memory was lost, so it should be reloaded with artwork and 
   1.678 + * re-blitted:
   1.679 +	while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
   1.680 +		while ( SDL_LockSurface(image) < 0 )
   1.681 +			Sleep(10);
   1.682 +		-- Write image pixels to image->pixels --
   1.683 +		SDL_UnlockSurface(image);
   1.684 +	}
   1.685 + * This happens under DirectX 5.0 when the system switches away from your
   1.686 + * fullscreen application.  The lock will also fail until you have access
   1.687 + * to the video memory again.
   1.688 + */
   1.689 +/* You should call SDL_BlitSurface() unless you know exactly how SDL
   1.690 +   blitting works internally and how to use the other blit functions.
   1.691 +*/
   1.692 +#define SDL_BlitSurface SDL_UpperBlit
   1.693 +
   1.694 +/* This is the public blit function, SDL_BlitSurface(), and it performs
   1.695 +   rectangle validation and clipping before passing it to SDL_LowerBlit()
   1.696 +*/
   1.697 +extern DECLSPEC int SDL_UpperBlit
   1.698 +			(SDL_Surface *src, SDL_Rect *srcrect,
   1.699 +			 SDL_Surface *dst, SDL_Rect *dstrect);
   1.700 +/* This is a semi-private blit function and it performs low-level surface
   1.701 +   blitting only.
   1.702 +*/
   1.703 +extern DECLSPEC int SDL_LowerBlit
   1.704 +			(SDL_Surface *src, SDL_Rect *srcrect,
   1.705 +			 SDL_Surface *dst, SDL_Rect *dstrect);
   1.706 +
   1.707 +/*
   1.708 + * This function performs a fast fill of the given rectangle with 'color'
   1.709 + * The given rectangle is clipped to the destination surface clip area
   1.710 + * and the final fill rectangle is saved in the passed in pointer.
   1.711 + * If 'dstrect' is NULL, the whole surface will be filled with 'color'
   1.712 + * The color should be a pixel of the format used by the surface, and 
   1.713 + * can be generated by the SDL_MapRGB() function.
   1.714 + * This function returns 0 on success, or -1 on error.
   1.715 + */
   1.716 +extern DECLSPEC int SDL_FillRect
   1.717 +		(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
   1.718 +
   1.719 +/* 
   1.720 + * This function takes a surface and copies it to a new surface of the
   1.721 + * pixel format and colors of the video framebuffer, suitable for fast
   1.722 + * blitting onto the display surface.  It calls SDL_ConvertSurface()
   1.723 + *
   1.724 + * If you want to take advantage of hardware colorkey or alpha blit
   1.725 + * acceleration, you should set the colorkey and alpha value before
   1.726 + * calling this function.
   1.727 + *
   1.728 + * If the conversion fails or runs out of memory, it returns NULL
   1.729 + */
   1.730 +extern DECLSPEC SDL_Surface * SDL_DisplayFormat(SDL_Surface *surface);
   1.731 +
   1.732 +/* 
   1.733 + * This function takes a surface and copies it to a new surface of the
   1.734 + * pixel format and colors of the video framebuffer (if possible),
   1.735 + * suitable for fast alpha blitting onto the display surface.
   1.736 + * The new surface will always have an alpha channel.
   1.737 + *
   1.738 + * If you want to take advantage of hardware colorkey or alpha blit
   1.739 + * acceleration, you should set the colorkey and alpha value before
   1.740 + * calling this function.
   1.741 + *
   1.742 + * If the conversion fails or runs out of memory, it returns NULL
   1.743 + */
   1.744 +extern DECLSPEC SDL_Surface * SDL_DisplayFormatAlpha(SDL_Surface *surface);
   1.745 +
   1.746 +
   1.747 +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   1.748 +/* YUV video surface overlay functions                                       */
   1.749 +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   1.750 +
   1.751 +/* This function creates a video output overlay
   1.752 +   Calling the returned surface an overlay is something of a misnomer because
   1.753 +   the contents of the display surface underneath the area where the overlay
   1.754 +   is shown is undefined - it may be overwritten with the converted YUV data.
   1.755 +*/
   1.756 +extern DECLSPEC SDL_Overlay *SDL_CreateYUVOverlay(int width, int height,
   1.757 +				Uint32 format, SDL_Surface *display);
   1.758 +
   1.759 +/* Lock an overlay for direct access, and unlock it when you are done */
   1.760 +extern DECLSPEC int SDL_LockYUVOverlay(SDL_Overlay *overlay);
   1.761 +extern DECLSPEC void SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
   1.762 +
   1.763 +/* Blit a video overlay to the display surface.
   1.764 +   The contents of the video surface underneath the blit destination are
   1.765 +   not defined.  
   1.766 +   The width and height of the destination rectangle may be different from
   1.767 +   that of the overlay, but currently only 2x scaling is supported.
   1.768 +*/
   1.769 +extern DECLSPEC int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
   1.770 +
   1.771 +/* Free a video overlay */
   1.772 +extern DECLSPEC void SDL_FreeYUVOverlay(SDL_Overlay *overlay);
   1.773 +
   1.774 +
   1.775 +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   1.776 +/* OpenGL support functions.                                                 */
   1.777 +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   1.778 +
   1.779 +/*
   1.780 + * Dynamically load a GL driver, if SDL is built with dynamic GL.
   1.781 + *
   1.782 + * SDL links normally with the OpenGL library on your system by default,
   1.783 + * but you can compile it to dynamically load the GL driver at runtime.
   1.784 + * If you do this, you need to retrieve all of the GL functions used in
   1.785 + * your program from the dynamic library using SDL_GL_GetProcAddress().
   1.786 + *
   1.787 + * This is disabled in default builds of SDL.
   1.788 + */
   1.789 +extern DECLSPEC int SDL_GL_LoadLibrary(const char *path);
   1.790 +
   1.791 +/*
   1.792 + * Get the address of a GL function (for extension functions)
   1.793 + */
   1.794 +extern DECLSPEC void *SDL_GL_GetProcAddress(const char* proc);
   1.795 +
   1.796 +/*
   1.797 + * Set an attribute of the OpenGL subsystem before intialization.
   1.798 + */
   1.799 +extern DECLSPEC int SDL_GL_SetAttribute(SDL_GLattr attr, int value);
   1.800 +
   1.801 +/*
   1.802 + * Get an attribute of the OpenGL subsystem from the windowing
   1.803 + * interface, such as glX. This is of course different from getting
   1.804 + * the values from SDL's internal OpenGL subsystem, which only
   1.805 + * stores the values you request before initialization.
   1.806 + *
   1.807 + * Developers should track the values they pass into SDL_GL_SetAttribute
   1.808 + * themselves if they want to retrieve these values.
   1.809 + */
   1.810 +extern DECLSPEC int SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
   1.811 +
   1.812 +/*
   1.813 + * Swap the OpenGL buffers, if double-buffering is supported.
   1.814 + */
   1.815 +extern DECLSPEC void SDL_GL_SwapBuffers(void);
   1.816 +
   1.817 +/*
   1.818 + * Internal functions that should not be called unless you have read
   1.819 + * and understood the source code for these functions.
   1.820 + */
   1.821 +extern DECLSPEC void SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
   1.822 +extern DECLSPEC void SDL_GL_Lock(void);
   1.823 +extern DECLSPEC void SDL_GL_Unlock(void);
   1.824 +
   1.825 +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   1.826 +/* These functions allow interaction with the window manager, if any.        */
   1.827 +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   1.828 +
   1.829 +/*
   1.830 + * Sets/Gets the title and icon text of the display window
   1.831 + */
   1.832 +extern DECLSPEC void SDL_WM_SetCaption(const char *title, const char *icon);
   1.833 +extern DECLSPEC void SDL_WM_GetCaption(char **title, char **icon);
   1.834 +
   1.835 +/*
   1.836 + * Sets the icon for the display window.
   1.837 + * This function must be called before the first call to SDL_SetVideoMode().
   1.838 + * It takes an icon surface, and a mask in MSB format.
   1.839 + * If 'mask' is NULL, the entire icon surface will be used as the icon.
   1.840 + */
   1.841 +extern DECLSPEC void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
   1.842 +
   1.843 +/*
   1.844 + * This function iconifies the window, and returns 1 if it succeeded.
   1.845 + * If the function succeeds, it generates an SDL_APPACTIVE loss event.
   1.846 + * This function is a noop and returns 0 in non-windowed environments.
   1.847 + */
   1.848 +extern DECLSPEC int SDL_WM_IconifyWindow(void);
   1.849 +
   1.850 +/*
   1.851 + * Toggle fullscreen mode without changing the contents of the screen.
   1.852 + * If the display surface does not require locking before accessing
   1.853 + * the pixel information, then the memory pointers will not change.
   1.854 + *
   1.855 + * If this function was able to toggle fullscreen mode (change from 
   1.856 + * running in a window to fullscreen, or vice-versa), it will return 1.
   1.857 + * If it is not implemented, or fails, it returns 0.
   1.858 + *
   1.859 + * The next call to SDL_SetVideoMode() will set the mode fullscreen
   1.860 + * attribute based on the flags parameter - if SDL_FULLSCREEN is not
   1.861 + * set, then the display will be windowed by default where supported.
   1.862 + *
   1.863 + * This is currently only implemented in the X11 video driver.
   1.864 + */
   1.865 +extern DECLSPEC int SDL_WM_ToggleFullScreen(SDL_Surface *surface);
   1.866 +
   1.867 +/*
   1.868 + * This function allows you to set and query the input grab state of
   1.869 + * the application.  It returns the new input grab state.
   1.870 + */
   1.871 +typedef enum {
   1.872 +	SDL_GRAB_QUERY = -1,
   1.873 +	SDL_GRAB_OFF = 0,
   1.874 +	SDL_GRAB_ON = 1,
   1.875 +	SDL_GRAB_FULLSCREEN	/* Used internally */
   1.876 +} SDL_GrabMode;
   1.877 +/*
   1.878 + * Grabbing means that the mouse is confined to the application window,
   1.879 + * and nearly all keyboard input is passed directly to the application,
   1.880 + * and not interpreted by a window manager, if any.
   1.881 + */
   1.882 +extern DECLSPEC SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);
   1.883 +
   1.884 +/* Ends C function definitions when using C++ */
   1.885 +#ifdef __cplusplus
   1.886 +}
   1.887 +#endif
   1.888 +#include "close_code.h"
   1.889 +
   1.890 +#endif /* _SDL_video_h */