1b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* 2b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL - Simple DirectMedia Layer 34458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Copyright (C) 1997-2012 Sam Lantinga 4b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet This library is free software; you can redistribute it and/or 6b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet modify it under the terms of the GNU Lesser General Public 7b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet License as published by the Free Software Foundation; either 8b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet version 2.1 of the License, or (at your option) any later version. 9b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 10b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet This library is distributed in the hope that it will be useful, 11b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet but WITHOUT ANY WARRANTY; without even the implied warranty of 12b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Lesser General Public License for more details. 14b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 15b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet You should have received a copy of the GNU Lesser General Public 16b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet License along with this library; if not, write to the Free Software 17b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 19b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Sam Lantinga 20b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet slouken@libsdl.org 21b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet*/ 22b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 234458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @file SDL_video.h 244458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Header file for access to the SDL raw framebuffer window 254458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 26b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 27b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#ifndef _SDL_video_h 28b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define _SDL_video_h 29b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 30b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "SDL_stdinc.h" 31b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "SDL_error.h" 32b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "SDL_rwops.h" 33b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 34b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "begin_code.h" 35b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* Set up for C function definitions, even when using C++ */ 36b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#ifdef __cplusplus 37b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern "C" { 38b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#endif 39b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 404458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name Transparency definitions 414458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * These define alpha as the opacity of a surface 424458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 434458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 44b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_ALPHA_OPAQUE 255 45b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_ALPHA_TRANSPARENT 0 464458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 47b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 484458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name Useful data types */ 494458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 50b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef struct SDL_Rect { 51b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Sint16 x, y; 52b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint16 w, h; 53b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_Rect; 54b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 55b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef struct SDL_Color { 56b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 r; 57b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 g; 58b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 b; 59b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 unused; 60b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_Color; 61b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_Colour SDL_Color 62b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 63b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef struct SDL_Palette { 64b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet int ncolors; 65b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_Color *colors; 66b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_Palette; 674458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 68b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 694458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Everything in the pixel format structure is read-only */ 70b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef struct SDL_PixelFormat { 71b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_Palette *palette; 72b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 BitsPerPixel; 73b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 BytesPerPixel; 74b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 Rloss; 75b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 Gloss; 76b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 Bloss; 77b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 Aloss; 78b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 Rshift; 79b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 Gshift; 80b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 Bshift; 81b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 Ashift; 82b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 Rmask; 83b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 Gmask; 84b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 Bmask; 85b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 Amask; 86b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 874458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** RGB color key information */ 88b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 colorkey; 894458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** Alpha value information (per-surface alpha) */ 90b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 alpha; 91b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_PixelFormat; 92b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 934458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** This structure should be treated as read-only, except for 'pixels', 944458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * which, if not NULL, contains the raw pixel data for the surface. 954458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 96b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef struct SDL_Surface { 974458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 flags; /**< Read-only */ 984458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall SDL_PixelFormat *format; /**< Read-only */ 994458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall int w, h; /**< Read-only */ 1004458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint16 pitch; /**< Read-only */ 1014458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall void *pixels; /**< Read-write */ 1024458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall int offset; /**< Private */ 1034458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 1044458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** Hardware-specific surface info */ 105b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet struct private_hwdata *hwdata; 106b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1074458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** clipping information */ 1084458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall SDL_Rect clip_rect; /**< Read-only */ 1094458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 unused1; /**< for binary compatibility */ 110b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1114458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** Allow recursive locks */ 1124458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 locked; /**< Private */ 113b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1144458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** info for fast blit mapping to other surfaces */ 1154458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall struct SDL_BlitMap *map; /**< Private */ 116b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1174458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** format version, bumped at every change to invalidate blit maps */ 1184458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall unsigned int format_version; /**< Private */ 119b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1204458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** Reference count -- used when freeing surface */ 1214458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall int refcount; /**< Read-mostly */ 122b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_Surface; 123b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1244458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name SDL_Surface Flags 1254458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * These are the currently supported flags for the SDL_surface 1264458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 1274458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 1284458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 1294458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ 1304458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 1314458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */ 1324458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */ 1334458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */ 1344458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 1354458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 1364458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Available for SDL_SetVideoMode() */ 1374458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 1384458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ 1394458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ 1404458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ 1414458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ 1424458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ 1434458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ 1444458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */ 1454458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */ 1464458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 1474458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 1484458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Used internally (read-only) */ 1494458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 1504458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */ 1514458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */ 1524458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_RLEACCELOK 0x00002000 /**< Private flag */ 1534458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */ 1544458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */ 1554458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */ 1564458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 1574458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 1584458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 1594458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 1604458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Evaluates to true if the surface needs to be locked before access */ 161b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_MUSTLOCK(surface) \ 162b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (surface->offset || \ 163b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) 164b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1654458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** typedef for private surface blitting functions */ 166b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, 167b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet struct SDL_Surface *dst, SDL_Rect *dstrect); 168b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 169b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1704458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Useful for determining the video hardware capabilities */ 171b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef struct SDL_VideoInfo { 1724458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */ 1734458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */ 174b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 UnusedBits1 :6; 175b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 UnusedBits2 :1; 1764458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */ 1774458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */ 1784458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */ 1794458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */ 1804458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */ 1814458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */ 1824458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 blit_fill :1; /**< Flag: Accelerated color fill */ 183b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 UnusedBits3 :16; 1844458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 video_mem; /**< The total amount of video memory (in K) */ 1854458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */ 1864458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall int current_w; /**< Value: The current video mode width */ 1874458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall int current_h; /**< Value: The current video mode height */ 188b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_VideoInfo; 189b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 190b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 1914458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name Overlay Formats 1924458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * The most common video overlay formats. 1934458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * For an explanation of these pixel formats, see: 1944458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * http://www.webartz.com/fourcc/indexyuv.htm 1954458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * 1964458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * For information on the relationship between color spaces, see: 1974458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html 198b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 1994458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 2004458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ 2014458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ 2024458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ 2034458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ 2044458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ 2054458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 206b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 2074458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** The YUV hardware video overlay */ 208b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef struct SDL_Overlay { 2094458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 format; /**< Read-only */ 2104458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall int w, h; /**< Read-only */ 2114458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall int planes; /**< Read-only */ 2124458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint16 *pitches; /**< Read-only */ 2134458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint8 **pixels; /**< Read-write */ 2144458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 2154458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** @name Hardware-specific surface info */ 2164458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /*@{*/ 217b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet struct private_yuvhwfuncs *hwfuncs; 218b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet struct private_yuvhwdata *hwdata; 2194458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /*@{*/ 220b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 2214458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /** @name Special flags */ 2224458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /*@{*/ 2234458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */ 224b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 UnusedBits :31; 2254458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall /*@}*/ 226b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_Overlay; 227b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 228b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 2294458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Public enumeration for setting the OpenGL window attributes. */ 230b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef enum { 231b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_RED_SIZE, 232b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_GREEN_SIZE, 233b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_BLUE_SIZE, 234b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_ALPHA_SIZE, 235b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_BUFFER_SIZE, 236b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_DOUBLEBUFFER, 237b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_DEPTH_SIZE, 238b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_STENCIL_SIZE, 239b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_ACCUM_RED_SIZE, 240b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_ACCUM_GREEN_SIZE, 241b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_ACCUM_BLUE_SIZE, 242b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_ACCUM_ALPHA_SIZE, 243b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_STEREO, 244b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_MULTISAMPLEBUFFERS, 245b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_MULTISAMPLESAMPLES, 246b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_ACCELERATED_VISUAL, 247b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GL_SWAP_CONTROL 248b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_GLattr; 249b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 2504458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name flags for SDL_SetPalette() */ 2514458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 252b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_LOGPAL 0x01 253b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_PHYSPAL 0x02 2544458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 255b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 256b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* Function prototypes */ 257b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 2584458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 2594458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * @name Video Init and Quit 2604458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * These functions are used internally, and should not be used unless you 261b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * have a specific need to specify the video driver you want to use. 262b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * You should normally use SDL_Init() or SDL_InitSubSystem(). 2634458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 2644458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 2654458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 2664458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Initializes the video subsystem. Sets up a connection 267b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * to the window manager, etc, and determines the current video mode and 268b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * pixel format, but does not initialize a window or graphics mode. 269b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Note that event handling is activated by this routine. 270b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 271b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If you use both sound and video in your application, you need to call 272b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, 273b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * you won't be able to set full-screen display modes. 274b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 275b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); 276b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_VideoQuit(void); 2774458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 278b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 2794458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 2804458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * This function fills the given character buffer with the name of the 281b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * video driver, and returns a pointer to it if the video driver has 282b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * been initialized. It returns NULL if no driver has been initialized. 283b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 284b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen); 285b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 2864458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 287b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function returns a pointer to the current display surface. 288b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL is doing format conversion on the display surface, this 289b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * function returns the publicly visible surface, not the real video 290b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * surface. 291b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 292b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); 293b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 2944458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 295b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function returns a read-only pointer to information about the 296b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' 297b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * member of the returned structure will contain the pixel format of the 298b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * "best" video mode. 299b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 300b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); 301b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 3024458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 303b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Check to see if a particular video mode is supported. 304b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * It returns 0 if the requested mode is not supported under any bit depth, 305b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * or returns the bits-per-pixel of the closest available mode with the 306b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * given width and height. If this bits-per-pixel is different from the 307b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * one used when setting the video mode, SDL_SetVideoMode() will succeed, 308b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * but will emulate the requested bits-per-pixel with a shadow surface. 309b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 310b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The arguments to SDL_VideoModeOK() are the same ones you would pass to 311b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SetVideoMode() 312b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 313b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); 314b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 3154458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 316b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Return a pointer to an array of available screen dimensions for the 317b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * given format and video flags, sorted largest to smallest. Returns 318b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * NULL if there are no dimensions available for a particular format, 319b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * or (SDL_Rect **)-1 if any dimension is okay for the given format. 320b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 321b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'format' is NULL, the mode list will be for the format given 322b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * by SDL_GetVideoInfo()->vfmt 323b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 324b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); 325b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 3264458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 327b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Set up a video mode with the specified width, height and bits-per-pixel. 328b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 329b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'bpp' is 0, it is treated as the current display bits per pixel. 330b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 331b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the 332b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * requested bits-per-pixel, but will return whatever video pixel format is 333b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * available. The default is to emulate the requested pixel format if it 334b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * is not natively available. 335b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 336b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in 337b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * video memory, if possible, and you may have to call SDL_LockSurface() 338b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * in order to access the raw framebuffer. Otherwise, the video surface 339b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * will be created in system memory. 340b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 341b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle 342b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * updates asynchronously, but you must always lock before accessing pixels. 343b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL will wait for updates to complete before returning from the lock. 344b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 345b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee 346b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * that the colors set by SDL_SetColors() will be the colors you get. 347b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all 348b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * of the colors exactly the way they are requested, and you should look 349b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * at the video surface structure to determine the actual palette. 350b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL cannot guarantee that the colors you request can be set, 351b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * i.e. if the colormap is shared, then the video surface may be created 352b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * under emulation in system memory, overriding the SDL_HWSURFACE flag. 353b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 354b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set 355b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * a fullscreen video mode. The default is to create a windowed mode 356b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * if the current graphics system has a window manager. 357b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the SDL library is able to set a fullscreen video mode, this flag 358b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * will be set in the surface that is returned. 359b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 360b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up 361b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * two surfaces in video memory and swap between them when you call 362b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_Flip(). This is usually slower than the normal single-buffering 363b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * scheme, but prevents "tearing" artifacts caused by modifying video 364b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * memory while the monitor is refreshing. It should only be used by 365b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * applications that redraw the entire screen on every update. 366b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 367b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the 368b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * window manager, if any, to resize the window at runtime. When this 369b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * occurs, SDL will send a SDL_VIDEORESIZE event to you application, 370b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and you must respond to the event by re-calling SDL_SetVideoMode() 371b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * with the requested size (or another size that suits the application). 372b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 373b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If SDL_NOFRAME is set in 'flags', the SDL library will create a window 374b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * without any title bar or frame decoration. Fullscreen video modes have 375b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * this flag set automatically. 376b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 377b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function returns the video framebuffer surface, or NULL if it fails. 378b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 379b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If you rely on functionality provided by certain video flags, check the 380b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * flags of the returned surface to make sure that functionality is available. 381b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL will fall back to reduced functionality if the exact flags you wanted 382b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * are not available. 383b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 384b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode 385b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (int width, int height, int bpp, Uint32 flags); 386b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 3874458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name SDL_Update Functions 388b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * These functions should not be called while 'screen' is locked. 389b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 3904458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 3914458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 3924458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Makes sure the given list of rectangles is updated on the given screen. 3934458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 394b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_UpdateRects 395b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (SDL_Surface *screen, int numrects, SDL_Rect *rects); 3964458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 3974458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire 3984458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * screen. 3994458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 400b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_UpdateRect 401b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); 4024458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 403b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 4044458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 405b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * On hardware that supports double-buffering, this function sets up a flip 406b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and returns. The hardware will wait for vertical retrace, and then swap 407b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * video buffers before the next video surface blit or lock will return. 408b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * On hardware that doesn not support double-buffering, this is equivalent 409b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); 410b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when 411b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * setting the video mode for this function to perform hardware flipping. 412b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function returns 0 if successful, or -1 if there was an error. 413b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 414b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); 415b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 4164458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 417b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Set the gamma correction for each of the color channels. 418b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The gamma values range (approximately) between 0.1 and 10.0 419b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 420b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If this function isn't supported directly by the hardware, it will 421b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * be emulated using gamma ramps, if available. If successful, this 422b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * function returns 0, otherwise it returns -1. 423b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 424b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); 425b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 4264458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 427b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Set the gamma translation table for the red, green, and blue channels 428b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * of the video hardware. Each table is an array of 256 16-bit quantities, 429b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * representing a mapping between the input and output for that channel. 430b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The input is the index into the array, and the output is the 16-bit 431b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * gamma value at that index, scaled to the output color precision. 432b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 433b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * You may pass NULL for any of the channels to leave it unchanged. 434b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the call succeeds, it will return 0. If the display driver or 435b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * hardware does not support gamma translation, or otherwise fails, 436b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * this function will return -1. 437b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 438b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); 439b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 4404458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 441b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Retrieve the current values of the gamma translation tables. 442b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 443b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * You must pass in valid pointers to arrays of 256 16-bit quantities. 444b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Any of the pointers may be NULL to ignore that channel. 445b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the call succeeds, it will return 0. If the display driver or 446b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * hardware does not support gamma translation, or otherwise fails, 447b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * this function will return -1. 448b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 449b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); 450b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 4514458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 452b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Sets a portion of the colormap for the given 8-bit surface. If 'surface' 453b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * is not a palettized surface, this function does nothing, returning 0. 454b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If all of the colors were set as passed to SDL_SetColors(), it will 455b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * return 1. If not all the color entries were set exactly as given, 456b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * it will return 0, and you should look at the surface palette to 457b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * determine the actual color palette. 458b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 459b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * When 'surface' is the surface associated with the current display, the 460b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * display colormap will be updated with the requested colors. If 461b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() 462b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * will always return 1, and the palette is guaranteed to be set the way 463b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * you desire, even if the window colormap has to be warped or run under 464b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * emulation. 465b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 466b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, 467b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_Color *colors, int firstcolor, int ncolors); 468b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 4694458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 470b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Sets a portion of the colormap for a given 8-bit surface. 471b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 'flags' is one or both of: 472b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_LOGPAL -- set logical palette, which controls how blits are mapped 473b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * to/from the surface, 474b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_PHYSPAL -- set physical palette, which controls how pixels look on 475b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the screen 476b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Only screens have physical palettes. Separate change of physical/logical 477b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * palettes is only possible if the screen has SDL_HWPALETTE set. 478b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 479b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The return value is 1 if all colours could be set as requested, and 0 480b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * otherwise. 481b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 482b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SetColors() is equivalent to calling this function with 483b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * flags = (SDL_LOGPAL|SDL_PHYSPAL). 484b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 485b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags, 486b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_Color *colors, int firstcolor, 487b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet int ncolors); 488b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 4894458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 490b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Maps an RGB triple to an opaque pixel value for a given pixel format 491b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 492b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC Uint32 SDLCALL SDL_MapRGB 493b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet(const SDL_PixelFormat * const format, 494b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet const Uint8 r, const Uint8 g, const Uint8 b); 495b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 4964458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 497b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Maps an RGBA quadruple to a pixel value for a given pixel format 498b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 499b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC Uint32 SDLCALL SDL_MapRGBA 500b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet(const SDL_PixelFormat * const format, 501b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a); 502b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5034458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 504b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Maps a pixel value into the RGB components for a given pixel format 505b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 5064458c4364a99c5d8d124b19eec146b0998c4895aJesse Hallextern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, 5074458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall const SDL_PixelFormat * const fmt, 508b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint8 *r, Uint8 *g, Uint8 *b); 509b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5104458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 511b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Maps a pixel value into the RGBA components for a given pixel format 512b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 5134458c4364a99c5d8d124b19eec146b0998c4895aJesse Hallextern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, 5144458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall const SDL_PixelFormat * const fmt, 5154458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); 516b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5174458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @sa SDL_CreateRGBSurface */ 5184458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall#define SDL_AllocSurface SDL_CreateRGBSurface 5194458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 520b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) 521b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. 522b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the depth is greater than 8 bits, the pixel format is set using the 523b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * flags '[RGB]mask'. 524b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the function runs out of memory, it will return NULL. 525b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 526b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The 'flags' tell what kind of surface to create. 527b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SWSURFACE means that the surface should be created in system memory. 528b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_HWSURFACE means that the surface should be created in video memory, 529b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * with the same format as the display surface. This is useful for surfaces 530b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * that will not change much, to take advantage of hardware acceleration 531b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * when being blitted to the display surface. 532b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with 533b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * this surface, but you must always lock it before accessing the pixels. 534b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL will wait for current blits to finish before returning from the lock. 535b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. 536b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the hardware supports acceleration of colorkey blits between 537b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * two surfaces in video memory, SDL will try to place the surface in 538b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * video memory. If this isn't possible or if there is no hardware 539b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * acceleration available, the surface will be placed in system memory. 540b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA means that the surface will be used for alpha blits and 541b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * if the hardware supports hardware acceleration of alpha blits between 542b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * two surfaces in video memory, to place the surface in video memory 543b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * if possible, otherwise it will be placed in system memory. 544b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the surface is created in video memory, blits will be _much_ faster, 545b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * but the surface format must be identical to the video surface format, 546b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and the only way to access the pixels member of the surface is to use 547b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the SDL_LockSurface() and SDL_UnlockSurface() calls. 548b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the requested surface actually resides in video memory, SDL_HWSURFACE 549b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * will be set in the flags member of the returned surface. If for some 550b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * reason the surface could not be placed in video memory, it will not have 551b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the SDL_HWSURFACE flag set, and will be created in system memory instead. 552b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 553b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface 554b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (Uint32 flags, int width, int height, int depth, 555b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); 5564458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @sa SDL_CreateRGBSurface */ 557b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, 558b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet int width, int height, int depth, int pitch, 559b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); 560b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); 561b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5624458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 563b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_LockSurface() sets up a surface for directly accessing the pixels. 564b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write 565b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * to and read from 'surface->pixels', using the pixel format stored in 566b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 'surface->format'. Once you are done accessing the surface, you should 567b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * use SDL_UnlockSurface() to release it. 568b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 569b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates 570b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * to 0, then you can read and write to the surface at any time, and the 571b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * pixel format of the surface will not change. In particular, if the 572b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you 573b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * will not need to lock the display surface before accessing it. 574b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 575b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * No operating system or library calls should be made between lock/unlock 576b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * pairs, as critical system locks may be held during this time. 577b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 578b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. 579b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 580b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); 581b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); 582b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5834458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 584b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Load a surface from a seekable SDL data source (memory or file.) 585b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'freesrc' is non-zero, the source will be closed after being read. 586b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Returns the new surface, or NULL if there was an error. 587b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The new surface should be freed with SDL_FreeSurface(). 588b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 589b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); 590b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5914458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Convenience macro -- load a surface from a file */ 592b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) 593b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5944458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 595b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Save a surface to a seekable SDL data source (memory or file.) 596b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'freedst' is non-zero, the source will be closed after being written. 597b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Returns 0 if successful or -1 if there was an error. 598b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 599b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_SaveBMP_RW 600b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (SDL_Surface *surface, SDL_RWops *dst, int freedst); 601b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 6024458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Convenience macro -- save a surface to a file */ 603b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_SaveBMP(surface, file) \ 604b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) 605b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 6064458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 607b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Sets the color key (transparent pixel) in a blittable surface. 608b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), 609b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 'key' will be the transparent pixel in the source image of a blit. 610b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_RLEACCEL requests RLE acceleration for the surface if present, 611b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and removes RLE acceleration if absent. 612b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'flag' is 0, this function clears any current color key. 613b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function returns 0, or -1 if there was an error. 614b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 615b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_SetColorKey 616b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (SDL_Surface *surface, Uint32 flag, Uint32 key); 617b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 6184458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 619b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function sets the alpha value for the entire surface, as opposed to 620b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * using the alpha component of each pixel. This value measures the range 621b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * of transparency of the surface, 0 being completely transparent to 255 622b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * being completely opaque. An 'alpha' value of 255 causes blits to be 623b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * opaque, the source pixels copied to the destination (the default). Note 624b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * that per-surface alpha can be combined with colorkey transparency. 625b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 626b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'flag' is 0, alpha blending is disabled for the surface. 627b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. 628b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the 629b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. 630b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 631b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The 'alpha' parameter is ignored for surfaces that have an alpha channel. 632b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 633b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); 634b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 6354458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 636b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Sets the clipping rectangle for the destination surface in a blit. 637b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 638b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the clip rectangle is NULL, clipping will be disabled. 639b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the clip rectangle doesn't intersect the surface, the function will 640b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * return SDL_FALSE and blits will be completely clipped. Otherwise the 641b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * function returns SDL_TRUE and blits to the surface will be clipped to 642b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the intersection of the surface area and the clipping rectangle. 643b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 644b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Note that blits are automatically clipped to the edges of the source 645b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and destination surfaces. 646b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 647b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); 648b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 6494458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 650b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Gets the clipping rectangle for the destination surface in a blit. 651b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 'rect' must be a pointer to a valid rectangle which will be filled 652b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * with the correct values. 653b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 654b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); 655b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 6564458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 657b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Creates a new surface of the specified format, and then copies and maps 658b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the given surface to it so the blit of the converted surface will be as 659b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * fast as possible. If this function fails, it returns NULL. 660b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 661b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those 662b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * semantics. You can also pass SDL_RLEACCEL in the flags parameter and 663b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL will try to RLE accelerate colorkey and alpha blits in the resulting 664b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * surface. 665b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 666b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function is used internally by SDL_DisplayFormat(). 667b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 668b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface 669b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); 670b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 6714458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 672b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This performs a fast blit from the source surface to the destination 673b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * surface. It assumes that the source and destination rectangles are 674b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire 675b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * surface (src or dst) is copied. The final blit rectangles are saved 676b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * in 'srcrect' and 'dstrect' after all clipping is performed. 677b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the blit is successful, it returns 0, otherwise it returns -1. 678b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 679b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The blit function should not be called on a locked surface. 680b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 681b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The blit semantics for surfaces with and without alpha and colorkey 682b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * are defined as follows: 683b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 684b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * RGBA->RGB: 685b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA set: 686b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * alpha-blend (using alpha-channel). 687b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCCOLORKEY ignored. 688b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA not set: 689b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * copy RGB. 690b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * if SDL_SRCCOLORKEY set, only copy the pixels matching the 691b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * RGB values of the source colour key, ignoring alpha in the 692b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * comparison. 693b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 694b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * RGB->RGBA: 695b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA set: 696b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * alpha-blend (using the source per-surface alpha value); 697b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * set destination alpha to opaque. 698b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA not set: 699b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * copy RGB, set destination alpha to source per-surface alpha value. 700b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * both: 701b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * if SDL_SRCCOLORKEY set, only copy the pixels matching the 702b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * source colour key. 703b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 704b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * RGBA->RGBA: 705b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA set: 706b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * alpha-blend (using the source alpha channel) the RGB values; 707b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * leave destination alpha untouched. [Note: is this correct?] 708b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCCOLORKEY ignored. 709b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA not set: 710b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * copy all of RGBA to the destination. 711b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * if SDL_SRCCOLORKEY set, only copy the pixels matching the 712b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * RGB values of the source colour key, ignoring alpha in the 713b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * comparison. 714b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 715b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * RGB->RGB: 716b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA set: 717b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * alpha-blend (using the source per-surface alpha value). 718b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * SDL_SRCALPHA not set: 719b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * copy RGB. 720b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * both: 721b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * if SDL_SRCCOLORKEY set, only copy the pixels matching the 722b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * source colour key. 723b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 724b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If either of the surfaces were in video memory, and the blit returns -2, 725b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the video memory was lost, so it should be reloaded with artwork and 726b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * re-blitted: 7274458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * @code 7284458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { 7294458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * while ( SDL_LockSurface(image) < 0 ) 7304458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Sleep(10); 7314458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * -- Write image pixels to image->pixels -- 7324458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * SDL_UnlockSurface(image); 7334458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * } 7344458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * @endcode 7354458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * 736b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This happens under DirectX 5.0 when the system switches away from your 737b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * fullscreen application. The lock will also fail until you have access 738b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * to the video memory again. 7394458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * 7404458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * You should call SDL_BlitSurface() unless you know exactly how SDL 7414458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * blitting works internally and how to use the other blit functions. 742b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 743b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define SDL_BlitSurface SDL_UpperBlit 744b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 7454458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** This is the public blit function, SDL_BlitSurface(), and it performs 7464458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * rectangle validation and clipping before passing it to SDL_LowerBlit() 7474458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 748b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_UpperBlit 749b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (SDL_Surface *src, SDL_Rect *srcrect, 750b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_Surface *dst, SDL_Rect *dstrect); 7514458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** This is a semi-private blit function and it performs low-level surface 7524458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * blitting only. 7534458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 754b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_LowerBlit 755b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (SDL_Surface *src, SDL_Rect *srcrect, 756b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_Surface *dst, SDL_Rect *dstrect); 757b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 7584458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 759b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function performs a fast fill of the given rectangle with 'color' 760b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The given rectangle is clipped to the destination surface clip area 761b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and the final fill rectangle is saved in the passed in pointer. 762b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'dstrect' is NULL, the whole surface will be filled with 'color' 763b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The color should be a pixel of the format used by the surface, and 764b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * can be generated by the SDL_MapRGB() function. 765b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function returns 0 on success, or -1 on error. 766b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 767b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_FillRect 768b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); 769b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 7704458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 771b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function takes a surface and copies it to a new surface of the 772b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * pixel format and colors of the video framebuffer, suitable for fast 773b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * blitting onto the display surface. It calls SDL_ConvertSurface() 774b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 775b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If you want to take advantage of hardware colorkey or alpha blit 776b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * acceleration, you should set the colorkey and alpha value before 777b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * calling this function. 778b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 779b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the conversion fails or runs out of memory, it returns NULL 780b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 781b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); 782b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 7834458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 784b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function takes a surface and copies it to a new surface of the 785b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * pixel format and colors of the video framebuffer (if possible), 786b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * suitable for fast alpha blitting onto the display surface. 787b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The new surface will always have an alpha channel. 788b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 789b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If you want to take advantage of hardware colorkey or alpha blit 790b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * acceleration, you should set the colorkey and alpha value before 791b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * calling this function. 792b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 793b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the conversion fails or runs out of memory, it returns NULL 794b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 795b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); 796b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 797b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 798b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 7994458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name YUV video surface overlay functions */ /*@{*/ 800b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 801b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8024458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** This function creates a video output overlay 8034458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Calling the returned surface an overlay is something of a misnomer because 8044458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * the contents of the display surface underneath the area where the overlay 8054458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * is shown is undefined - it may be overwritten with the converted YUV data. 8064458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 807b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, 808b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Uint32 format, SDL_Surface *display); 809b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8104458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Lock an overlay for direct access, and unlock it when you are done */ 811b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); 812b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); 813b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8144458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Blit a video overlay to the display surface. 8154458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * The contents of the video surface underneath the blit destination are 8164458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * not defined. 8174458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * The width and height of the destination rectangle may be different from 8184458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * that of the overlay, but currently only 2x scaling is supported. 8194458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 820b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); 821b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8224458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Free a video overlay */ 823b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); 824b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8254458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 826b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 827b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 8284458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name OpenGL support functions. */ /*@{*/ 829b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 830b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8314458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 832b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Dynamically load an OpenGL library, or the default one if path is NULL 833b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 834b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If you do this, you need to retrieve all of the GL functions used in 835b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * your program from the dynamic library using SDL_GL_GetProcAddress(). 836b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 837b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); 838b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8394458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 840b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Get the address of a GL function 841b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 842b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); 843b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8444458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 845b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Set an attribute of the OpenGL subsystem before intialization. 846b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 847b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); 848b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8494458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 850b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Get an attribute of the OpenGL subsystem from the windowing 851b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * interface, such as glX. This is of course different from getting 852b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the values from SDL's internal OpenGL subsystem, which only 853b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * stores the values you request before initialization. 854b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 855b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Developers should track the values they pass into SDL_GL_SetAttribute 856b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * themselves if they want to retrieve these values. 857b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 858b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); 859b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8604458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 861b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Swap the OpenGL buffers, if double-buffering is supported. 862b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 863b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); 864b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8654458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name OpenGL Internal Functions 866b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Internal functions that should not be called unless you have read 867b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and understood the source code for these functions. 868b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 8694458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@{*/ 870b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); 871b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_GL_Lock(void); 872b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_GL_Unlock(void); 8734458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 8744458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 8754458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 876b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 877b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 8784458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @name Window Manager Functions */ 8794458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** These functions allow interaction with the window manager, if any. */ /*@{*/ 880b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 881b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8824458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 8834458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Sets the title and icon text of the display window (UTF-8 encoded) 884b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 885b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon); 8864458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 8874458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Gets the title and icon text of the display window (UTF-8 encoded) 8884458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 889b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); 890b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8914458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 892b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Sets the icon for the display window. 893b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function must be called before the first call to SDL_SetVideoMode(). 894b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * It takes an icon surface, and a mask in MSB format. 895b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If 'mask' is NULL, the entire icon surface will be used as the icon. 896b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 897b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); 898b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 8994458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 900b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function iconifies the window, and returns 1 if it succeeded. 901b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the function succeeds, it generates an SDL_APPACTIVE loss event. 902b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This function is a noop and returns 0 in non-windowed environments. 903b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 904b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); 905b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 9064458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 907b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Toggle fullscreen mode without changing the contents of the screen. 908b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the display surface does not require locking before accessing 909b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * the pixel information, then the memory pointers will not change. 910b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 911b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If this function was able to toggle fullscreen mode (change from 912b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * running in a window to fullscreen, or vice-versa), it will return 1. 913b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If it is not implemented, or fails, it returns 0. 914b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 915b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The next call to SDL_SetVideoMode() will set the mode fullscreen 916b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * attribute based on the flags parameter - if SDL_FULLSCREEN is not 917b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * set, then the display will be windowed by default where supported. 918b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * 919b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * This is currently only implemented in the X11 video driver. 920b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 921b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface); 922b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 923b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohettypedef enum { 924b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GRAB_QUERY = -1, 925b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GRAB_OFF = 0, 926b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_GRAB_ON = 1, 9274458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall SDL_GRAB_FULLSCREEN /**< Used internally */ 928b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} SDL_GrabMode; 9294458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 9304458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * This function allows you to set and query the input grab state of 9314458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * the application. It returns the new input grab state. 9324458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * 933b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * Grabbing means that the mouse is confined to the application window, 934b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and nearly all keyboard input is passed directly to the application, 935b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * and not interpreted by a window manager, if any. 936b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 937b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); 938b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 939b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* 9404458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Move the SDL Window to a specific position. Does nothing in fullscreen mode. 941b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 9424458c4364a99c5d8d124b19eec146b0998c4895aJesse Hallextern DECLSPEC void SDL_WM_SetPos(int x, int y); 943b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 944b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* 9454458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Get the current SDL window position. Returns (0,0) in fullscreen mode. 946b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 9474458c4364a99c5d8d124b19eec146b0998c4895aJesse Hallextern DECLSPEC void SDL_WM_GetPos(int *px, int *py); 948b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 949b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* 950b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * If the window is fully visible, return TRUE; otherwise, recenter the window 951b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * if the 'recenter' parameter is non-0, and return FALSE. 952b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 9534458c4364a99c5d8d124b19eec146b0998c4895aJesse Hallextern DECLSPEC int SDL_WM_IsFullyVisible(int recenter); 9544458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 9554458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/* 9564458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Get the resolution of the main monitor in DPIs, if available. 9574458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Return 0 on success, or -1 if the data is not available. 9584458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 9594458c4364a99c5d8d124b19eec146b0998c4895aJesse Hallextern DECLSPEC int SDL_WM_GetMonitorDPI(int *xDPI, int *yDPI); 9604458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 9614458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/* 9624458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Get the coordinates of the monitor in virtual desktop space. 9634458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * In the case of multi-monitor systems, returns the rectangle of 9644458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * the 'nearest' monitor relative to the main SDL_window. Returns 9654458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * 0 on success, or -1 if the data is not available. 9664458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 9674458c4364a99c5d8d124b19eec146b0998c4895aJesse Hallextern DECLSPEC int SDL_WM_GetMonitorRect(SDL_Rect *rect); 9684458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall 9694458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/*@}*/ 970b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 9714458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @internal Not in public API at the moment - do not use! */ 972b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, 973b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL_Surface *dst, SDL_Rect *dstrect); 974b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 975b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* Ends C function definitions when using C++ */ 976b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#ifdef __cplusplus 977b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} 978b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#endif 979b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "close_code.h" 980b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 981b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#endif /* _SDL_video_h */ 982