include/SDL_compat.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 28 May 2006 13:04:16 +0000
branchSDL-1.3
changeset 1662 782fd950bd46
child 1667 1fddae038bc8
permissions -rw-r--r--
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.

WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.

The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce

The headers are being converted to automatically generate doxygen documentation.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2006 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 /* This file contains functions for backwards compatibility with SDL 1.2 */
    24 
    25 #ifndef _SDL_compat_h
    26 #define _SDL_compat_h
    27 
    28 #include "SDL_syswm.h"
    29 
    30 #include "begin_code.h"
    31 /* Set up for C function definitions, even when using C++ */
    32 #ifdef __cplusplus
    33 extern "C"
    34 {
    35 #endif
    36 
    37     extern DECLSPEC char *SDLCALL SDL_AudioDriverName (char *namebuf,
    38                                                        int maxlen);
    39     extern DECLSPEC char *SDLCALL SDL_VideoDriverName (char *namebuf,
    40                                                        int maxlen);
    41     extern DECLSPEC int SDLCALL SDL_VideoModeOK (int width, int height,
    42                                                  int bpp, Uint32 flags);
    43     extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes (SDL_PixelFormat *
    44                                                       format, Uint32 flags);
    45     extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode (int width,
    46                                                            int height,
    47                                                            int bpp,
    48                                                            Uint32 flags);
    49 
    50 /* Ends C function definitions when using C++ */
    51 #ifdef __cplusplus
    52 }
    53 #endif
    54 #include "close_code.h"
    55 
    56 #endif                          /* _SDL_compat_h */
    57 
    58 extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface (void);
    59 
    60 /* These are the currently supported flags for the SDL_surface */
    61 /* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
    62 #define SDL_SWSURFACE	0x00000000      /* Surface is in system memory */
    63 #define SDL_HWSURFACE	0x00000001      /* Surface is in video memory */
    64 #define SDL_ASYNCBLIT	0x00000004      /* Use asynchronous blits if possible */
    65 /* Available for SDL_SetVideoMode() */
    66 #define SDL_ANYFORMAT	0x10000000      /* Allow any video depth/pixel-format */
    67 #define SDL_HWPALETTE	0x20000000      /* Surface has exclusive palette */
    68 #define SDL_DOUBLEBUF	0x40000000      /* Set up double-buffered video mode */
    69 #define SDL_FULLSCREEN	0x80000000      /* Surface is a full screen display */
    70 #define SDL_OPENGL      0x00000002      /* Create an OpenGL rendering context */
    71 #define SDL_INTERNALOPENGL 0x00000008   /* SDL uses OpenGL internally for this window */
    72 #define SDL_RESIZABLE	0x00000010      /* This video mode may be resized */
    73 #define SDL_NOFRAME	0x00000020      /* No window caption or edge frame */
    74 /* Used internally (read-only) */
    75 #define SDL_HWACCEL	0x00000100      /* Blit uses hardware acceleration */
    76 #define SDL_SRCCOLORKEY	0x00001000      /* Blit uses a source color key */
    77 #define SDL_RLEACCELOK	0x00002000      /* Private flag */
    78 #define SDL_RLEACCEL	0x00004000      /* Surface is RLE encoded */
    79 #define SDL_SRCALPHA	0x00010000      /* Blit uses source alpha blending */
    80 
    81 extern DECLSPEC void SDLCALL SDL_WM_SetCaption (const char *title,
    82                                                 const char *icon);
    83 extern DECLSPEC void SDLCALL SDL_WM_GetCaption (char **title, char **icon);
    84 extern DECLSPEC void SDLCALL SDL_WM_SetIcon (SDL_Surface * icon,
    85                                              Uint8 * mask);
    86 extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow (void);
    87 extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen (SDL_Surface * surface);
    88 typedef enum
    89 {
    90     SDL_GRAB_QUERY = -1,
    91     SDL_GRAB_OFF = 0,
    92     SDL_GRAB_ON = 1
    93 } SDL_GrabMode;
    94 extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput (SDL_GrabMode mode);
    95 
    96 /* The available application states */
    97 #define SDL_APPMOUSEFOCUS	0x01    /* The app has mouse coverage */
    98 #define SDL_APPINPUTFOCUS	0x02    /* The app has input focus */
    99 #define SDL_APPACTIVE		0x04    /* The application is active */
   100 
   101 extern DECLSPEC Uint8 SDLCALL SDL_GetAppState (void);
   102 extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version (void);
   103 /* flags for SDL_SetPalette() */
   104 #define SDL_LOGPAL 0x01
   105 #define SDL_PHYSPAL 0x02
   106 
   107 /*
   108  * Sets a portion of the colormap for a given 8-bit surface.
   109  * 'flags' is one or both of:
   110  * SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
   111  *                to/from the surface,
   112  * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
   113  *                the screen
   114  * Only screens have physical palettes. Separate change of physical/logical
   115  * palettes is only possible if the screen has SDL_HWPALETTE set.
   116  *
   117  * The return value is 1 if all colours could be set as requested, and 0
   118  * otherwise.
   119  *
   120  * SDL_SetColors() is equivalent to calling this function with
   121  *     flags = (SDL_LOGPAL|SDL_PHYSPAL).
   122  */
   123 extern DECLSPEC int SDLCALL SDL_SetPalette (SDL_Surface * surface, int flags,
   124                                             SDL_Color * colors,
   125                                             int firstcolor, int ncolors);
   126 extern DECLSPEC int SDLCALL SDL_GetWMInfo (SDL_SysWMinfo * info);