Subversion Repositories dloadsdl

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 apoc 1
/**
2
 * Example Application for Dynamic Loading of SDL
3
 * Copyright (C) 2010  Matthias -apoc- Hecker <apoc@sixserv.org>
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program 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
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
#include "DLLoaderSDL.h"
19
 
20
DLLoaderSDL::DLLoaderSDL()
21
{
22
    proc_symbols_sdl = NULL;
23
}
24
// DLLoaderSDL::DLLoaderSDL(const DLLoaderSDL& orig) {}
25
DLLoaderSDL::~DLLoaderSDL() {}
26
 
27
void DLLoaderSDL::LoadProcSymbols()
28
{
29
    proc_symbols_sdl = new SProcSymbolsSDL;
30
 
31
    std::cout << "load function pointers from symbols" << std::endl;
32
 
33
    /**** Auto generated function symbol resolve via LoadSymbol (by libsdl_header_parser.rb) ****/
34
    // Function declarations for SDL_loadso.h
35
    proc_symbols_sdl->SDL_LoadObject = (void * (*)(const char *)) LoadSymbol("SDL_LoadObject");
36
    proc_symbols_sdl->SDL_LoadFunction = (void * (*)(void *, const char *)) LoadSymbol("SDL_LoadFunction");
37
    proc_symbols_sdl->SDL_UnloadObject = (void (*)(void *)) LoadSymbol("SDL_UnloadObject");
38
 
3 apoc 39
    // Function declarations for SDL_stdinc.h
40
    proc_symbols_sdl->SDL_revcpy = (void * (*)(void *, const void *, size_t)) LoadSymbol("SDL_revcpy");
41
    proc_symbols_sdl->SDL_strlcpy = (size_t (*)(char *, const char *, size_t)) LoadSymbol("SDL_strlcpy");
42
    proc_symbols_sdl->SDL_strlcat = (size_t (*)(char *, const char *, size_t)) LoadSymbol("SDL_strlcat");
43
    proc_symbols_sdl->SDL_strrev = (char * (*)(char *)) LoadSymbol("SDL_strrev");
44
    proc_symbols_sdl->SDL_strupr = (char * (*)(char *)) LoadSymbol("SDL_strupr");
45
    proc_symbols_sdl->SDL_strlwr = (char * (*)(char *)) LoadSymbol("SDL_strlwr");
46
    proc_symbols_sdl->SDL_ltoa = (char * (*)(long, char *, int)) LoadSymbol("SDL_ltoa");
47
    proc_symbols_sdl->SDL_ultoa = (char * (*)(unsigned long, char *, int)) LoadSymbol("SDL_ultoa");
48
    proc_symbols_sdl->SDL_lltoa = (char* (*)(Sint64, char *, int)) LoadSymbol("SDL_lltoa");
49
    proc_symbols_sdl->SDL_ulltoa = (char* (*)(Uint64, char *, int)) LoadSymbol("SDL_ulltoa");
50
    proc_symbols_sdl->SDL_iconv = (size_t (*)(SDL_iconv_t, const char **, size_t *, char **, size_t *)) LoadSymbol("SDL_iconv");
51
    proc_symbols_sdl->SDL_iconv_string = (char * (*)(const char *, const char *, const char *, size_t)) LoadSymbol("SDL_iconv_string");
52
 
2 apoc 53
    // Function declarations for SDL.h
54
    proc_symbols_sdl->SDL_Init = (int (*)(Uint32)) LoadSymbol("SDL_Init");
55
    proc_symbols_sdl->SDL_InitSubSystem = (int (*)(Uint32)) LoadSymbol("SDL_InitSubSystem");
56
    proc_symbols_sdl->SDL_QuitSubSystem = (void (*)(Uint32)) LoadSymbol("SDL_QuitSubSystem");
57
    proc_symbols_sdl->SDL_WasInit = (Uint32 (*)(Uint32)) LoadSymbol("SDL_WasInit");
58
    proc_symbols_sdl->SDL_Quit = (void (*)(void)) LoadSymbol("SDL_Quit");
59
 
60
    // Function declarations for SDL_thread.h
61
    proc_symbols_sdl->SDL_ThreadID = (Uint32 (*)(void)) LoadSymbol("SDL_ThreadID");
62
    proc_symbols_sdl->SDL_GetThreadID = (Uint32 (*)(SDL_Thread *)) LoadSymbol("SDL_GetThreadID");
