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