misc/winutils/include/SDL_video.h
changeset 10017 de822cd3df3a
parent 7809 7d4fb2f35f4f
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    46 /*@}*/
    46 /*@}*/
    47 
    47 
    48 /** @name Useful data types */
    48 /** @name Useful data types */
    49 /*@{*/
    49 /*@{*/
    50 typedef struct SDL_Rect {
    50 typedef struct SDL_Rect {
    51 	Sint16 x, y;
    51     Sint16 x, y;
    52 	Uint16 w, h;
    52     Uint16 w, h;
    53 } SDL_Rect;
    53 } SDL_Rect;
    54 
    54 
    55 typedef struct SDL_Color {
    55 typedef struct SDL_Color {
    56 	Uint8 r;
    56     Uint8 r;
    57 	Uint8 g;
    57     Uint8 g;
    58 	Uint8 b;
    58     Uint8 b;
    59 	Uint8 unused;
    59     Uint8 unused;
    60 } SDL_Color;
    60 } SDL_Color;
    61 #define SDL_Colour SDL_Color
    61 #define SDL_Colour SDL_Color
    62 
    62 
    63 typedef struct SDL_Palette {
    63 typedef struct SDL_Palette {
    64 	int       ncolors;
    64     int       ncolors;
    65 	SDL_Color *colors;
    65     SDL_Color *colors;
    66 } SDL_Palette;
    66 } SDL_Palette;
    67 /*@}*/
    67 /*@}*/
    68 
    68 
    69 /** Everything in the pixel format structure is read-only */
    69 /** Everything in the pixel format structure is read-only */
    70 typedef struct SDL_PixelFormat {
    70 typedef struct SDL_PixelFormat {
    71 	SDL_Palette *palette;
    71     SDL_Palette *palette;
    72 	Uint8  BitsPerPixel;
    72     Uint8  BitsPerPixel;
    73 	Uint8  BytesPerPixel;
    73     Uint8  BytesPerPixel;
    74 	Uint8  Rloss;
    74     Uint8  Rloss;
    75 	Uint8  Gloss;
    75     Uint8  Gloss;
    76 	Uint8  Bloss;
    76     Uint8  Bloss;
    77 	Uint8  Aloss;
    77     Uint8  Aloss;
    78 	Uint8  Rshift;
    78     Uint8  Rshift;
    79 	Uint8  Gshift;
    79     Uint8  Gshift;
    80 	Uint8  Bshift;
    80     Uint8  Bshift;
    81 	Uint8  Ashift;
    81     Uint8  Ashift;
    82 	Uint32 Rmask;
    82     Uint32 Rmask;
    83 	Uint32 Gmask;
    83     Uint32 Gmask;
    84 	Uint32 Bmask;
    84     Uint32 Bmask;
    85 	Uint32 Amask;
    85     Uint32 Amask;
    86 
    86 
    87 	/** RGB color key information */
    87     /** RGB color key information */
    88 	Uint32 colorkey;
    88     Uint32 colorkey;
    89 	/** Alpha value information (per-surface alpha) */
    89     /** Alpha value information (per-surface alpha) */
    90 	Uint8  alpha;
    90     Uint8  alpha;
    91 } SDL_PixelFormat;
    91 } SDL_PixelFormat;
    92 
    92 
    93 /** This structure should be treated as read-only, except for 'pixels',
    93 /** This structure should be treated as read-only, except for 'pixels',
    94  *  which, if not NULL, contains the raw pixel data for the surface.
    94  *  which, if not NULL, contains the raw pixel data for the surface.
    95  */
    95  */
    96 typedef struct SDL_Surface {
    96 typedef struct SDL_Surface {
    97 	Uint32 flags;				/**< Read-only */
    97     Uint32 flags;               /**< Read-only */
    98 	SDL_PixelFormat *format;		/**< Read-only */
    98     SDL_PixelFormat *format;        /**< Read-only */
    99 	int w, h;				/**< Read-only */
    99     int w, h;               /**< Read-only */
   100 	Uint16 pitch;				/**< Read-only */
   100     Uint16 pitch;               /**< Read-only */
   101 	void *pixels;				/**< Read-write */
   101     void *pixels;               /**< Read-write */
   102 	int offset;				/**< Private */
   102     int offset;             /**< Private */
   103 
   103 
   104 	/** Hardware-specific surface info */
   104     /** Hardware-specific surface info */
   105 	struct private_hwdata *hwdata;
   105     struct private_hwdata *hwdata;
   106 
   106 
   107 	/** clipping information */
   107     /** clipping information */
   108 	SDL_Rect clip_rect;			/**< Read-only */
   108     SDL_Rect clip_rect;         /**< Read-only */
   109 	Uint32 unused1;				/**< for binary compatibility */
   109     Uint32 unused1;             /**< for binary compatibility */
   110 
   110 
   111 	/** Allow recursive locks */
   111     /** Allow recursive locks */
   112 	Uint32 locked;				/**< Private */
   112     Uint32 locked;              /**< Private */
   113 
   113 
   114 	/** info for fast blit mapping to other surfaces */
   114     /** info for fast blit mapping to other surfaces */
   115 	struct SDL_BlitMap *map;		/**< Private */
   115     struct SDL_BlitMap *map;        /**< Private */
   116 
   116 
   117 	/** format version, bumped at every change to invalidate blit maps */
   117     /** format version, bumped at every change to invalidate blit maps */
   118 	unsigned int format_version;		/**< Private */
   118     unsigned int format_version;        /**< Private */
   119 
   119 
   120 	/** Reference count -- used when freeing surface */
   120     /** Reference count -- used when freeing surface */
   121 	int refcount;				/**< Read-mostly */
   121     int refcount;               /**< Read-mostly */
   122 } SDL_Surface;
   122 } SDL_Surface;
   123 
   123 
   124 /** @name SDL_Surface Flags
   124 /** @name SDL_Surface Flags
   125  *  These are the currently supported flags for the SDL_surface
   125  *  These are the currently supported flags for the SDL_surface
   126  */
   126  */
   127 /*@{*/
   127 /*@{*/
   128 
   128 
   129 /** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
   129 /** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
   130 /*@{*/
   130 /*@{*/
   131 #define SDL_SWSURFACE	0x00000000	/**< Surface is in system memory */
   131 #define SDL_SWSURFACE   0x00000000  /**< Surface is in system memory */
   132 #define SDL_HWSURFACE	0x00000001	/**< Surface is in video memory */
   132 #define SDL_HWSURFACE   0x00000001  /**< Surface is in video memory */
   133 #define SDL_ASYNCBLIT	0x00000004	/**< Use asynchronous blits if possible */
   133 #define SDL_ASYNCBLIT   0x00000004  /**< Use asynchronous blits if possible */
   134 /*@}*/
   134 /*@}*/
   135 
   135 
   136 /** Available for SDL_SetVideoMode() */
   136 /** Available for SDL_SetVideoMode() */
   137 /*@{*/
   137 /*@{*/
   138 #define SDL_ANYFORMAT	0x10000000	/**< Allow any video depth/pixel-format */
   138 #define SDL_ANYFORMAT   0x10000000  /**< Allow any video depth/pixel-format */
   139 #define SDL_HWPALETTE	0x20000000	/**< Surface has exclusive palette */
   139 #define SDL_HWPALETTE   0x20000000  /**< Surface has exclusive palette */
   140 #define SDL_DOUBLEBUF	0x40000000	/**< Set up double-buffered video mode */
   140 #define SDL_DOUBLEBUF   0x40000000  /**< Set up double-buffered video mode */
   141 #define SDL_FULLSCREEN	0x80000000	/**< Surface is a full screen display */
   141 #define SDL_FULLSCREEN  0x80000000  /**< Surface is a full screen display */
   142 #define SDL_OPENGL      0x00000002      /**< Create an OpenGL rendering context */
   142 #define SDL_OPENGL      0x00000002      /**< Create an OpenGL rendering context */
   143 #define SDL_OPENGLBLIT	0x0000000A	/**< Create an OpenGL rendering context and use it for blitting */
   143 #define SDL_OPENGLBLIT  0x0000000A  /**< Create an OpenGL rendering context and use it for blitting */
   144 #define SDL_RESIZABLE	0x00000010	/**< This video mode may be resized */
   144 #define SDL_RESIZABLE   0x00000010  /**< This video mode may be resized */
   145 #define SDL_NOFRAME	0x00000020	/**< No window caption or edge frame */
   145 #define SDL_NOFRAME 0x00000020  /**< No window caption or edge frame */
   146 /*@}*/
   146 /*@}*/
   147 
   147 
   148 /** Used internally (read-only) */
   148 /** Used internally (read-only) */
   149 /*@{*/
   149 /*@{*/
   150 #define SDL_HWACCEL	0x00000100	/**< Blit uses hardware acceleration */
   150 #define SDL_HWACCEL 0x00000100  /**< Blit uses hardware acceleration */
   151 #define SDL_SRCCOLORKEY	0x00001000	/**< Blit uses a source color key */
   151 #define SDL_SRCCOLORKEY 0x00001000  /**< Blit uses a source color key */
   152 #define SDL_RLEACCELOK	0x00002000	/**< Private flag */
   152 #define SDL_RLEACCELOK  0x00002000  /**< Private flag */
   153 #define SDL_RLEACCEL	0x00004000	/**< Surface is RLE encoded */
   153 #define SDL_RLEACCEL    0x00004000  /**< Surface is RLE encoded */
   154 #define SDL_SRCALPHA	0x00010000	/**< Blit uses source alpha blending */
   154 #define SDL_SRCALPHA    0x00010000  /**< Blit uses source alpha blending */
   155 #define SDL_PREALLOC	0x01000000	/**< Surface uses preallocated memory */
   155 #define SDL_PREALLOC    0x01000000  /**< Surface uses preallocated memory */
   156 /*@}*/
   156 /*@}*/
   157 
   157 
   158 /*@}*/
   158 /*@}*/
   159 
   159 
   160 /** Evaluates to true if the surface needs to be locked before access */
   160 /** Evaluates to true if the surface needs to be locked before access */
   161 #define SDL_MUSTLOCK(surface)	\
   161 #define SDL_MUSTLOCK(surface)   \
   162   (surface->offset ||		\
   162   (surface->offset ||       \
   163   ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
   163   ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
   164 
   164 
   165 /** typedef for private surface blitting functions */
   165 /** typedef for private surface blitting functions */
   166 typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
   166 typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
   167 			struct SDL_Surface *dst, SDL_Rect *dstrect);
   167             struct SDL_Surface *dst, SDL_Rect *dstrect);
   168 
   168 
   169 
   169 
   170 /** Useful for determining the video hardware capabilities */
   170 /** Useful for determining the video hardware capabilities */
   171 typedef struct SDL_VideoInfo {
   171 typedef struct SDL_VideoInfo {
   172 	Uint32 hw_available :1;	/**< Flag: Can you create hardware surfaces? */
   172     Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */
   173 	Uint32 wm_available :1;	/**< Flag: Can you talk to a window manager? */
   173     Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */
   174 	Uint32 UnusedBits1  :6;
   174     Uint32 UnusedBits1  :6;
   175 	Uint32 UnusedBits2  :1;
   175     Uint32 UnusedBits2  :1;
   176 	Uint32 blit_hw      :1;	/**< Flag: Accelerated blits HW --> HW */
   176     Uint32 blit_hw      :1; /**< Flag: Accelerated blits HW --> HW */
   177 	Uint32 blit_hw_CC   :1;	/**< Flag: Accelerated blits with Colorkey */
   177     Uint32 blit_hw_CC   :1; /**< Flag: Accelerated blits with Colorkey */
   178 	Uint32 blit_hw_A    :1;	/**< Flag: Accelerated blits with Alpha */
   178     Uint32 blit_hw_A    :1; /**< Flag: Accelerated blits with Alpha */
   179 	Uint32 blit_sw      :1;	/**< Flag: Accelerated blits SW --> HW */
   179     Uint32 blit_sw      :1; /**< Flag: Accelerated blits SW --> HW */
   180 	Uint32 blit_sw_CC   :1;	/**< Flag: Accelerated blits with Colorkey */
   180     Uint32 blit_sw_CC   :1; /**< Flag: Accelerated blits with Colorkey */
   181 	Uint32 blit_sw_A    :1;	/**< Flag: Accelerated blits with Alpha */
   181     Uint32 blit_sw_A    :1; /**< Flag: Accelerated blits with Alpha */
   182 	Uint32 blit_fill    :1;	/**< Flag: Accelerated color fill */
   182     Uint32 blit_fill    :1; /**< Flag: Accelerated color fill */
   183 	Uint32 UnusedBits3  :16;
   183     Uint32 UnusedBits3  :16;
   184 	Uint32 video_mem;	/**< The total amount of video memory (in K) */
   184     Uint32 video_mem;   /**< The total amount of video memory (in K) */
   185 	SDL_PixelFormat *vfmt;	/**< Value: The format of the video surface */
   185     SDL_PixelFormat *vfmt;  /**< Value: The format of the video surface */
   186 	int    current_w;	/**< Value: The current video mode width */
   186     int    current_w;   /**< Value: The current video mode width */
   187 	int    current_h;	/**< Value: The current video mode height */
   187     int    current_h;   /**< Value: The current video mode height */
   188 } SDL_VideoInfo;
   188 } SDL_VideoInfo;
   189 
   189 
   190 
   190 
   191 /** @name Overlay Formats
   191 /** @name Overlay Formats
   192  *  The most common video overlay formats.
   192  *  The most common video overlay formats.
   193  *  For an explanation of these pixel formats, see:
   193  *  For an explanation of these pixel formats, see:
   194  *	http://www.webartz.com/fourcc/indexyuv.htm
   194  *  http://www.webartz.com/fourcc/indexyuv.htm
   195  *
   195  *
   196  *  For information on the relationship between color spaces, see:
   196  *  For information on the relationship between color spaces, see:
   197  *  http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
   197  *  http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
   198  */
   198  */
   199 /*@{*/
   199 /*@{*/
   200 #define SDL_YV12_OVERLAY  0x32315659	/**< Planar mode: Y + V + U  (3 planes) */
   200 #define SDL_YV12_OVERLAY  0x32315659    /**< Planar mode: Y + V + U  (3 planes) */
   201 #define SDL_IYUV_OVERLAY  0x56555949	/**< Planar mode: Y + U + V  (3 planes) */
   201 #define SDL_IYUV_OVERLAY  0x56555949    /**< Planar mode: Y + U + V  (3 planes) */
   202 #define SDL_YUY2_OVERLAY  0x32595559	/**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
   202 #define SDL_YUY2_OVERLAY  0x32595559    /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
   203 #define SDL_UYVY_OVERLAY  0x59565955	/**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
   203 #define SDL_UYVY_OVERLAY  0x59565955    /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
   204 #define SDL_YVYU_OVERLAY  0x55595659	/**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
   204 #define SDL_YVYU_OVERLAY  0x55595659    /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
   205 /*@}*/
   205 /*@}*/
   206 
   206 
   207 /** The YUV hardware video overlay */
   207 /** The YUV hardware video overlay */
   208 typedef struct SDL_Overlay {
   208 typedef struct SDL_Overlay {
   209 	Uint32 format;				/**< Read-only */
   209     Uint32 format;              /**< Read-only */
   210 	int w, h;				/**< Read-only */
   210     int w, h;               /**< Read-only */
   211 	int planes;				/**< Read-only */
   211     int planes;             /**< Read-only */
   212 	Uint16 *pitches;			/**< Read-only */
   212     Uint16 *pitches;            /**< Read-only */
   213 	Uint8 **pixels;				/**< Read-write */
   213     Uint8 **pixels;             /**< Read-write */
   214 
   214 
   215 	/** @name Hardware-specific surface info */
   215     /** @name Hardware-specific surface info */
   216         /*@{*/
   216         /*@{*/
   217 	struct private_yuvhwfuncs *hwfuncs;
   217     struct private_yuvhwfuncs *hwfuncs;
   218 	struct private_yuvhwdata *hwdata;
   218     struct private_yuvhwdata *hwdata;
   219         /*@{*/
   219         /*@{*/
   220 
   220 
   221 	/** @name Special flags */
   221     /** @name Special flags */
   222         /*@{*/
   222         /*@{*/
   223 	Uint32 hw_overlay :1;	/**< Flag: This overlay hardware accelerated? */
   223     Uint32 hw_overlay :1;   /**< Flag: This overlay hardware accelerated? */
   224 	Uint32 UnusedBits :31;
   224     Uint32 UnusedBits :31;
   225         /*@}*/
   225         /*@}*/
   226 } SDL_Overlay;
   226 } SDL_Overlay;
   227 
   227 
   228 
   228 
   229 /** Public enumeration for setting the OpenGL window attributes. */
   229 /** Public enumeration for setting the OpenGL window attributes. */
   312  */
   312  */
   313 extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
   313 extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
   314 
   314 
   315 /**
   315 /**
   316  * Return a pointer to an array of available screen dimensions for the
   316  * Return a pointer to an array of available screen dimensions for the
   317  * given format and video flags, sorted largest to smallest.  Returns 
   317  * given format and video flags, sorted largest to smallest.  Returns
   318  * NULL if there are no dimensions available for a particular format, 
   318  * NULL if there are no dimensions available for a particular format,
   319  * or (SDL_Rect **)-1 if any dimension is okay for the given format.
   319  * or (SDL_Rect **)-1 if any dimension is okay for the given format.
   320  *
   320  *
   321  * If 'format' is NULL, the mode list will be for the format given 
   321  * If 'format' is NULL, the mode list will be for the format given
   322  * by SDL_GetVideoInfo()->vfmt
   322  * by SDL_GetVideoInfo()->vfmt
   323  */
   323  */
   324 extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
   324 extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
   325 
   325 
   326 /**
   326 /**
   345  * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
   345  * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
   346  * that the colors set by SDL_SetColors() will be the colors you get.
   346  * that the colors set by SDL_SetColors() will be the colors you get.
   347  * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
   347  * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
   348  * of the colors exactly the way they are requested, and you should look
   348  * of the colors exactly the way they are requested, and you should look
   349  * at the video surface structure to determine the actual palette.
   349  * at the video surface structure to determine the actual palette.
   350  * If SDL cannot guarantee that the colors you request can be set, 
   350  * If SDL cannot guarantee that the colors you request can be set,
   351  * i.e. if the colormap is shared, then the video surface may be created
   351  * i.e. if the colormap is shared, then the video surface may be created
   352  * under emulation in system memory, overriding the SDL_HWSURFACE flag.
   352  * under emulation in system memory, overriding the SDL_HWSURFACE flag.
   353  *
   353  *
   354  * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
   354  * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
   355  * a fullscreen video mode.  The default is to create a windowed mode
   355  * a fullscreen video mode.  The default is to create a windowed mode
   356  * if the current graphics system has a window manager.
   356  * if the current graphics system has a window manager.
   357  * If the SDL library is able to set a fullscreen video mode, this flag 
   357  * If the SDL library is able to set a fullscreen video mode, this flag
   358  * will be set in the surface that is returned.
   358  * will be set in the surface that is returned.
   359  *
   359  *
   360  * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
   360  * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
   361  * two surfaces in video memory and swap between them when you call 
   361  * two surfaces in video memory and swap between them when you call
   362  * SDL_Flip().  This is usually slower than the normal single-buffering
   362  * SDL_Flip().  This is usually slower than the normal single-buffering
   363  * scheme, but prevents "tearing" artifacts caused by modifying video 
   363  * scheme, but prevents "tearing" artifacts caused by modifying video
   364  * memory while the monitor is refreshing.  It should only be used by 
   364  * memory while the monitor is refreshing.  It should only be used by
   365  * applications that redraw the entire screen on every update.
   365  * applications that redraw the entire screen on every update.
   366  *
   366  *
   367  * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
   367  * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
   368  * window manager, if any, to resize the window at runtime.  When this
   368  * window manager, if any, to resize the window at runtime.  When this
   369  * occurs, SDL will send a SDL_VIDEORESIZE event to you application,
   369  * occurs, SDL will send a SDL_VIDEORESIZE event to you application,
   380  * flags of the returned surface to make sure that functionality is available.
   380  * flags of the returned surface to make sure that functionality is available.
   381  * SDL will fall back to reduced functionality if the exact flags you wanted
   381  * SDL will fall back to reduced functionality if the exact flags you wanted
   382  * are not available.
   382  * are not available.
   383  */
   383  */
   384 extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
   384 extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
   385 			(int width, int height, int bpp, Uint32 flags);
   385             (int width, int height, int bpp, Uint32 flags);
   386 
   386 
   387 /** @name SDL_Update Functions
   387 /** @name SDL_Update Functions
   388  * These functions should not be called while 'screen' is locked.
   388  * These functions should not be called while 'screen' is locked.
   389  */
   389  */
   390 /*@{*/
   390 /*@{*/
   391 /**
   391 /**
   392  * Makes sure the given list of rectangles is updated on the given screen.
   392  * Makes sure the given list of rectangles is updated on the given screen.
   393  */
   393  */
   394 extern DECLSPEC void SDLCALL SDL_UpdateRects
   394 extern DECLSPEC void SDLCALL SDL_UpdateRects
   395 		(SDL_Surface *screen, int numrects, SDL_Rect *rects);
   395         (SDL_Surface *screen, int numrects, SDL_Rect *rects);
   396 /**
   396 /**
   397  * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
   397  * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
   398  * screen.
   398  * screen.
   399  */
   399  */
   400 extern DECLSPEC void SDLCALL SDL_UpdateRect
   400 extern DECLSPEC void SDLCALL SDL_UpdateRect
   401 		(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
   401         (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
   402 /*@}*/
   402 /*@}*/
   403 
   403 
   404 /**
   404 /**
   405  * On hardware that supports double-buffering, this function sets up a flip
   405  * On hardware that supports double-buffering, this function sets up a flip
   406  * and returns.  The hardware will wait for vertical retrace, and then swap
   406  * and returns.  The hardware will wait for vertical retrace, and then swap
   414 extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
   414 extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
   415 
   415 
   416 /**
   416 /**
   417  * Set the gamma correction for each of the color channels.
   417  * Set the gamma correction for each of the color channels.
   418  * The gamma values range (approximately) between 0.1 and 10.0
   418  * The gamma values range (approximately) between 0.1 and 10.0
   419  * 
   419  *
   420  * If this function isn't supported directly by the hardware, it will
   420  * If this function isn't supported directly by the hardware, it will
   421  * be emulated using gamma ramps, if available.  If successful, this
   421  * be emulated using gamma ramps, if available.  If successful, this
   422  * function returns 0, otherwise it returns -1.
   422  * function returns 0, otherwise it returns -1.
   423  */
   423  */
   424 extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
   424 extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
   427  * Set the gamma translation table for the red, green, and blue channels
   427  * Set the gamma translation table for the red, green, and blue channels
   428  * of the video hardware.  Each table is an array of 256 16-bit quantities,
   428  * of the video hardware.  Each table is an array of 256 16-bit quantities,
   429  * representing a mapping between the input and output for that channel.
   429  * representing a mapping between the input and output for that channel.
   430  * The input is the index into the array, and the output is the 16-bit
   430  * The input is the index into the array, and the output is the 16-bit
   431  * gamma value at that index, scaled to the output color precision.
   431  * gamma value at that index, scaled to the output color precision.
   432  * 
   432  *
   433  * You may pass NULL for any of the channels to leave it unchanged.
   433  * You may pass NULL for any of the channels to leave it unchanged.
   434  * If the call succeeds, it will return 0.  If the display driver or
   434  * If the call succeeds, it will return 0.  If the display driver or
   435  * hardware does not support gamma translation, or otherwise fails,
   435  * hardware does not support gamma translation, or otherwise fails,
   436  * this function will return -1.
   436  * this function will return -1.
   437  */
   437  */
   438 extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
   438 extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
   439 
   439 
   440 /**
   440 /**
   441  * Retrieve the current values of the gamma translation tables.
   441  * Retrieve the current values of the gamma translation tables.
   442  * 
   442  *
   443  * You must pass in valid pointers to arrays of 256 16-bit quantities.
   443  * You must pass in valid pointers to arrays of 256 16-bit quantities.
   444  * Any of the pointers may be NULL to ignore that channel.
   444  * Any of the pointers may be NULL to ignore that channel.
   445  * If the call succeeds, it will return 0.  If the display driver or
   445  * If the call succeeds, it will return 0.  If the display driver or
   446  * hardware does not support gamma translation, or otherwise fails,
   446  * hardware does not support gamma translation, or otherwise fails,
   447  * this function will return -1.
   447  * this function will return -1.
   455  * return 1.  If not all the color entries were set exactly as given,
   455  * return 1.  If not all the color entries were set exactly as given,
   456  * it will return 0, and you should look at the surface palette to
   456  * it will return 0, and you should look at the surface palette to
   457  * determine the actual color palette.
   457  * determine the actual color palette.
   458  *
   458  *
   459  * When 'surface' is the surface associated with the current display, the
   459  * When 'surface' is the surface associated with the current display, the
   460  * display colormap will be updated with the requested colors.  If 
   460  * display colormap will be updated with the requested colors.  If
   461  * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
   461  * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
   462  * will always return 1, and the palette is guaranteed to be set the way
   462  * will always return 1, and the palette is guaranteed to be set the way
   463  * you desire, even if the window colormap has to be warped or run under
   463  * you desire, even if the window colormap has to be warped or run under
   464  * emulation.
   464  * emulation.
   465  */
   465  */
   466 extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, 
   466 extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface,
   467 			SDL_Color *colors, int firstcolor, int ncolors);
   467             SDL_Color *colors, int firstcolor, int ncolors);
   468 
   468 
   469 /**
   469 /**
   470  * Sets a portion of the colormap for a given 8-bit surface.
   470  * Sets a portion of the colormap for a given 8-bit surface.
   471  * 'flags' is one or both of:
   471  * 'flags' is one or both of:
   472  * SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
   472  * SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
   481  *
   481  *
   482  * SDL_SetColors() is equivalent to calling this function with
   482  * SDL_SetColors() is equivalent to calling this function with
   483  *     flags = (SDL_LOGPAL|SDL_PHYSPAL).
   483  *     flags = (SDL_LOGPAL|SDL_PHYSPAL).
   484  */
   484  */
   485 extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
   485 extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
   486 				   SDL_Color *colors, int firstcolor,
   486                    SDL_Color *colors, int firstcolor,
   487 				   int ncolors);
   487                    int ncolors);
   488 
   488 
   489 /**
   489 /**
   490  * Maps an RGB triple to an opaque pixel value for a given pixel format
   490  * Maps an RGB triple to an opaque pixel value for a given pixel format
   491  */
   491  */
   492 extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
   492 extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
   502 
   502 
   503 /**
   503 /**
   504  * Maps a pixel value into the RGB components for a given pixel format
   504  * Maps a pixel value into the RGB components for a given pixel format
   505  */
   505  */
   506 extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
   506 extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
   507 				const SDL_PixelFormat * const fmt,
   507                 const SDL_PixelFormat * const fmt,
   508 				Uint8 *r, Uint8 *g, Uint8 *b);
   508                 Uint8 *r, Uint8 *g, Uint8 *b);
   509 
   509 
   510 /**
   510 /**
   511  * Maps a pixel value into the RGBA components for a given pixel format
   511  * Maps a pixel value into the RGBA components for a given pixel format
   512  */
   512  */
   513 extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
   513 extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
   514 				const SDL_PixelFormat * const fmt,
   514                 const SDL_PixelFormat * const fmt,
   515 				Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
   515                 Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
   516 
   516 
   517 /** @sa SDL_CreateRGBSurface */
   517 /** @sa SDL_CreateRGBSurface */
   518 #define SDL_AllocSurface    SDL_CreateRGBSurface
   518 #define SDL_AllocSurface    SDL_CreateRGBSurface
   519 /**
   519 /**
   520  * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
   520  * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
   535  * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
   535  * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
   536  * If the hardware supports acceleration of colorkey blits between
   536  * If the hardware supports acceleration of colorkey blits between
   537  * two surfaces in video memory, SDL will try to place the surface in
   537  * two surfaces in video memory, SDL will try to place the surface in
   538  * video memory. If this isn't possible or if there is no hardware
   538  * video memory. If this isn't possible or if there is no hardware
   539  * acceleration available, the surface will be placed in system memory.
   539  * acceleration available, the surface will be placed in system memory.
   540  * SDL_SRCALPHA means that the surface will be used for alpha blits and 
   540  * SDL_SRCALPHA means that the surface will be used for alpha blits and
   541  * if the hardware supports hardware acceleration of alpha blits between
   541  * if the hardware supports hardware acceleration of alpha blits between
   542  * two surfaces in video memory, to place the surface in video memory
   542  * two surfaces in video memory, to place the surface in video memory
   543  * if possible, otherwise it will be placed in system memory.
   543  * if possible, otherwise it will be placed in system memory.
   544  * If the surface is created in video memory, blits will be _much_ faster,
   544  * If the surface is created in video memory, blits will be _much_ faster,
   545  * but the surface format must be identical to the video surface format,
   545  * but the surface format must be identical to the video surface format,
   549  * will be set in the flags member of the returned surface.  If for some
   549  * will be set in the flags member of the returned surface.  If for some
   550  * reason the surface could not be placed in video memory, it will not have
   550  * reason the surface could not be placed in video memory, it will not have
   551  * the SDL_HWSURFACE flag set, and will be created in system memory instead.
   551  * the SDL_HWSURFACE flag set, and will be created in system memory instead.
   552  */
   552  */
   553 extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
   553 extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
   554 			(Uint32 flags, int width, int height, int depth, 
   554             (Uint32 flags, int width, int height, int depth,
   555 			Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
   555             Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
   556 /** @sa SDL_CreateRGBSurface */
   556 /** @sa SDL_CreateRGBSurface */
   557 extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
   557 extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
   558 			int width, int height, int depth, int pitch,
   558             int width, int height, int depth, int pitch,
   559 			Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
   559             Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
   560 extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
   560 extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
   561 
   561 
   562 /**
   562 /**
   563  * SDL_LockSurface() sets up a surface for directly accessing the pixels.
   563  * SDL_LockSurface() sets up a surface for directly accessing the pixels.
   564  * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
   564  * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
   565  * to and read from 'surface->pixels', using the pixel format stored in 
   565  * to and read from 'surface->pixels', using the pixel format stored in
   566  * 'surface->format'.  Once you are done accessing the surface, you should 
   566  * 'surface->format'.  Once you are done accessing the surface, you should
   567  * use SDL_UnlockSurface() to release it.
   567  * use SDL_UnlockSurface() to release it.
   568  *
   568  *
   569  * Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
   569  * Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
   570  * to 0, then you can read and write to the surface at any time, and the
   570  * to 0, then you can read and write to the surface at any time, and the
   571  * pixel format of the surface will not change.  In particular, if the
   571  * pixel format of the surface will not change.  In particular, if the
   572  * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
   572  * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
   573  * will not need to lock the display surface before accessing it.
   573  * will not need to lock the display surface before accessing it.
   574  * 
   574  *
   575  * No operating system or library calls should be made between lock/unlock
   575  * No operating system or library calls should be made between lock/unlock
   576  * pairs, as critical system locks may be held during this time.
   576  * pairs, as critical system locks may be held during this time.
   577  *
   577  *
   578  * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
   578  * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
   579  */
   579  */
   587  * The new surface should be freed with SDL_FreeSurface().
   587  * The new surface should be freed with SDL_FreeSurface().
   588  */
   588  */
   589 extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
   589 extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
   590 
   590 
   591 /** Convenience macro -- load a surface from a file */
   591 /** Convenience macro -- load a surface from a file */
   592 #define SDL_LoadBMP(file)	SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
   592 #define SDL_LoadBMP(file)   SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
   593 
   593 
   594 /**
   594 /**
   595  * Save a surface to a seekable SDL data source (memory or file.)
   595  * Save a surface to a seekable SDL data source (memory or file.)
   596  * If 'freedst' is non-zero, the source will be closed after being written.
   596  * If 'freedst' is non-zero, the source will be closed after being written.
   597  * Returns 0 if successful or -1 if there was an error.
   597  * Returns 0 if successful or -1 if there was an error.
   598  */
   598  */
   599 extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
   599 extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
   600 		(SDL_Surface *surface, SDL_RWops *dst, int freedst);
   600         (SDL_Surface *surface, SDL_RWops *dst, int freedst);
   601 
   601 
   602 /** Convenience macro -- save a surface to a file */
   602 /** Convenience macro -- save a surface to a file */
   603 #define SDL_SaveBMP(surface, file) \
   603 #define SDL_SaveBMP(surface, file) \
   604 		SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
   604         SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
   605 
   605 
   606 /**
   606 /**
   607  * Sets the color key (transparent pixel) in a blittable surface.
   607  * Sets the color key (transparent pixel) in a blittable surface.
   608  * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), 
   608  * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
   609  * 'key' will be the transparent pixel in the source image of a blit.
   609  * 'key' will be the transparent pixel in the source image of a blit.
   610  * SDL_RLEACCEL requests RLE acceleration for the surface if present,
   610  * SDL_RLEACCEL requests RLE acceleration for the surface if present,
   611  * and removes RLE acceleration if absent.
   611  * and removes RLE acceleration if absent.
   612  * If 'flag' is 0, this function clears any current color key.
   612  * If 'flag' is 0, this function clears any current color key.
   613  * This function returns 0, or -1 if there was an error.
   613  * This function returns 0, or -1 if there was an error.
   614  */
   614  */
   615 extern DECLSPEC int SDLCALL SDL_SetColorKey
   615 extern DECLSPEC int SDLCALL SDL_SetColorKey
   616 			(SDL_Surface *surface, Uint32 flag, Uint32 key);
   616             (SDL_Surface *surface, Uint32 flag, Uint32 key);
   617 
   617 
   618 /**
   618 /**
   619  * This function sets the alpha value for the entire surface, as opposed to
   619  * This function sets the alpha value for the entire surface, as opposed to
   620  * using the alpha component of each pixel. This value measures the range
   620  * using the alpha component of each pixel. This value measures the range
   621  * of transparency of the surface, 0 being completely transparent to 255
   621  * of transparency of the surface, 0 being completely transparent to 255
   652  * with the correct values.
   652  * with the correct values.
   653  */
   653  */
   654 extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
   654 extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
   655 
   655 
   656 /**
   656 /**
   657  * Creates a new surface of the specified format, and then copies and maps 
   657  * Creates a new surface of the specified format, and then copies and maps
   658  * the given surface to it so the blit of the converted surface will be as 
   658  * the given surface to it so the blit of the converted surface will be as
   659  * fast as possible.  If this function fails, it returns NULL.
   659  * fast as possible.  If this function fails, it returns NULL.
   660  *
   660  *
   661  * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those 
   661  * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
   662  * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
   662  * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
   663  * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
   663  * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
   664  * surface.
   664  * surface.
   665  *
   665  *
   666  * This function is used internally by SDL_DisplayFormat().
   666  * This function is used internally by SDL_DisplayFormat().
   667  */
   667  */
   668 extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
   668 extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
   669 			(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
   669             (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
   670 
   670 
   671 /**
   671 /**
   672  * This performs a fast blit from the source surface to the destination
   672  * This performs a fast blit from the source surface to the destination
   673  * surface.  It assumes that the source and destination rectangles are
   673  * surface.  It assumes that the source and destination rectangles are
   674  * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
   674  * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
   681  * The blit semantics for surfaces with and without alpha and colorkey
   681  * The blit semantics for surfaces with and without alpha and colorkey
   682  * are defined as follows:
   682  * are defined as follows:
   683  *
   683  *
   684  * RGBA->RGB:
   684  * RGBA->RGB:
   685  *     SDL_SRCALPHA set:
   685  *     SDL_SRCALPHA set:
   686  * 	alpha-blend (using alpha-channel).
   686  *  alpha-blend (using alpha-channel).
   687  * 	SDL_SRCCOLORKEY ignored.
   687  *  SDL_SRCCOLORKEY ignored.
   688  *     SDL_SRCALPHA not set:
   688  *     SDL_SRCALPHA not set:
   689  * 	copy RGB.
   689  *  copy RGB.
   690  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   690  *  if SDL_SRCCOLORKEY set, only copy the pixels matching the
   691  * 	RGB values of the source colour key, ignoring alpha in the
   691  *  RGB values of the source colour key, ignoring alpha in the
   692  * 	comparison.
   692  *  comparison.
   693  * 
   693  *
   694  * RGB->RGBA:
   694  * RGB->RGBA:
   695  *     SDL_SRCALPHA set:
   695  *     SDL_SRCALPHA set:
   696  * 	alpha-blend (using the source per-surface alpha value);
   696  *  alpha-blend (using the source per-surface alpha value);
   697  * 	set destination alpha to opaque.
   697  *  set destination alpha to opaque.
   698  *     SDL_SRCALPHA not set:
   698  *     SDL_SRCALPHA not set:
   699  * 	copy RGB, set destination alpha to source per-surface alpha value.
   699  *  copy RGB, set destination alpha to source per-surface alpha value.
   700  *     both:
   700  *     both:
   701  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   701  *  if SDL_SRCCOLORKEY set, only copy the pixels matching the
   702  * 	source colour key.
   702  *  source colour key.
   703  * 
   703  *
   704  * RGBA->RGBA:
   704  * RGBA->RGBA:
   705  *     SDL_SRCALPHA set:
   705  *     SDL_SRCALPHA set:
   706  * 	alpha-blend (using the source alpha channel) the RGB values;
   706  *  alpha-blend (using the source alpha channel) the RGB values;
   707  * 	leave destination alpha untouched. [Note: is this correct?]
   707  *  leave destination alpha untouched. [Note: is this correct?]
   708  * 	SDL_SRCCOLORKEY ignored.
   708  *  SDL_SRCCOLORKEY ignored.
   709  *     SDL_SRCALPHA not set:
   709  *     SDL_SRCALPHA not set:
   710  * 	copy all of RGBA to the destination.
   710  *  copy all of RGBA to the destination.
   711  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   711  *  if SDL_SRCCOLORKEY set, only copy the pixels matching the
   712  * 	RGB values of the source colour key, ignoring alpha in the
   712  *  RGB values of the source colour key, ignoring alpha in the
   713  * 	comparison.
   713  *  comparison.
   714  * 
   714  *
   715  * RGB->RGB: 
   715  * RGB->RGB:
   716  *     SDL_SRCALPHA set:
   716  *     SDL_SRCALPHA set:
   717  * 	alpha-blend (using the source per-surface alpha value).
   717  *  alpha-blend (using the source per-surface alpha value).
   718  *     SDL_SRCALPHA not set:
   718  *     SDL_SRCALPHA not set:
   719  * 	copy RGB.
   719  *  copy RGB.
   720  *     both:
   720  *     both:
   721  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   721  *  if SDL_SRCCOLORKEY set, only copy the pixels matching the
   722  * 	source colour key.
   722  *  source colour key.
   723  *
   723  *
   724  * If either of the surfaces were in video memory, and the blit returns -2,
   724  * If either of the surfaces were in video memory, and the blit returns -2,
   725  * the video memory was lost, so it should be reloaded with artwork and 
   725  * the video memory was lost, so it should be reloaded with artwork and
   726  * re-blitted:
   726  * re-blitted:
   727  * @code
   727  * @code
   728  *	while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
   728  *  while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
   729  *		while ( SDL_LockSurface(image) < 0 )
   729  *      while ( SDL_LockSurface(image) < 0 )
   730  *			Sleep(10);
   730  *          Sleep(10);
   731  *		-- Write image pixels to image->pixels --
   731  *      -- Write image pixels to image->pixels --
   732  *		SDL_UnlockSurface(image);
   732  *      SDL_UnlockSurface(image);
   733  *	}
   733  *  }
   734  * @endcode
   734  * @endcode
   735  *
   735  *
   736  * This happens under DirectX 5.0 when the system switches away from your
   736  * This happens under DirectX 5.0 when the system switches away from your
   737  * fullscreen application.  The lock will also fail until you have access
   737  * fullscreen application.  The lock will also fail until you have access
   738  * to the video memory again.
   738  * to the video memory again.
   744 
   744 
   745 /** This is the public blit function, SDL_BlitSurface(), and it performs
   745 /** This is the public blit function, SDL_BlitSurface(), and it performs
   746  *  rectangle validation and clipping before passing it to SDL_LowerBlit()
   746  *  rectangle validation and clipping before passing it to SDL_LowerBlit()
   747  */
   747  */
   748 extern DECLSPEC int SDLCALL SDL_UpperBlit
   748 extern DECLSPEC int SDLCALL SDL_UpperBlit
   749 			(SDL_Surface *src, SDL_Rect *srcrect,
   749             (SDL_Surface *src, SDL_Rect *srcrect,
   750 			 SDL_Surface *dst, SDL_Rect *dstrect);
   750              SDL_Surface *dst, SDL_Rect *dstrect);
   751 /** This is a semi-private blit function and it performs low-level surface
   751 /** This is a semi-private blit function and it performs low-level surface
   752  *  blitting only.
   752  *  blitting only.
   753  */
   753  */
   754 extern DECLSPEC int SDLCALL SDL_LowerBlit
   754 extern DECLSPEC int SDLCALL SDL_LowerBlit
   755 			(SDL_Surface *src, SDL_Rect *srcrect,
   755             (SDL_Surface *src, SDL_Rect *srcrect,
   756 			 SDL_Surface *dst, SDL_Rect *dstrect);
   756              SDL_Surface *dst, SDL_Rect *dstrect);
   757 
   757 
   758 /**
   758 /**
   759  * This function performs a fast fill of the given rectangle with 'color'
   759  * This function performs a fast fill of the given rectangle with 'color'
   760  * The given rectangle is clipped to the destination surface clip area
   760  * The given rectangle is clipped to the destination surface clip area
   761  * and the final fill rectangle is saved in the passed in pointer.
   761  * and the final fill rectangle is saved in the passed in pointer.
   762  * If 'dstrect' is NULL, the whole surface will be filled with 'color'
   762  * If 'dstrect' is NULL, the whole surface will be filled with 'color'
   763  * The color should be a pixel of the format used by the surface, and 
   763  * The color should be a pixel of the format used by the surface, and
   764  * can be generated by the SDL_MapRGB() function.
   764  * can be generated by the SDL_MapRGB() function.
   765  * This function returns 0 on success, or -1 on error.
   765  * This function returns 0 on success, or -1 on error.
   766  */
   766  */
   767 extern DECLSPEC int SDLCALL SDL_FillRect
   767 extern DECLSPEC int SDLCALL SDL_FillRect
   768 		(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
   768         (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
   769 
   769 
   770 /**
   770 /**
   771  * This function takes a surface and copies it to a new surface of the
   771  * This function takes a surface and copies it to a new surface of the
   772  * pixel format and colors of the video framebuffer, suitable for fast
   772  * pixel format and colors of the video framebuffer, suitable for fast
   773  * blitting onto the display surface.  It calls SDL_ConvertSurface()
   773  * blitting onto the display surface.  It calls SDL_ConvertSurface()
   803  *  Calling the returned surface an overlay is something of a misnomer because
   803  *  Calling the returned surface an overlay is something of a misnomer because
   804  *  the contents of the display surface underneath the area where the overlay
   804  *  the contents of the display surface underneath the area where the overlay
   805  *  is shown is undefined - it may be overwritten with the converted YUV data.
   805  *  is shown is undefined - it may be overwritten with the converted YUV data.
   806  */
   806  */
   807 extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
   807 extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
   808 				Uint32 format, SDL_Surface *display);
   808                 Uint32 format, SDL_Surface *display);
   809 
   809 
   810 /** Lock an overlay for direct access, and unlock it when you are done */
   810 /** Lock an overlay for direct access, and unlock it when you are done */
   811 extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
   811 extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
   812 extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
   812 extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
   813 
   813 
   814 /** Blit a video overlay to the display surface.
   814 /** Blit a video overlay to the display surface.
   815  *  The contents of the video surface underneath the blit destination are
   815  *  The contents of the video surface underneath the blit destination are
   816  *  not defined.  
   816  *  not defined.
   817  *  The width and height of the destination rectangle may be different from
   817  *  The width and height of the destination rectangle may be different from
   818  *  that of the overlay, but currently only 2x scaling is supported.
   818  *  that of the overlay, but currently only 2x scaling is supported.
   819  */
   819  */
   820 extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
   820 extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
   821 
   821 
   906 /**
   906 /**
   907  * Toggle fullscreen mode without changing the contents of the screen.
   907  * Toggle fullscreen mode without changing the contents of the screen.
   908  * If the display surface does not require locking before accessing
   908  * If the display surface does not require locking before accessing
   909  * the pixel information, then the memory pointers will not change.
   909  * the pixel information, then the memory pointers will not change.
   910  *
   910  *
   911  * If this function was able to toggle fullscreen mode (change from 
   911  * If this function was able to toggle fullscreen mode (change from
   912  * running in a window to fullscreen, or vice-versa), it will return 1.
   912  * running in a window to fullscreen, or vice-versa), it will return 1.
   913  * If it is not implemented, or fails, it returns 0.
   913  * If it is not implemented, or fails, it returns 0.
   914  *
   914  *
   915  * The next call to SDL_SetVideoMode() will set the mode fullscreen
   915  * The next call to SDL_SetVideoMode() will set the mode fullscreen
   916  * attribute based on the flags parameter - if SDL_FULLSCREEN is not
   916  * attribute based on the flags parameter - if SDL_FULLSCREEN is not
   919  * This is currently only implemented in the X11 video driver.
   919  * This is currently only implemented in the X11 video driver.
   920  */
   920  */
   921 extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
   921 extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
   922 
   922 
   923 typedef enum {
   923 typedef enum {
   924 	SDL_GRAB_QUERY = -1,
   924     SDL_GRAB_QUERY = -1,
   925 	SDL_GRAB_OFF = 0,
   925     SDL_GRAB_OFF = 0,
   926 	SDL_GRAB_ON = 1,
   926     SDL_GRAB_ON = 1,
   927 	SDL_GRAB_FULLSCREEN	/**< Used internally */
   927     SDL_GRAB_FULLSCREEN /**< Used internally */
   928 } SDL_GrabMode;
   928 } SDL_GrabMode;
   929 /**
   929 /**
   930  * This function allows you to set and query the input grab state of
   930  * This function allows you to set and query the input grab state of
   931  * the application.  It returns the new input grab state.
   931  * the application.  It returns the new input grab state.
   932  *
   932  *
   939 /*@}*/
   939 /*@}*/
   940 
   940 
   941 /** @internal Not in public API at the moment - do not use! */
   941 /** @internal Not in public API at the moment - do not use! */
   942 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
   942 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
   943                                     SDL_Surface *dst, SDL_Rect *dstrect);
   943                                     SDL_Surface *dst, SDL_Rect *dstrect);
   944                     
   944 
   945 /* Ends C function definitions when using C++ */
   945 /* Ends C function definitions when using C++ */
   946 #ifdef __cplusplus
   946 #ifdef __cplusplus
   947 }
   947 }
   948 #endif
   948 #endif
   949 #include "close_code.h"
   949 #include "close_code.h"