63
    proc_symbols_sdl->SDL_WaitThread = (void (*)(SDL_Thread *, int *)) LoadSymbol("SDL_WaitThread");
64
    proc_symbols_sdl->SDL_KillThread = (void (*)(SDL_Thread *)) LoadSymbol("SDL_KillThread");
65
 
66
    // Function declarations for SDL_mouse.h
67
    proc_symbols_sdl->SDL_GetMouseState = (Uint8 (*)(int *, int *)) LoadSymbol("SDL_GetMouseState");
68
    proc_symbols_sdl->SDL_GetRelativeMouseState = (Uint8 (*)(int *, int *)) LoadSymbol("SDL_GetRelativeMouseState");
69
    proc_symbols_sdl->SDL_WarpMouse = (void (*)(Uint16, Uint16)) LoadSymbol("SDL_WarpMouse");
70
    proc_symbols_sdl->SDL_CreateCursor = (SDL_Cursor * (*)(Uint8 *, Uint8 *, int, int, int, int)) LoadSymbol("SDL_CreateCursor");
71
    proc_symbols_sdl->SDL_SetCursor = (void (*)(SDL_Cursor *)) LoadSymbol("SDL_SetCursor");
72
    proc_symbols_sdl->SDL_GetCursor = (SDL_Cursor * (*)(void)) LoadSymbol("SDL_GetCursor");
73
    proc_symbols_sdl->SDL_FreeCursor = (void (*)(SDL_Cursor *)) LoadSymbol("SDL_FreeCursor");
74
    proc_symbols_sdl->SDL_ShowCursor = (int (*)(int)) LoadSymbol("SDL_ShowCursor");
75
 
76
    // Function declarations for SDL_audio.h
77
    proc_symbols_sdl->SDL_AudioInit = (int (*)(const char *)) LoadSymbol("SDL_AudioInit");
78
    proc_symbols_sdl->SDL_AudioQuit = (void (*)(void)) LoadSymbol("SDL_AudioQuit");
79
    proc_symbols_sdl->SDL_AudioDriverName = (char * (*)(char *, int)) LoadSymbol("SDL_AudioDriverName");
80
    proc_symbols_sdl->SDL_OpenAudio = (int (*)(SDL_AudioSpec *, SDL_AudioSpec *)) LoadSymbol("SDL_OpenAudio");
81
    proc_symbols_sdl->SDL_GetAudioStatus = (SDL_audiostatus (*)(void)) LoadSymbol("SDL_GetAudioStatus");
82
    proc_symbols_sdl->SDL_PauseAudio = (void (*)(int)) LoadSymbol("SDL_PauseAudio");
83
    proc_symbols_sdl->SDL_LoadWAV_RW = (SDL_AudioSpec * (*)(SDL_RWops *, int, SDL_AudioSpec *, Uint8 **, Uint32 *)) LoadSymbol("SDL_LoadWAV_RW");
84
    proc_symbols_sdl->SDL_FreeWAV = (void (*)(Uint8 *)) LoadSymbol("SDL_FreeWAV");
85
    proc_symbols_sdl->SDL_BuildAudioCVT = (int (*)(SDL_AudioCVT *, Uint16, Uint8, int, Uint16, Uint8, int)) LoadSymbol("SDL_BuildAudioCVT");
86
    proc_symbols_sdl->SDL_ConvertAudio = (int (*)(SDL_AudioCVT *)) LoadSymbol("SDL_ConvertAudio");
87
    proc_symbols_sdl->SDL_MixAudio = (void (*)(Uint8 *, const Uint8 *, Uint32, int)) LoadSymbol("SDL_MixAudio");
88
    proc_symbols_sdl->SDL_LockAudio = (void (*)(void)) LoadSymbol("SDL_LockAudio");
89
    proc_symbols_sdl->SDL_UnlockAudio = (void (*)(void)) LoadSymbol("SDL_UnlockAudio");
90
    proc_symbols_sdl->SDL_CloseAudio = (void (*)(void)) LoadSymbol("SDL_CloseAudio");
91
 
92
    // Function declarations for SDL_cpuinfo.h
93
    proc_symbols_sdl->SDL_HasRDTSC = (SDL_bool (*)(void)) LoadSymbol("SDL_HasRDTSC");
94
    proc_symbols_sdl->SDL_HasMMX = (SDL_bool (*)(void)) LoadSymbol("SDL_HasMMX");
