include/SDL_compat.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 24 Sep 2006 15:56:55 +0000
changeset 2043 adf732f1f016
parent 2037 6bb97f41ab4b
child 2129 047245361002
permissions -rw-r--r--
Formatting update
slouken@1895
     1
/*
slouken@1895
     2
    SDL - Simple DirectMedia Layer
slouken@1895
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@1895
     4
slouken@1895
     5
    This library is free software; you can redistribute it and/or
slouken@1895
     6
    modify it under the terms of the GNU Lesser General Public
slouken@1895
     7
    License as published by the Free Software Foundation; either
slouken@1895
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@1895
     9
slouken@1895
    10
    This library is distributed in the hope that it will be useful,
slouken@1895
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@1895
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1895
    13
    Lesser General Public License for more details.
slouken@1895
    14
slouken@1895
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1895
    16
    License along with this library; if not, write to the Free Software
slouken@1895
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@1895
    18
slouken@1895
    19
    Sam Lantinga
slouken@1895
    20
    slouken@libsdl.org
slouken@1895
    21
*/
slouken@1895
    22
slouken@1895
    23
/* This file contains functions for backwards compatibility with SDL 1.2 */
slouken@1895
    24
slouken@1895
    25
#ifndef _SDL_compat_h
slouken@1895
    26
#define _SDL_compat_h
slouken@1895
    27
slouken@1895
    28
#include "SDL_video.h"
slouken@1895
    29
#include "SDL_version.h"
slouken@1895
    30
slouken@1895
    31
#include "begin_code.h"
slouken@1895
    32
/* Set up for C function definitions, even when using C++ */
slouken@1895
    33
#ifdef __cplusplus
slouken@1895
    34
/* *INDENT-OFF* */
slouken@1895
    35
extern "C" {
slouken@1895
    36
/* *INDENT-ON* */
slouken@1895
    37
#endif
slouken@1895
    38
slouken@1895
    39
#define SDL_SWSURFACE       0x00000000
slouken@1895
    40
#define SDL_ANYFORMAT       0x00100000
slouken@1895
    41
#define SDL_HWPALETTE       0x00200000
slouken@1895
    42
#define SDL_DOUBLEBUF       0x00400000
slouken@1895
    43
#define SDL_FULLSCREEN      0x00800000
slouken@1895
    44
#define SDL_RESIZABLE       0x01000000
slouken@1895
    45
#define SDL_NOFRAME         0x02000000
slouken@1895
    46
#define SDL_OPENGL          0x04000000
slouken@1895
    47
#define SDL_ASYNCBLIT       0x08000000  /* Not used */
slouken@1895
    48
#define SDL_HWACCEL         0x08000000  /* Not used */
slouken@1895
    49
slouken@1895
    50
#define SDL_APPMOUSEFOCUS	0x01
slouken@1895
    51
#define SDL_APPINPUTFOCUS	0x02
slouken@1895
    52
#define SDL_APPACTIVE		0x04
slouken@1895
    53
slouken@1895
    54
#define SDL_LOGPAL 0x01
slouken@1895
    55
#define SDL_PHYSPAL 0x02
slouken@1895
    56
slouken@1895
    57
#define SDL_ACTIVEEVENT	SDL_EVENT_RESERVED1
slouken@1895
    58
#define SDL_VIDEORESIZE	SDL_EVENT_RESERVED2
slouken@1895
    59
#define SDL_VIDEOEXPOSE	SDL_EVENT_RESERVED3
slouken@1895
    60
#define SDL_ACTIVEEVENTMASK	SDL_EVENTMASK(SDL_ACTIVEEVENT)
slouken@1895
    61
#define SDL_VIDEORESIZEMASK SDL_EVENTMASK(SDL_VIDEORESIZE)
slouken@1895
    62
#define SDL_VIDEOEXPOSEMASK SDL_EVENTMASK(SDL_VIDEOEXPOSE)
slouken@1895
    63
slouken@1895
    64
#define SDL_BUTTON_WHEELUP	4
slouken@1895
    65
#define SDL_BUTTON_WHEELDOWN	5
slouken@1895
    66
slouken@1895
    67
typedef struct SDL_VideoInfo
slouken@1895
    68
{
slouken@1895
    69
    Uint32 hw_available:1;
slouken@1895
    70
    Uint32 wm_available:1;
slouken@1895
    71
    Uint32 UnusedBits1:6;
slouken@1895
    72
    Uint32 UnusedBits2:1;
slouken@1895
    73
    Uint32 blit_hw:1;
slouken@1895
    74
    Uint32 blit_hw_CC:1;
slouken@1895
    75
    Uint32 blit_hw_A:1;
slouken@1895
    76
    Uint32 blit_sw:1;
slouken@1895
    77
    Uint32 blit_sw_CC:1;
slouken@1895
    78
    Uint32 blit_sw_A:1;
slouken@1895
    79
    Uint32 blit_fill:1;
slouken@1895
    80
    Uint32 UnusedBits3:16;
slouken@1895
    81
    Uint32 video_mem;
slouken@1895
    82
slouken@1895
    83
    SDL_PixelFormat *vfmt;
slouken@1895
    84
} SDL_VideoInfo;
slouken@1895
    85
slouken@1895
    86
/* The most common video overlay formats.
slouken@1895
    87
   For an explanation of these pixel formats, see:
slouken@1895
    88
   http://www.webartz.com/fourcc/indexyuv.htm
slouken@1895
    89
slouken@1895
    90
   For information on the relationship between color spaces, see:
slouken@1895
    91
   http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
slouken@1895
    92
 */
slouken@1895
    93
#define SDL_YV12_OVERLAY  0x32315659    /* Planar mode: Y + V + U  (3 planes) */
slouken@1895
    94
#define SDL_IYUV_OVERLAY  0x56555949    /* Planar mode: Y + U + V  (3 planes) */
slouken@1895
    95
#define SDL_YUY2_OVERLAY  0x32595559    /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
slouken@1895
    96
#define SDL_UYVY_OVERLAY  0x59565955    /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
slouken@1895
    97
#define SDL_YVYU_OVERLAY  0x55595659    /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
slouken@1895
    98
slouken@1895
    99
/* The YUV hardware video overlay */
slouken@1895
   100
typedef struct SDL_Overlay
slouken@1895
   101
{
slouken@1895
   102
    Uint32 format;              /* Read-only */
slouken@1895
   103
    int w, h;                   /* Read-only */
slouken@1895
   104
    int planes;                 /* Read-only */
slouken@1895
   105
    Uint16 *pitches;            /* Read-only */
slouken@1895
   106
    Uint8 **pixels;             /* Read-write */
slouken@1895
   107
slouken@1895
   108
    /* Hardware-specific surface info */
slouken@1895
   109
    struct private_yuvhwfuncs *hwfuncs;
slouken@1895
   110
    struct private_yuvhwdata *hwdata;
slouken@1895
   111
slouken@1895
   112
    /* Special flags */
slouken@1895
   113
    Uint32 hw_overlay:1;        /* Flag: This overlay hardware accelerated? */
slouken@1895
   114
    Uint32 UnusedBits:31;
slouken@1895
   115
} SDL_Overlay;
slouken@1895
   116
slouken@1895
   117
typedef enum
slouken@1895
   118
{
slouken@1895
   119
    SDL_GRAB_QUERY = -1,
slouken@1895
   120
    SDL_GRAB_OFF = 0,
slouken@1895
   121
    SDL_GRAB_ON = 1
slouken@1895
   122
} SDL_GrabMode;
slouken@1895
   123
slouken@1895
   124
struct SDL_SysWMinfo;
slouken@1895
   125
slouken@1895
   126
#define SDL_SetModuleHandle(x)
slouken@1895
   127
#define SDL_AllocSurface    SDL_CreateRGBSurface
slouken@1895
   128
slouken@1895
   129
extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
slouken@1895
   130
extern DECLSPEC char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
slouken@1895
   131
extern DECLSPEC char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
slouken@1895
   132
extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo(void);
slouken@1895
   133
extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp,
slouken@1895
   134
                                            Uint32 flags);
