include/SDL_compat.h
branchSDL-1.3
changeset 1662 782fd950bd46
child 1667 1fddae038bc8
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_compat.h	Sun May 28 13:04:16 2006 +0000
     1.3 @@ -0,0 +1,126 @@
     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_syswm.h"
    1.32 +
    1.33 +#include "begin_code.h"
    1.34 +/* Set up for C function definitions, even when using C++ */
    1.35 +#ifdef __cplusplus
    1.36 +extern "C"
    1.37 +{
    1.38 +#endif
    1.39 +
    1.40 +    extern DECLSPEC char *SDLCALL SDL_AudioDriverName (char *namebuf,
    1.41 +                                                       int maxlen);
    1.42 +    extern DECLSPEC char *SDLCALL SDL_VideoDriverName (char *namebuf,
    1.43 +                                                       int maxlen);
    1.44 +    extern DECLSPEC int SDLCALL SDL_VideoModeOK (int width, int height,
    1.45 +                                                 int bpp, Uint32 flags);
    1.46 +    extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes (SDL_PixelFormat *
    1.47 +                                                      format, Uint32 flags);
    1.48 +    extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode (int width,
    1.49 +                                                           int height,
    1.50 +                                                           int bpp,
    1.51 +                                                           Uint32 flags);
    1.52 +
    1.53 +/* Ends C function definitions when using C++ */
    1.54 +#ifdef __cplusplus
    1.55 +}
    1.56 +#endif
    1.57 +#include "close_code.h"
    1.58 +
    1.59 +#endif                          /* _SDL_compat_h */
    1.60 +
    1.61 +extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface (void);
    1.62 +
    1.63 +/* These are the currently supported flags for the SDL_surface */
    1.64 +/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
    1.65 +#define SDL_SWSURFACE	0x00000000      /* Surface is in system memory */
    1.66 +#define SDL_HWSURFACE	0x00000001      /* Surface is in video memory */
    1.67 +#define SDL_ASYNCBLIT	0x00000004      /* Use asynchronous blits if possible */
    1.68 +/* Available for SDL_SetVideoMode() */
    1.69 +#define SDL_ANYFORMAT	0x10000000      /* Allow any video depth/pixel-format */
    1.70 +#define SDL_HWPALETTE	0x20000000      /* Surface has exclusive palette */
    1.71 +#define SDL_DOUBLEBUF	0x40000000      /* Set up double-buffered video mode */
    1.72 +#define SDL_FULLSCREEN	0x80000000      /* Surface is a full screen display */
    1.73 +#define SDL_OPENGL      0x00000002      /* Create an OpenGL rendering context */
    1.74 +#define SDL_INTERNALOPENGL 0x00000008   /* SDL uses OpenGL internally for this window */
    1.75 +#define SDL_RESIZABLE	0x00000010      /* This video mode may be resized */
    1.76 +#define SDL_NOFRAME	0x00000020      /* No window caption or edge frame */
    1.77 +/* Used internally (read-only) */
    1.78 +#define SDL_HWACCEL	0x00000100      /* Blit uses hardware acceleration */
    1.79 +#define SDL_SRCCOLORKEY	0x00001000      /* Blit uses a source color key */
    1.80 +#define SDL_RLEACCELOK	0x00002000      /* Private flag */
    1.81 +#define SDL_RLEACCEL	0x00004000      /* Surface is RLE encoded */
    1.82 +#define SDL_SRCALPHA	0x00010000      /* Blit uses source alpha blending */
    1.83 +
    1.84 +extern DECLSPEC void SDLCALL SDL_WM_SetCaption (const char *title,
    1.85 +                                                const char *icon);
    1.86 +extern DECLSPEC void SDLCALL SDL_WM_GetCaption (char **title, char **icon);
    1.87 +extern DECLSPEC void SDLCALL SDL_WM_SetIcon (SDL_Surface * icon,
    1.88 +                                             Uint8 * mask);
    1.89 +extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow (void);
    1.90 +extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen (SDL_Surface * surface);
    1.91 +typedef enum
    1.92 +{
    1.93 +    SDL_GRAB_QUERY = -1,
    1.94 +    SDL_GRAB_OFF = 0,
    1.95 +    SDL_GRAB_ON = 1
    1.96 +} SDL_GrabMode;
    1.97 +extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput (SDL_GrabMode mode);
    1.98 +
    1.99 +/* The available application states */
   1.100 +#define SDL_APPMOUSEFOCUS	0x01    /* The app has mouse coverage */
   1.101 +#define SDL_APPINPUTFOCUS	0x02    /* The app has input focus */
   1.102 +#define SDL_APPACTIVE		0x04    /* The application is active */
   1.103 +
   1.104 +extern DECLSPEC Uint8 SDLCALL SDL_GetAppState (void);
   1.105 +extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version (void);
   1.106 +/* flags for SDL_SetPalette() */
   1.107 +#define SDL_LOGPAL 0x01
   1.108 +#define SDL_PHYSPAL 0x02
   1.109 +
   1.110 +/*
   1.111 + * Sets a portion of the colormap for a given 8-bit surface.
   1.112 + * 'flags' is one or both of:
   1.113 + * SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
   1.114 + *                to/from the surface,
   1.115 + * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
   1.116 + *                the screen
   1.117 + * Only screens have physical palettes. Separate change of physical/logical
   1.118 + * palettes is only possible if the screen has SDL_HWPALETTE set.
   1.119 + *
   1.120 + * The return value is 1 if all colours could be set as requested, and 0
   1.121 + * otherwise.
   1.122 + *
   1.123 + * SDL_SetColors() is equivalent to calling this function with
   1.124 + *     flags = (SDL_LOGPAL|SDL_PHYSPAL).
   1.125 + */
   1.126 +extern DECLSPEC int SDLCALL SDL_SetPalette (SDL_Surface * surface, int flags,
   1.127 +                                            SDL_Color * colors,
   1.128 +                                            int firstcolor, int ncolors);
   1.129 +extern DECLSPEC int SDLCALL SDL_GetWMInfo (SDL_SysWMinfo * info);