95
    proc_symbols_sdl->SDL_HasMMXExt = (SDL_bool (*)(void)) LoadSymbol("SDL_HasMMXExt");
96
    proc_symbols_sdl->SDL_Has3DNow = (SDL_bool (*)(void)) LoadSymbol("SDL_Has3DNow");
97
    proc_symbols_sdl->SDL_Has3DNowExt = (SDL_bool (*)(void)) LoadSymbol("SDL_Has3DNowExt");
98
    proc_symbols_sdl->SDL_HasSSE = (SDL_bool (*)(void)) LoadSymbol("SDL_HasSSE");
99
    proc_symbols_sdl->SDL_HasSSE2 = (SDL_bool (*)(void)) LoadSymbol("SDL_HasSSE2");
100
    proc_symbols_sdl->SDL_HasAltiVec = (SDL_bool (*)(void)) LoadSymbol("SDL_HasAltiVec");
101
 
102
    // Function declarations for SDL_events.h
103
    proc_symbols_sdl->SDL_PumpEvents = (void (*)(void)) LoadSymbol("SDL_PumpEvents");
104
    proc_symbols_sdl->SDL_PeepEvents = (int (*)(SDL_Event *, int, SDL_eventaction, Uint32)) LoadSymbol("SDL_PeepEvents");
105
    proc_symbols_sdl->SDL_PollEvent = (int (*)(SDL_Event *)) LoadSymbol("SDL_PollEvent");
106
    proc_symbols_sdl->SDL_WaitEvent = (int (*)(SDL_Event *)) LoadSymbol("SDL_WaitEvent");
107
    proc_symbols_sdl->SDL_PushEvent = (int (*)(SDL_Event *)) LoadSymbol("SDL_PushEvent");
108
    proc_symbols_sdl->SDL_SetEventFilter = (void (*)(SDL_EventFilter)) LoadSymbol("SDL_SetEventFilter");
109
    proc_symbols_sdl->SDL_GetEventFilter = (SDL_EventFilter (*)(void)) LoadSymbol("SDL_GetEventFilter");
110
    proc_symbols_sdl->SDL_EventState = (Uint8 (*)(Uint8, int)) LoadSymbol("SDL_EventState");
111
 
112
    // Function declarations for SDL_version.h
113
    proc_symbols_sdl->SDL_Linked_Version = (const SDL_version * (*)(void)) LoadSymbol("SDL_Linked_Version");
114
 
115
    // Function declarations for SDL_keyboard.h
116
    proc_symbols_sdl->SDL_EnableUNICODE = (int (*)(int)) LoadSymbol("SDL_EnableUNICODE");
117
    proc_symbols_sdl->SDL_EnableKeyRepeat = (int (*)(int, int)) LoadSymbol("SDL_EnableKeyRepeat");
118
    proc_symbols_sdl->SDL_GetKeyRepeat = (void (*)(int *, int *)) LoadSymbol("SDL_GetKeyRepeat");
119
    proc_symbols_sdl->SDL_GetKeyState = (Uint8 * (*)(int *)) LoadSymbol("SDL_GetKeyState");
120
    proc_symbols_sdl->SDL_GetModState = (SDLMod (*)(void)) LoadSymbol("SDL_GetModState");
121
    proc_symbols_sdl->SDL_SetModState = (void (*)(SDLMod)) LoadSymbol("SDL_SetModState");
122
    proc_symbols_sdl->SDL_GetKeyName = (char * (*)(SDLKey)) LoadSymbol("SDL_GetKeyName");
123
 
124
    // Function declarations for SDL_timer.h
125
    proc_symbols_sdl->SDL_GetTicks = (Uint32 (*)(void)) LoadSymbol("SDL_GetTicks");
126
    proc_symbols_sdl->SDL_Delay = (void (*)(Uint32)) LoadSymbol("SDL_Delay");
127
    proc_symbols_sdl->SDL_SetTimer = (int (*)(Uint32, SDL_TimerCallback)) LoadSymbol("SDL_SetTimer");
128
    proc_symbols_sdl->SDL_AddTimer = (SDL_TimerID (*)(Uint32, SDL_NewTimerCallback, void *)) LoadSymbol("SDL_AddTimer");
129
    proc_symbols_sdl->SDL_RemoveTimer = (SDL_bool (*)(SDL_TimerID)) LoadSymbol("SDL_RemoveTimer");
