src/sdl.h
author rubidium
Thu, 18 Dec 2008 12:23:08 +0000
changeset 10436 8d3a9fbe8f19
parent 9111 48ce04029fe4
permissions -rw-r--r--
(svn r14689) -Change: make configure die on commonly made user mistakes, like not having SDL development files or zlib headers installed; you can still compile a dedicated server or a binary without zlib, but you have to explicitly force it.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2171
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2171
diff changeset
     2
9111
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 6420
diff changeset
     3
/** @file sdl.h SDL support. */
6420
456c275f3313 (svn r9556) -Documentation: doxygen and comment-style changes. 'R', 'S'.. The end of the preliminary work is near
belugas
parents: 6248
diff changeset
     4
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
     5
#ifndef SDL_H
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
     6
#define SDL_H
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
     7
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
     8
const char* SdlOpen(uint32 x);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
     9
void SdlClose(uint32 x);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    10
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    11
#ifdef WIN32
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    12
	#define DYNAMICALLY_LOADED_SDL
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    13
#endif
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    14
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    15
#ifdef DYNAMICALLY_LOADED_SDL
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    16
	#include <SDL.h>
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    17
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    18
	struct SDLProcs {
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    19
		int (SDLCALL *SDL_Init)(Uint32);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    20
		int (SDLCALL *SDL_InitSubSystem)(Uint32);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5475
diff changeset
    21
		char *(SDLCALL *SDL_GetError)();
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    22
		void (SDLCALL *SDL_QuitSubSystem)(Uint32);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    23
		void (SDLCALL *SDL_UpdateRect)(SDL_Surface *, Sint32, Sint32, Uint32, Uint32);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    24
		void (SDLCALL *SDL_UpdateRects)(SDL_Surface *, int, SDL_Rect *);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    25
		int (SDLCALL *SDL_SetColors)(SDL_Surface *, SDL_Color *, int, int);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    26
		void (SDLCALL *SDL_WM_SetCaption)(const char *, const char *);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    27
		int (SDLCALL *SDL_ShowCursor)(int);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    28
		void (SDLCALL *SDL_FreeSurface)(SDL_Surface *);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    29
		int (SDLCALL *SDL_PollEvent)(SDL_Event *);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    30
		void (SDLCALL *SDL_WarpMouse)(Uint16, Uint16);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5475
diff changeset
    31
		uint32 (SDLCALL *SDL_GetTicks)();
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    32
		int (SDLCALL *SDL_OpenAudio)(SDL_AudioSpec *, SDL_AudioSpec*);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    33
		void (SDLCALL *SDL_PauseAudio)(int);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5475
diff changeset
    34
		void (SDLCALL *SDL_CloseAudio)();
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    35
		int (SDLCALL *SDL_LockSurface)(SDL_Surface*);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    36
		void (SDLCALL *SDL_UnlockSurface)(SDL_Surface*);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5475
diff changeset
    37
		SDLMod (SDLCALL *SDL_GetModState)();
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    38
		void (SDLCALL *SDL_Delay)(Uint32);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5475
diff changeset
    39
		void (SDLCALL *SDL_Quit)();
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    40
		SDL_Surface *(SDLCALL *SDL_SetVideoMode)(int, int, int, Uint32);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    41
		int (SDLCALL *SDL_EnableKeyRepeat)(int, int);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    42
		void (SDLCALL *SDL_EnableUNICODE)(int);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    43
		void (SDLCALL *SDL_VideoDriverName)(char *, int);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    44
		SDL_Rect **(SDLCALL *SDL_ListModes)(void *, int);
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    45
		Uint8 *(SDLCALL *SDL_GetKeyState)(int *);
4256
5e29191a88a1 (svn r5872) - Feature: Add an icon to the SDL openttd executable.
Darkvater
parents: 2436
diff changeset
    46
		SDL_Surface *(SDLCALL *SDL_LoadBMP_RW)(SDL_RWops *, int);
5e29191a88a1 (svn r5872) - Feature: Add an icon to the SDL openttd executable.
Darkvater
parents: 2436
diff changeset
    47
		SDL_RWops *(SDLCALL *SDL_RWFromFile)(const char *, const char *);
5e29191a88a1 (svn r5872) - Feature: Add an icon to the SDL openttd executable.
Darkvater
parents: 2436
diff changeset
    48
		int (SDLCALL *SDL_SetColorKey)(SDL_Surface *, Uint32, Uint32);
5e29191a88a1 (svn r5872) - Feature: Add an icon to the SDL openttd executable.
Darkvater
parents: 2436
diff changeset
    49
		void (SDLCALL *SDL_WM_SetIcon)(SDL_Surface *, Uint8 *);
5e29191a88a1 (svn r5872) - Feature: Add an icon to the SDL openttd executable.
Darkvater
parents: 2436
diff changeset
    50
		Uint32 (SDLCALL *SDL_MapRGB)(SDL_PixelFormat *, Uint8, Uint8, Uint8);
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    51
	};
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    52
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    53
	extern SDLProcs sdl_proc;
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    54
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    55
	#define SDL_CALL sdl_proc.
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    56
#else
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    57
	#define SDL_CALL
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    58
#endif
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
diff changeset
    59
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2186
diff changeset
    60
#endif /* SDL_H */