include/SDL_compat.h
changeset 1895 c121d94672cb
child 1912 8d384b647307
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_compat.h	Mon Jul 10 21:04:37 2006 +0000
     1.3 @@ -0,0 +1,186 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2006 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +
    1.26 +/* This file contains functions for backwards compatibility with SDL 1.2 */
    1.27 +
    1.28 +#ifndef _SDL_compat_h
    1.29 +#define _SDL_compat_h
    1.30 +
    1.31 +#include "SDL_video.h"
    1.32 +#include "SDL_version.h"
    1.33 +
    1.34 +#include "begin_code.h"
    1.35 +/* Set up for C function definitions, even when using C++ */
    1.36 +#ifdef __cplusplus
    1.37 +/* *INDENT-OFF* */
    1.38 +extern "C" {
    1.39 +/* *INDENT-ON* */
    1.40 +#endif
    1.41 +
    1.42 +#define SDL_SWSURFACE       0x00000000
    1.43 +#define SDL_ANYFORMAT       0x00100000
    1.44 +#define SDL_HWPALETTE       0x00200000
    1.45 +#define SDL_DOUBLEBUF       0x00400000
    1.46 +#define SDL_FULLSCREEN      0x00800000
    1.47 +#define SDL_RESIZABLE       0x01000000
    1.48 +#define SDL_NOFRAME         0x02000000
    1.49 +#define SDL_OPENGL          0x04000000
    1.50 +#define SDL_ASYNCBLIT       0x08000000  /* Not used */
    1.51 +#define SDL_HWACCEL         0x08000000  /* Not used */
    1.52 +
    1.53 +#define SDL_APPMOUSEFOCUS	0x01
    1.54 +#define SDL_APPINPUTFOCUS	0x02
    1.55 +#define SDL_APPACTIVE		0x04
    1.56 +
    1.57 +#define SDL_LOGPAL 0x01
    1.58 +#define SDL_PHYSPAL 0x02
    1.59 +
    1.60 +#define SDL_ACTIVEEVENT	SDL_EVENT_RESERVED1
    1.61 +#define SDL_VIDEORESIZE	SDL_EVENT_RESERVED2
    1.62 +#define SDL_VIDEOEXPOSE	SDL_EVENT_RESERVED3
    1.63 +#define SDL_ACTIVEEVENTMASK	SDL_EVENTMASK(SDL_ACTIVEEVENT)
    1.64 +#define SDL_VIDEORESIZEMASK SDL_EVENTMASK(SDL_VIDEORESIZE)
    1.65 +#define SDL_VIDEOEXPOSEMASK SDL_EVENTMASK(SDL_VIDEOEXPOSE)
    1.66 +
    1.67 +#define SDL_BUTTON_WHEELUP	4
    1.68 +#define SDL_BUTTON_WHEELDOWN	5
    1.69 +
    1.70 +typedef struct SDL_VideoInfo
    1.71 +{
    1.72 +    Uint32 hw_available:1;
    1.73 +    Uint32 wm_available:1;
    1.74 +    Uint32 UnusedBits1:6;
    1.75 +    Uint32 UnusedBits2:1;
    1.76 +    Uint32 blit_hw:1;
    1.77 +    Uint32 blit_hw_CC:1;
    1.78 +    Uint32 blit_hw_A:1;
    1.79 +    Uint32 blit_sw:1;
    1.80 +    Uint32 blit_sw_CC:1;
    1.81 +    Uint32 blit_sw_A:1;
    1.82 +    Uint32 blit_fill:1;
    1.83 +    Uint32 UnusedBits3:16;
    1.84 +    Uint32 video_mem;
    1.85 +
    1.86 +    SDL_PixelFormat *vfmt;
    1.87 +} SDL_VideoInfo;
    1.88 +
    1.89 +/* The most common video overlay formats.
    1.90 +   For an explanation of these pixel formats, see:
    1.91 +   http://www.webartz.com/fourcc/indexyuv.htm
    1.92 +
    1.93 +   For information on the relationship between color spaces, see:
    1.94 +   http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
    1.95 + */
    1.96 +#define SDL_YV12_OVERLAY  0x32315659    /* Planar mode: Y + V + U  (3 planes) */
    1.97 +#define SDL_IYUV_OVERLAY  0x56555949    /* Planar mode: Y + U + V  (3 planes) */
    1.98 +#define SDL_YUY2_OVERLAY  0x32595559    /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
    1.99 +#define SDL_UYVY_OVERLAY  0x59565955    /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
   1.100 +#define SDL_YVYU_OVERLAY  0x55595659    /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
   1.101 +
   1.102 +/* The YUV hardware video overlay */
   1.103 +typedef struct SDL_Overlay
   1.104 +{
   1.105 +    Uint32 format;              /* Read-only */
   1.106 +    int w, h;                   /* Read-only */
   1.107 +    int planes;                 /* Read-only */
   1.108 +    Uint16 *pitches;            /* Read-only */
   1.109 +    Uint8 **pixels;             /* Read-write */
   1.110 +
   1.111 +    /* Hardware-specific surface info */
   1.112 +    struct private_yuvhwfuncs *hwfuncs;
   1.113 +    struct private_yuvhwdata *hwdata;
   1.114 +
   1.115 +    /* Special flags */
   1.116 +    Uint32 hw_overlay:1;        /* Flag: This overlay hardware accelerated? */
   1.117 +    Uint32 UnusedBits:31;
   1.118 +} SDL_Overlay;
   1.119 +
   1.120 +typedef enum
   1.121 +{
   1.122 +    SDL_GRAB_QUERY = -1,
   1.123 +    SDL_GRAB_OFF = 0,
   1.124 +    SDL_GRAB_ON = 1
   1.125 +} SDL_GrabMode;
   1.126 +
   1.127 +struct SDL_SysWMinfo;
   1.128 +
   1.129 +#define SDL_SetModuleHandle(x)
   1.130 +#define SDL_AllocSurface    SDL_CreateRGBSurface
   1.131 +
   1.132 +extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
   1.133 +extern DECLSPEC char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
   1.134 +extern DECLSPEC char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
   1.135 +extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo(void);
   1.136 +extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp,
   1.137 +                                            Uint32 flags);
   1.138 +extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(SDL_PixelFormat * format,
   1.139 +                                                 Uint32 flags);
   1.140 +extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width, int height,
   1.141 +                                                      int bpp, Uint32 flags);
   1.142 +extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface(void);
   1.143 +extern DECLSPEC void SDLCALL SDL_UpdateRects(SDL_Surface * screen,
   1.144 +                                             int numrects, SDL_Rect * rects);
   1.145 +extern DECLSPEC void SDLCALL SDL_UpdateRect(SDL_Surface * screen, Sint32 x,
   1.146 +                                            Sint32 y, Uint32 w, Uint32 h);
   1.147 +extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface * screen);
   1.148 +extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormat(SDL_Surface * surface);
   1.149 +extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *
   1.150 +                                                            surface);
   1.151 +extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title,
   1.152 +                                               const char *icon);
   1.153 +extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
   1.154 +extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask);
   1.155 +extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
   1.156 +extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface);
   1.157 +extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
   1.158 +extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface * surface, int flags,
   1.159 +                                           const SDL_Color * colors,
   1.160 +                                           int firstcolor, int ncolors);
   1.161 +extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface * surface,
   1.162 +                                          const SDL_Color * colors,
   1.163 +                                          int firstcolor, int ncolors);
   1.164 +extern DECLSPEC int SDLCALL SDL_GetWMInfo(struct SDL_SysWMinfo *info);
   1.165 +extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
   1.166 +extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
   1.167 +extern DECLSPEC SDL_Overlay *SDLCALL SDL_CreateYUVOverlay(int width,
   1.168 +                                                          int height,
   1.169 +                                                          Uint32 format,
   1.170 +                                                          SDL_Surface *
   1.171 +                                                          display);
   1.172 +extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay * overlay);
   1.173 +extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay * overlay);
   1.174 +extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay * overlay,
   1.175 +                                                  SDL_Rect * dstrect);
   1.176 +extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
   1.177 +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
   1.178 +
   1.179 +/* Ends C function definitions when using C++ */
   1.180 +#ifdef __cplusplus
   1.181 +/* *INDENT-OFF* */
   1.182 +}
   1.183 +/* *INDENT-ON* */
   1.184 +#endif
   1.185 +#include "close_code.h"
   1.186 +
   1.187 +#endif /* _SDL_compat_h */
   1.188 +
   1.189 +/* vi: set ts=4 sw=4 expandtab: */