130
 
131
    // Function declarations for SDL_rwops.h
132
    proc_symbols_sdl->SDL_RWFromFile = (SDL_RWops * (*)(const char *, const char *)) LoadSymbol("SDL_RWFromFile");
133
    proc_symbols_sdl->SDL_RWFromFP = (SDL_RWops * (*)(FILE *, int)) LoadSymbol("SDL_RWFromFP");
134
    proc_symbols_sdl->SDL_RWFromMem = (SDL_RWops * (*)(void *, int)) LoadSymbol("SDL_RWFromMem");
135
    proc_symbols_sdl->SDL_RWFromConstMem = (SDL_RWops * (*)(const void *, int)) LoadSymbol("SDL_RWFromConstMem");
136
    proc_symbols_sdl->SDL_AllocRW = (SDL_RWops * (*)(void)) LoadSymbol("SDL_AllocRW");
137
    proc_symbols_sdl->SDL_FreeRW = (void (*)(SDL_RWops *)) LoadSymbol("SDL_FreeRW");
138
    proc_symbols_sdl->SDL_ReadLE16 = (Uint16 (*)(SDL_RWops *)) LoadSymbol("SDL_ReadLE16");
139
    proc_symbols_sdl->SDL_ReadBE16 = (Uint16 (*)(SDL_RWops *)) LoadSymbol("SDL_ReadBE16");
140
    proc_symbols_sdl->SDL_ReadLE32 = (Uint32 (*)(SDL_RWops *)) LoadSymbol("SDL_ReadLE32");
141
    proc_symbols_sdl->SDL_ReadBE32 = (Uint32 (*)(SDL_RWops *)) LoadSymbol("SDL_ReadBE32");
142
    proc_symbols_sdl->SDL_ReadLE64 = (Uint64 (*)(SDL_RWops *)) LoadSymbol("SDL_ReadLE64");
143
    proc_symbols_sdl->SDL_ReadBE64 = (Uint64 (*)(SDL_RWops *)) LoadSymbol("SDL_ReadBE64");
144
    proc_symbols_sdl->SDL_WriteLE16 = (int (*)(SDL_RWops *, Uint16)) LoadSymbol("SDL_WriteLE16");
145
    proc_symbols_sdl->SDL_WriteBE16 = (int (*)(SDL_RWops *, Uint16)) LoadSymbol("SDL_WriteBE16");
146
    proc_symbols_sdl->SDL_WriteLE32 = (int (*)(SDL_RWops *, Uint32)) LoadSymbol("SDL_WriteLE32");
147
    proc_symbols_sdl->SDL_WriteBE32 = (int (*)(SDL_RWops *, Uint32)) LoadSymbol("SDL_WriteBE32");
148
    proc_symbols_sdl->SDL_WriteLE64 = (int (*)(SDL_RWops *, Uint64)) LoadSymbol("SDL_WriteLE64");
149
    proc_symbols_sdl->SDL_WriteBE64 = (int (*)(SDL_RWops *, Uint64)) LoadSymbol("SDL_WriteBE64");
150
 
151
    // Function declarations for SDL_active.h
152
    proc_symbols_sdl->SDL_GetAppState = (Uint8 (*)(void)) LoadSymbol("SDL_GetAppState");
153
 
154
    // Function declarations for SDL_cdrom.h
155
    proc_symbols_sdl->SDL_CDNumDrives = (int (*)(void)) LoadSymbol("SDL_CDNumDrives");
156
    proc_symbols_sdl->SDL_CDName = (const char * (*)(int)) LoadSymbol("SDL_CDName");
157
    proc_symbols_sdl->SDL_CDOpen = (SDL_CD * (*)(int)) LoadSymbol("SDL_CDOpen");
158
    proc_symbols_sdl->SDL_CDStatus = (CDstatus (*)(SDL_CD *)) LoadSymbol("SDL_CDStatus");
159
    proc_symbols_sdl->SDL_CDPlayTracks = (int (*)(SDL_CD *, int, int, int, int)) LoadSymbol("SDL_CDPlayTracks");
160
    proc_symbols_sdl->SDL_CDPlay = (int (*)(SDL_CD *, int, int)) LoadSymbol("SDL_CDPlay");
161
    proc_symbols_sdl->SDL_CDPause = (int (*)(SDL_CD *)) LoadSymbol("SDL_CDPause");
