(svn r27950) -Merge: Documentation updates from 1.7 branch
[openttd.git] / src / sdl.h
blobff1092358f2575ded0660cf86410566854cfa8aa
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file sdl.h SDL support. */
12 #ifndef SDL_H
13 #define SDL_H
15 const char *SdlOpen(uint32 x);
16 void SdlClose(uint32 x);
18 #ifdef WIN32
19 #define DYNAMICALLY_LOADED_SDL
20 #endif
22 #ifdef DYNAMICALLY_LOADED_SDL
23 #include <SDL.h>
25 struct SDLProcs {
26 int (SDLCALL *SDL_Init)(Uint32);
27 int (SDLCALL *SDL_InitSubSystem)(Uint32);
28 char *(SDLCALL *SDL_GetError)();
29 void (SDLCALL *SDL_QuitSubSystem)(Uint32);
30 void (SDLCALL *SDL_UpdateRect)(SDL_Surface *, Sint32, Sint32, Uint32, Uint32);
31 void (SDLCALL *SDL_UpdateRects)(SDL_Surface *, int, SDL_Rect *);
32 int (SDLCALL *SDL_SetColors)(SDL_Surface *, SDL_Color *, int, int);
33 void (SDLCALL *SDL_WM_SetCaption)(const char *, const char *);
34 int (SDLCALL *SDL_ShowCursor)(int);
35 void (SDLCALL *SDL_FreeSurface)(SDL_Surface *);
36 int (SDLCALL *SDL_PollEvent)(SDL_Event *);
37 void (SDLCALL *SDL_WarpMouse)(Uint16, Uint16);
38 uint32 (SDLCALL *SDL_GetTicks)();
39 int (SDLCALL *SDL_OpenAudio)(SDL_AudioSpec *, SDL_AudioSpec*);
40 void (SDLCALL *SDL_PauseAudio)(int);
41 void (SDLCALL *SDL_CloseAudio)();
42 int (SDLCALL *SDL_LockSurface)(SDL_Surface*);
43 void (SDLCALL *SDL_UnlockSurface)(SDL_Surface*);
44 SDLMod (SDLCALL *SDL_GetModState)();
45 void (SDLCALL *SDL_Delay)(Uint32);
46 void (SDLCALL *SDL_Quit)();
47 SDL_Surface *(SDLCALL *SDL_SetVideoMode)(int, int, int, Uint32);
48 int (SDLCALL *SDL_EnableKeyRepeat)(int, int);
49 void (SDLCALL *SDL_EnableUNICODE)(int);
50 void (SDLCALL *SDL_VideoDriverName)(char *, int);
51 SDL_Rect **(SDLCALL *SDL_ListModes)(void *, int);
52 Uint8 *(SDLCALL *SDL_GetKeyState)(int *);
53 SDL_Surface *(SDLCALL *SDL_LoadBMP_RW)(SDL_RWops *, int);
54 SDL_RWops *(SDLCALL *SDL_RWFromFile)(const char *, const char *);
55 int (SDLCALL *SDL_SetColorKey)(SDL_Surface *, Uint32, Uint32);
56 void (SDLCALL *SDL_WM_SetIcon)(SDL_Surface *, Uint8 *);
57 Uint32 (SDLCALL *SDL_MapRGB)(SDL_PixelFormat *, Uint8, Uint8, Uint8);
58 int (SDLCALL *SDL_VideoModeOK)(int, int, int, Uint32);
59 SDL_version *(SDLCALL *SDL_Linked_Version)();
60 int (SDLCALL *SDL_BlitSurface)(SDL_Surface *, SDL_Rect *, SDL_Surface *, SDL_Rect *);
61 SDL_Surface *(SDLCALL *SDL_CreateRGBSurface)(Uint32, int, int, int, Uint32, Uint32, Uint32, Uint32);
64 extern SDLProcs sdl_proc;
66 #define SDL_CALL sdl_proc.
67 #else
68 #define SDL_CALL
69 #endif
71 #endif /* SDL_H */