slouken@1895
   135
extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(SDL_PixelFormat * format,
slouken@1895
   136
                                                 Uint32 flags);
slouken@1895
   137
extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width, int height,
slouken@1895
   138
                                                      int bpp, Uint32 flags);
slouken@1895
   139
extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface(void);
slouken@1895
   140
extern DECLSPEC void SDLCALL SDL_UpdateRects(SDL_Surface * screen,
slouken@1895
   141
                                             int numrects, SDL_Rect * rects);
slouken@1895
   142
extern DECLSPEC void SDLCALL SDL_UpdateRect(SDL_Surface * screen, Sint32 x,
slouken@1895
   143
                                            Sint32 y, Uint32 w, Uint32 h);
slouken@1895
   144
extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface * screen);
slouken@1895
   145
extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormat(SDL_Surface * surface);
slouken@1895
   146
extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *
slouken@1895
   147
                                                            surface);
slouken@1895
   148
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title,
slouken@1895
   149
                                               const char *icon);
slouken@2043
   150
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(const char **title,
slouken@2043
   151
                                               const char **icon);
slouken@1895
   152
extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask);
slouken@1895
   153
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
slouken@1895
   154
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface);
slouken@1895
   155
extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
slouken@1895
   156
extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface * surface, int flags,
slouken@1895
   157
                                           const SDL_Color * colors,
slouken@1895
   158
                                           int firstcolor, int ncolors);
slouken@1895
   159
extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface * surface,
slouken@1895
   160
                                          const SDL_Color * colors,
slouken@1895
   161
                                          int firstcolor, int ncolors);
slouken@1895
   162
extern DECLSPEC int SDLCALL SDL_GetWMInfo(struct SDL_SysWMinfo *info);
slouken@1895
   163
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
slouken@1895
   164
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
slouken@1895
   165
extern DECLSPEC SDL_Overlay *SDLCALL SDL_CreateYUVOverlay(int width,
slouken@1895
   166
                                                          int height,
slouken@1895
   167
                                                          Uint32 format,
slouken@1895
   168
                                                          SDL_Surface *
slouken@1895
   169
                                                          display);
slouken@1895
   170
extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay * overlay);
slouken@1895
   171
extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay * overlay);
slouken@1895
   172
extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay * overlay,
slouken@1895
   173
                                                  SDL_Rect * dstrect);
slouken@1895
   174
extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
slouken@1912
   175
extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
slouken@1895
   176
slouken@1895
   177
/* Ends C function definitions when using C++ */
slouken@1895
   178
#ifdef __cplusplus
slouken@1895
   179
/* *INDENT-OFF* */
slouken@1895
   180
}
slouken@1895
   181
/* *INDENT-ON* */
slouken@1895
   182
#endif
slouken@1895
   183
#include "close_code.h"
slouken@1895
   184
slouken@1895
   185
#endif /* _SDL_compat_h */
slouken@1895
   186
slouken@1895
   187
/* vi: set ts=4 sw=4 expandtab: */