162
    proc_symbols_sdl->SDL_CDResume = (int (*)(SDL_CD *)) LoadSymbol("SDL_CDResume");
163
    proc_symbols_sdl->SDL_CDStop = (int (*)(SDL_CD *)) LoadSymbol("SDL_CDStop");
164
    proc_symbols_sdl->SDL_CDEject = (int (*)(SDL_CD *)) LoadSymbol("SDL_CDEject");
165
    proc_symbols_sdl->SDL_CDClose = (void (*)(SDL_CD *)) LoadSymbol("SDL_CDClose");
166
 
167
    // Function declarations for SDL_joystick.h
168
    proc_symbols_sdl->SDL_NumJoysticks = (int (*)(void)) LoadSymbol("SDL_NumJoysticks");
169
    proc_symbols_sdl->SDL_JoystickName = (const char * (*)(int)) LoadSymbol("SDL_JoystickName");
170
    proc_symbols_sdl->SDL_JoystickOpen = (SDL_Joystick * (*)(int)) LoadSymbol("SDL_JoystickOpen");
171
    proc_symbols_sdl->SDL_JoystickOpened = (int (*)(int)) LoadSymbol("SDL_JoystickOpened");
172
    proc_symbols_sdl->SDL_JoystickIndex = (int (*)(SDL_Joystick *)) LoadSymbol("SDL_JoystickIndex");
173
    proc_symbols_sdl->SDL_JoystickNumAxes = (int (*)(SDL_Joystick *)) LoadSymbol("SDL_JoystickNumAxes");
174
    proc_symbols_sdl->SDL_JoystickNumBalls = (int (*)(SDL_Joystick *)) LoadSymbol("SDL_JoystickNumBalls");
175
    proc_symbols_sdl->SDL_JoystickNumHats = (int (*)(SDL_Joystick *)) LoadSymbol("SDL_JoystickNumHats");
176
    proc_symbols_sdl->SDL_JoystickNumButtons = (int (*)(SDL_Joystick *)) LoadSymbol("SDL_JoystickNumButtons");
177
    proc_symbols_sdl->SDL_JoystickUpdate = (void (*)(void)) LoadSymbol("SDL_JoystickUpdate");
178
    proc_symbols_sdl->SDL_JoystickEventState = (int (*)(int)) LoadSymbol("SDL_JoystickEventState");
179
    proc_symbols_sdl->SDL_JoystickGetAxis = (Sint16 (*)(SDL_Joystick *, int)) LoadSymbol("SDL_JoystickGetAxis");
180
    proc_symbols_sdl->SDL_JoystickGetHat = (Uint8 (*)(SDL_Joystick *, int)) LoadSymbol("SDL_JoystickGetHat");
181
    proc_symbols_sdl->SDL_JoystickGetBall = (int (*)(SDL_Joystick *, int, int *, int *)) LoadSymbol("SDL_JoystickGetBall");
182
    proc_symbols_sdl->SDL_JoystickGetButton = (Uint8 (*)(SDL_Joystick *, int)) LoadSymbol("SDL_JoystickGetButton");
183
    proc_symbols_sdl->SDL_JoystickClose = (void (*)(SDL_Joystick *)) LoadSymbol("SDL_JoystickClose");
184
 
185
    // Function declarations for SDL_video.h
186
    proc_symbols_sdl->SDL_VideoInit = (int (*)(const char *, Uint32)) LoadSymbol("SDL_VideoInit");
187
    proc_symbols_sdl->SDL_VideoQuit = (void (*)(void)) LoadSymbol("SDL_VideoQuit");
188
    proc_symbols_sdl->SDL_VideoDriverName = (char * (*)(char *, int)) LoadSymbol("SDL_VideoDriverName");
189
    proc_symbols_sdl->SDL_GetVideoSurface = (SDL_Surface * (*)(void)) LoadSymbol("SDL_GetVideoSurface");
190
    proc_symbols_sdl->SDL_GetVideoInfo = (const SDL_VideoInfo * (*)(void)) LoadSymbol("SDL_GetVideoInfo");
191
    proc_symbols_sdl->SDL_VideoModeOK = (int (*)(int, int, int, Uint32)) LoadSymbol("SDL_VideoModeOK");
192
    proc_symbols_sdl->SDL_ListModes = (SDL_Rect ** (*)(SDL_PixelFormat *, Uint32)) LoadSymbol("SDL_ListModes");
