# sdl.h

Go to the documentation of this file.

    00001 /* $Id$ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #ifndef SDL_H
    00013 #define SDL_H
    00014
    00015 const char *SdlOpen(uint32 x);
    00016 void SdlClose(uint32 x);
    00017
    00018 #ifdef WIN32
    00019   #define DYNAMICALLY_LOADED_SDL
    00020 #endif
    00021
    00022 #ifdef DYNAMICALLY_LOADED_SDL
    00023   #include <SDL.h>
    00024
    00025   struct SDLProcs {
    00026     int (SDLCALL *SDL_Init)(Uint32);
    00027     int (SDLCALL *SDL_InitSubSystem)(Uint32);
    00028     char *(SDLCALL *SDL_GetError)();
    00029     void (SDLCALL *SDL_QuitSubSystem)(Uint32);
    00030     void (SDLCALL *SDL_UpdateRect)(SDL_Surface *, Sint32, Sint32, Uint32, Uint32);
    00031     void (SDLCALL *SDL_UpdateRects)(SDL_Surface *, int, SDL_Rect *);
    00032     int (SDLCALL *SDL_SetColors)(SDL_Surface *, SDL_Color *, int, int);
    00033     void (SDLCALL *SDL_WM_SetCaption)(const char *, const char *);
    00034     int (SDLCALL *SDL_ShowCursor)(int);
    00035     void (SDLCALL *SDL_FreeSurface)(SDL_Surface *);
    00036     int (SDLCALL *SDL_PollEvent)(SDL_Event *);
    00037     void (SDLCALL *SDL_WarpMouse)(Uint16, Uint16);
    00038     uint32 (SDLCALL *SDL_GetTicks)();
    00039     int (SDLCALL *SDL_OpenAudio)(SDL_AudioSpec *, SDL_AudioSpec*);
    00040     void (SDLCALL *SDL_PauseAudio)(int);
    00041     void (SDLCALL *SDL_CloseAudio)();
    00042     int (SDLCALL *SDL_LockSurface)(SDL_Surface*);
    00043     void (SDLCALL *SDL_UnlockSurface)(SDL_Surface*);
    00044     SDLMod (SDLCALL *SDL_GetModState)();
    00045     void (SDLCALL *SDL_Delay)(Uint32);
    00046     void (SDLCALL *SDL_Quit)();
    00047     SDL_Surface *(SDLCALL *SDL_SetVideoMode)(int, int, int, Uint32);
    00048     int (SDLCALL *SDL_EnableKeyRepeat)(int, int);
    00049     void (SDLCALL *SDL_EnableUNICODE)(int);
    00050     void (SDLCALL *SDL_VideoDriverName)(char *, int);
    00051     SDL_Rect **(SDLCALL *SDL_ListModes)(void *, int);
    00052     Uint8 *(SDLCALL *SDL_GetKeyState)(int *);
    00053     SDL_Surface *(SDLCALL *SDL_LoadBMP_RW)(SDL_RWops *, int);
    00054     SDL_RWops *(SDLCALL *SDL_RWFromFile)(const char *, const char *);
    00055     int (SDLCALL *SDL_SetColorKey)(SDL_Surface *, Uint32, Uint32);
    00056     void (SDLCALL *SDL_WM_SetIcon)(SDL_Surface *, Uint8 *);
    00057     Uint32 (SDLCALL *SDL_MapRGB)(SDL_PixelFormat *, Uint8, Uint8, Uint8);
    00058     int (SDLCALL *SDL_VideoModeOK)(int, int, int, Uint32);
    00059     SDL_version *(SDLCALL *SDL_Linked_Version)();
    00060   };
    00061
    00062   extern SDLProcs sdl_proc;
    00063
    00064   #define SDL_CALL sdl_proc.
    00065 #else
    00066   #define SDL_CALL
    00067 #endif
    00068
    00069 #endif /* SDL_H */