193
    proc_symbols_sdl->SDL_SetVideoMode = (SDL_Surface * (*)(int, int, int, Uint32)) LoadSymbol("SDL_SetVideoMode");
194
    proc_symbols_sdl->SDL_UpdateRects = (void (*)(SDL_Surface *, int, SDL_Rect *)) LoadSymbol("SDL_UpdateRects");
195
    proc_symbols_sdl->SDL_UpdateRect = (void (*)(SDL_Surface *, Sint32, Sint32, Uint32, Uint32)) LoadSymbol("SDL_UpdateRect");
196
    proc_symbols_sdl->SDL_Flip = (int (*)(SDL_Surface *)) LoadSymbol("SDL_Flip");
197
    proc_symbols_sdl->SDL_SetGamma = (int (*)(float, float, float)) LoadSymbol("SDL_SetGamma");
198
    proc_symbols_sdl->SDL_SetGammaRamp = (int (*)(const Uint16 *, const Uint16 *, const Uint16 *)) LoadSymbol("SDL_SetGammaRamp");
199
    proc_symbols_sdl->SDL_GetGammaRamp = (int (*)(Uint16 *, Uint16 *, Uint16 *)) LoadSymbol("SDL_GetGammaRamp");
200
    proc_symbols_sdl->SDL_SetColors = (int (*)(SDL_Surface *, SDL_Color *, int, int)) LoadSymbol("SDL_SetColors");
201
    proc_symbols_sdl->SDL_SetPalette = (int (*)(SDL_Surface *, int, SDL_Color *, int, int)) LoadSymbol("SDL_SetPalette");
202
    proc_symbols_sdl->SDL_MapRGB = (Uint32 (*)(const SDL_PixelFormat * const, const Uint8, const Uint8, const Uint8)) LoadSymbol("SDL_MapRGB");
203
    proc_symbols_sdl->SDL_MapRGBA = (Uint32 (*)(const SDL_PixelFormat * const, const Uint8, const Uint8, const Uint8, const Uint8)) LoadSymbol("SDL_MapRGBA");
204
    proc_symbols_sdl->SDL_GetRGB = (void (*)(Uint32, const SDL_PixelFormat * const, Uint8 *, Uint8 *, Uint8 *)) LoadSymbol("SDL_GetRGB");
205
    proc_symbols_sdl->SDL_GetRGBA = (void (*)(Uint32, const SDL_PixelFormat * const, Uint8 *, Uint8 *, Uint8 *, Uint8 *)) LoadSymbol("SDL_GetRGBA");
206
    proc_symbols_sdl->SDL_CreateRGBSurface = (SDL_Surface * (*)(Uint32, int, int, int, Uint32, Uint32, Uint32, Uint32)) LoadSymbol("SDL_CreateRGBSurface");
207
    proc_symbols_sdl->SDL_CreateRGBSurfaceFrom = (SDL_Surface * (*)(void *, int, int, int, int, Uint32, Uint32, Uint32, Uint32)) LoadSymbol("SDL_CreateRGBSurfaceFrom");
208
    proc_symbols_sdl->SDL_FreeSurface = (void (*)(SDL_Surface *)) LoadSymbol("SDL_FreeSurface");
209
    proc_symbols_sdl->SDL_LockSurface = (int (*)(SDL_Surface *)) LoadSymbol("SDL_LockSurface");
210
    proc_symbols_sdl->SDL_UnlockSurface = (void (*)(SDL_Surface *)) LoadSymbol("SDL_UnlockSurface");
211
    proc_symbols_sdl->SDL_LoadBMP_RW = (SDL_Surface * (*)(SDL_RWops *, int)) LoadSymbol("SDL_LoadBMP_RW");
212
    proc_symbols_sdl->SDL_SaveBMP_RW = (int (*)(SDL_Surface *, SDL_RWops *, int)) LoadSymbol("SDL_SaveBMP_RW");
213
    proc_symbols_sdl->SDL_SetColorKey = (int (*)(SDL_Surface *, Uint32, Uint32)) LoadSymbol("SDL_SetColorKey");
214
    proc_symbols_sdl->SDL_SetAlpha = (int (*)(SDL_Surface *, Uint32, Uint8)) LoadSymbol("SDL_SetAlpha");
215
    proc_symbols_sdl->SDL_SetClipRect = (SDL_bool (*)(SDL_Surface *, const SDL_Rect *)) LoadSymbol("SDL_SetClipRect");
216
    proc_symbols_sdl->SDL_GetClipRect = (void (*)(SDL_Surface *, SDL_Rect *)) LoadSymbol("SDL_GetClipRect");
217
    proc_symbols_sdl->SDL_ConvertSurface = (SDL_Surface * (*)(SDL_Surface *, SDL_PixelFormat *, Uint32)) LoadSymbol("SDL_ConvertSurface");
218
    proc_symbols_sdl->SDL_UpperBlit = (int (*)(SDL_Surface *, SDL_Rect *, SDL_Surface *, SDL_Rect *)) LoadSymbol("SDL_UpperBlit");
219
    proc_symbols_sdl->SDL_LowerBlit = (int (*)(SDL_Surface *, SDL_Rect *, SDL_Surface *, SDL_Rect *)) LoadSymbol("SDL_LowerBlit");
220
    proc_symbols_sdl->SDL_FillRect = (int (*)(SDL_Surface *, SDL_Rect *, Uint32)) LoadSymbol("SDL_FillRect");
221
    proc_symbols_sdl->SDL_DisplayFormat = (SDL_Surface * (*)(SDL_Surface *)) LoadSymbol("SDL_DisplayFormat");
222
    proc_symbols_sdl->SDL_DisplayFormatAlpha = (SDL_Surface * (*)(SDL_Surface *)) LoadSymbol("SDL_DisplayFormatAlpha");
223
    proc_symbols_sdl->SDL_CreateYUVOverlay = (SDL_Overlay * (*)(int, int, Uint32, SDL_Surface *)) LoadSymbol("SDL_CreateYUVOverlay");
224
    proc_symbols_sdl->SDL_LockYUVOverlay = (int (*)(SDL_Overlay *)) LoadSymbol("SDL_LockYUVOverlay");
225
    proc_symbols_sdl->SDL_UnlockYUVOverlay = (void (*)(SDL_Overlay *)) LoadSymbol("SDL_UnlockYUVOverlay");
226
    proc_symbols_sdl->SDL_DisplayYUVOverlay = (int (*)(SDL_Overlay *, SDL_Rect *)) LoadSymbol("SDL_DisplayYUVOverlay");
227
    proc_symbols_sdl->SDL_FreeYUVOverlay = (void (*)(SDL_Overlay *)) LoadSymbol("SDL_FreeYUVOverlay");
228
    proc_symbols_sdl->SDL_GL_LoadLibrary = (int (*)(const char *)) LoadSymbol("SDL_GL_LoadLibrary");
229
    proc_symbols_sdl->SDL_GL_GetProcAddress = (void * (*)(const char*)) LoadSymbol("SDL_GL_GetProcAddress");
230
    proc_symbols_sdl->SDL_GL_SetAttribute = (int (*)(SDL_GLattr, int)) LoadSymbol("SDL_GL_SetAttribute");
231
    proc_symbols_sdl->SDL_GL_GetAttribute = (int (*)(SDL_GLattr, int*)) LoadSymbol("SDL_GL_GetAttribute");
232
    proc_symbols_sdl->SDL_GL_SwapBuffers = (void (*)(void)) LoadSymbol("SDL_GL_SwapBuffers");
233
    proc_symbols_sdl->SDL_GL_UpdateRects = (void (*)(int, SDL_Rect*)) LoadSymbol("SDL_GL_UpdateRects");
234
    proc_symbols_sdl->SDL_GL_Lock = (void (*)(void)) LoadSymbol("SDL_GL_Lock");
235
    proc_symbols_sdl->SDL_GL_Unlock = (void (*)(void)) LoadSymbol("SDL_GL_Unlock");
236
    proc_symbols_sdl->SDL_WM_SetCaption = (void (*)(const char *, const char *)) LoadSymbol("SDL_WM_SetCaption");
237
    proc_symbols_sdl->SDL_WM_GetCaption = (void (*)(char **, char **)) LoadSymbol("SDL_WM_GetCaption");
238
    proc_symbols_sdl->SDL_WM_SetIcon = (void (*)(SDL_Surface *, Uint8 *)) LoadSymbol("SDL_WM_SetIcon");
239
    proc_symbols_sdl->SDL_WM_IconifyWindow = (int (*)(void)) LoadSymbol("SDL_WM_IconifyWindow");
240
    proc_symbols_sdl->SDL_WM_ToggleFullScreen = (int (*)(SDL_Surface *)) LoadSymbol("SDL_WM_ToggleFullScreen");
241
    proc_symbols_sdl->SDL_WM_GrabInput = (SDL_GrabMode (*)(SDL_GrabMode)) LoadSymbol("SDL_WM_GrabInput");
242
    proc_symbols_sdl->SDL_SoftStretch = (int (*)(SDL_Surface *, SDL_Rect *, SDL_Surface *, SDL_Rect *)) LoadSymbol("SDL_SoftStretch");
243
 
244
    // Function declarations for SDL_mutex.h
245
    proc_symbols_sdl->SDL_CreateMutex = (SDL_mutex * (*)(void)) LoadSymbol("SDL_CreateMutex");
246
    proc_symbols_sdl->SDL_mutexP = (int (*)(SDL_mutex *)) LoadSymbol("SDL_mutexP");
247
    proc_symbols_sdl->SDL_mutexV = (int (*)(SDL_mutex *)) LoadSymbol("SDL_mutexV");
248
    proc_symbols_sdl->SDL_DestroyMutex = (void (*)(SDL_mutex *)) LoadSymbol("SDL_DestroyMutex");
249
    proc_symbols_sdl->SDL_CreateSemaphore = (SDL_sem * (*)(Uint32)) LoadSymbol("SDL_CreateSemaphore");
250
    proc_symbols_sdl->SDL_DestroySemaphore = (void (*)(SDL_sem *)) LoadSymbol("SDL_DestroySemaphore");
251
    proc_symbols_sdl->SDL_SemWait = (int (*)(SDL_sem *)) LoadSymbol("SDL_SemWait");
252
    proc_symbols_sdl->SDL_SemTryWait = (int (*)(SDL_sem *)) LoadSymbol("SDL_SemTryWait");
253
    proc_symbols_sdl->SDL_SemWaitTimeout = (int (*)(SDL_sem *, Uint32)) LoadSymbol("SDL_SemWaitTimeout");
254
    proc_symbols_sdl->SDL_SemPost = (int (*)(SDL_sem *)) LoadSymbol("SDL_SemPost");
255
    proc_symbols_sdl->SDL_SemValue = (Uint32 (*)(SDL_sem *)) LoadSymbol("SDL_SemValue");
256
    proc_symbols_sdl->SDL_CreateCond = (SDL_cond * (*)(void)) LoadSymbol("SDL_CreateCond");
257
    proc_symbols_sdl->SDL_DestroyCond = (void (*)(SDL_cond *)) LoadSymbol("SDL_DestroyCond");
258
    proc_symbols_sdl->SDL_CondSignal = (int (*)(SDL_cond *)) LoadSymbol("SDL_CondSignal");
259
    proc_symbols_sdl->SDL_CondBroadcast = (int (*)(SDL_cond *)) LoadSymbol("SDL_CondBroadcast");
260
    proc_symbols_sdl->SDL_CondWait = (int (*)(SDL_cond *, SDL_mutex *)) LoadSymbol("SDL_CondWait");
261
    proc_symbols_sdl->SDL_CondWaitTimeout = (int (*)(SDL_cond *, SDL_mutex *, Uint32)) LoadSymbol("SDL_CondWaitTimeout");
262
 
263
    // Function declarations for SDL_error.h
264
    proc_symbols_sdl->SDL_SetError = (void (*)(const char *)) LoadSymbol("SDL_SetError");
265
    proc_symbols_sdl->SDL_GetError = (char * (*)(void)) LoadSymbol("SDL_GetError");
266
    proc_symbols_sdl->SDL_ClearError = (void (*)(void)) LoadSymbol("SDL_ClearError");
267
    proc_symbols_sdl->SDL_Error = (void (*)(SDL_errorcode)) LoadSymbol("SDL_Error");
268
    /**** End auto generated function symbol resolve ****/
269
}
270
 
271
void DLLoaderSDL::UnloadProcSymbols()
272
{
273
    std::cout << "unload function pointers" << std::endl;
274
    delete proc_symbols_sdl;
275
    proc_symbols_sdl = NULL;
276
}
277
 
278
DLLoaderSDL::SProcSymbolsSDL *DLLoaderSDL::GetSDL()
279
{
280
    return proc_symbols_sdl;
281
}
282