source: trunk/src/lib/sdl12.cc @ 5

Last change on this file since 5 was 5, checked in by epyon, 12 years ago
  • nv/lib/*.hh - dynamic/static/shared headers for OpenGL, Lua, SDL and SDL_image
  • nv/lib/*.hh - implementation for dynamic versions
  • all libraries may be used in dynamic, static or shared mode, depending on defines
  • static mode is inclusion of the library into the executable
  • shared mode is the usual compile time linking to a shared library
  • dynamic mode is runtime linking at will
File size: 18.6 KB
Line 
1// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
2// http://chaosforge.org/
3//
4// This file is part of NV Libraries.
5// For conditions of distribution and use, see copyright notice in nv.hh
6
7#include "nv/lib/sdl12.hh"
8
9#if defined( NV_SDL_DYNAMIC )
10
11#include "nv/library.hh"
12
13/* SDL.h functions */
14int (NV_SDL_APIENTRY *SDL_Init) (Uint32 flags) = nullptr;
15int (NV_SDL_APIENTRY *SDL_InitSubSystem) (Uint32 flags) = nullptr;
16void (NV_SDL_APIENTRY *SDL_QuitSubSystem) (Uint32 flags) = nullptr;
17Uint32 (NV_SDL_APIENTRY *SDL_WasInit) (Uint32 flags) = nullptr;
18void (NV_SDL_APIENTRY *SDL_Quit) (void) = nullptr;
19
20/* SDL_rwops.h functions */
21SDL_RWops * (NV_SDL_APIENTRY *SDL_RWFromFile) (const char *file, const char *mode) = nullptr;
22SDL_RWops * (NV_SDL_APIENTRY *SDL_RWFromFP) (FILE *fp, int autoclose) = nullptr;
23SDL_RWops * (NV_SDL_APIENTRY *SDL_RWFromMem) (void *mem, int size) = nullptr;
24SDL_RWops * (NV_SDL_APIENTRY *SDL_RWFromConstMem) (const void *mem, int size) = nullptr;
25SDL_RWops * (NV_SDL_APIENTRY *SDL_AllocRW) (void) = nullptr;
26void (NV_SDL_APIENTRY *SDL_FreeRW) (SDL_RWops *area) = nullptr;
27Uint16 (NV_SDL_APIENTRY *SDL_ReadLE16) (SDL_RWops *src) = nullptr;
28Uint16 (NV_SDL_APIENTRY *SDL_ReadBE16) (SDL_RWops *src) = nullptr;
29Uint32 (NV_SDL_APIENTRY *SDL_ReadLE32) (SDL_RWops *src) = nullptr;
30Uint32 (NV_SDL_APIENTRY *SDL_ReadBE32) (SDL_RWops *src) = nullptr;
31Uint64 (NV_SDL_APIENTRY *SDL_ReadLE64) (SDL_RWops *src) = nullptr;
32Uint64 (NV_SDL_APIENTRY *SDL_ReadBE64) (SDL_RWops *src) = nullptr;
33int (NV_SDL_APIENTRY *SDL_WriteLE16) (SDL_RWops *dst, Uint16 value) = nullptr;
34int (NV_SDL_APIENTRY *SDL_WriteBE16) (SDL_RWops *dst, Uint16 value) = nullptr;
35int (NV_SDL_APIENTRY *SDL_WriteLE32) (SDL_RWops *dst, Uint32 value) = nullptr;
36int (NV_SDL_APIENTRY *SDL_WriteBE32) (SDL_RWops *dst, Uint32 value) = nullptr;
37int (NV_SDL_APIENTRY *SDL_WriteLE64) (SDL_RWops *dst, Uint64 value) = nullptr;
38int (NV_SDL_APIENTRY *SDL_WriteBE64) (SDL_RWops *dst, Uint64 value) = nullptr;
39
40/* SDL_video.h defines */
41int (NV_SDL_APIENTRY *SDL_VideoInit) (const char *driver_name, Uint32 flags) = nullptr;
42void (NV_SDL_APIENTRY *SDL_VideoQuit) (void) = nullptr;
43char * (NV_SDL_APIENTRY *SDL_VideoDriverName) (char *namebuf, int maxlen) = nullptr;
44SDL_Surface * (NV_SDL_APIENTRY *SDL_GetVideoSurface) (void) = nullptr;
45const SDL_VideoInfo * (NV_SDL_APIENTRY *SDL_GetVideoInfo) (void) = nullptr;
46int (NV_SDL_APIENTRY *SDL_VideoModeOK) (int width, int height, int bpp, Uint32 flags) = nullptr;
47SDL_Rect ** (NV_SDL_APIENTRY *SDL_ListModes) (SDL_PixelFormat *format, Uint32 flags) = nullptr;
48SDL_Surface * (NV_SDL_APIENTRY *SDL_SetVideoMode) (int width, int height, int bpp, Uint32 flags) = nullptr;
49void (NV_SDL_APIENTRY *SDL_UpdateRects) (SDL_Surface *screen, int numrects, SDL_Rect *rects) = nullptr;
50void (NV_SDL_APIENTRY *SDL_UpdateRect) (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h) = nullptr;
51int (NV_SDL_APIENTRY *SDL_Flip) (SDL_Surface *screen) = nullptr;
52int (NV_SDL_APIENTRY *SDL_SetGamma) (float red, float green, float blue) = nullptr;
53int (NV_SDL_APIENTRY *SDL_SetGammaRamp) (const Uint16 *red, const Uint16 *green, const Uint16 *blue) = nullptr;
54int (NV_SDL_APIENTRY *SDL_GetGammaRamp) (Uint16 *red, Uint16 *green, Uint16 *blue) = nullptr;
55int (NV_SDL_APIENTRY *SDL_SetColors) (SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors) = nullptr;
56int (NV_SDL_APIENTRY *SDL_SetPalette) (SDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors) = nullptr;
57Uint32 (NV_SDL_APIENTRY *SDL_MapRGB) (const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g, const Uint8 b) = nullptr;
58Uint32 (NV_SDL_APIENTRY *SDL_MapRGBA) (const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a) = nullptr;
59void (NV_SDL_APIENTRY *SDL_GetRGB) (Uint32 pixel, const SDL_PixelFormat * const fmt, Uint8 *r, Uint8 *g, Uint8 *b) = nullptr;
60void (NV_SDL_APIENTRY *SDL_GetRGBA) (Uint32 pixel,      const SDL_PixelFormat * const fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) = nullptr;
61SDL_Surface * (NV_SDL_APIENTRY *SDL_CreateRGBSurface) (Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) = nullptr;
62SDL_Surface * (NV_SDL_APIENTRY *SDL_CreateRGBSurfaceFrom) (void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) = nullptr;
63void (NV_SDL_APIENTRY *SDL_FreeSurface) (SDL_Surface *surface) = nullptr;
64int (NV_SDL_APIENTRY *SDL_LockSurface) (SDL_Surface *surface) = nullptr;
65void (NV_SDL_APIENTRY *SDL_UnlockSurface) (SDL_Surface *surface) = nullptr;
66SDL_Surface * (NV_SDL_APIENTRY *SDL_LoadBMP_RW) (SDL_RWops *src, int freesrc) = nullptr;
67int (NV_SDL_APIENTRY *SDL_SaveBMP_RW) (SDL_Surface *surface, SDL_RWops *dst, int freedst) = nullptr;
68int (NV_SDL_APIENTRY *SDL_SetColorKey) (SDL_Surface *surface, Uint32 flag, Uint32 key) = nullptr;
69int (NV_SDL_APIENTRY *SDL_SetAlpha) (SDL_Surface *surface, Uint32 flag, Uint8 alpha) = nullptr;
70SDL_bool (NV_SDL_APIENTRY *SDL_SetClipRect) (SDL_Surface *surface, const SDL_Rect *rect) = nullptr;
71void (NV_SDL_APIENTRY *SDL_GetClipRect) (SDL_Surface *surface, SDL_Rect *rect) = nullptr;
72SDL_Surface * (NV_SDL_APIENTRY *SDL_ConvertSurface) (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags) = nullptr;
73int (NV_SDL_APIENTRY *SDL_UpperBlit) (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) = nullptr;
74int (NV_SDL_APIENTRY *SDL_LowerBlit) (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) = nullptr;
75int (NV_SDL_APIENTRY *SDL_FillRect) (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color) = nullptr;
76SDL_Surface * (NV_SDL_APIENTRY *SDL_DisplayFormat) (SDL_Surface *surface) = nullptr;
77SDL_Surface * (NV_SDL_APIENTRY *SDL_DisplayFormatAlpha) (SDL_Surface *surface) = nullptr;
78SDL_Overlay * (NV_SDL_APIENTRY *SDL_CreateYUVOverlay) (int width, int height, Uint32 format, SDL_Surface *display) = nullptr;
79int (NV_SDL_APIENTRY *SDL_LockYUVOverlay) (SDL_Overlay *overlay) = nullptr;
80void (NV_SDL_APIENTRY *SDL_UnlockYUVOverlay) (SDL_Overlay *overlay) = nullptr;
81int (NV_SDL_APIENTRY *SDL_DisplayYUVOverlay) (SDL_Overlay *overlay, SDL_Rect *dstrect) = nullptr;
82void (NV_SDL_APIENTRY *SDL_FreeYUVOverlay) (SDL_Overlay *overlay) = nullptr;
83int (NV_SDL_APIENTRY *SDL_GL_LoadLibrary) (const char *path) = nullptr;
84void * (NV_SDL_APIENTRY *SDL_GL_GetProcAddress) (const char* proc) = nullptr;
85int (NV_SDL_APIENTRY *SDL_GL_SetAttribute) (SDL_GLattr attr, int value) = nullptr;
86int (NV_SDL_APIENTRY *SDL_GL_GetAttribute) (SDL_GLattr attr, int* value) = nullptr;
87void (NV_SDL_APIENTRY *SDL_GL_SwapBuffers) (void) = nullptr;
88void (NV_SDL_APIENTRY *SDL_GL_UpdateRects) (int numrects, SDL_Rect* rects) = nullptr;
89void (NV_SDL_APIENTRY *SDL_GL_Lock) (void) = nullptr;
90void (NV_SDL_APIENTRY *SDL_GL_Unlock) (void) = nullptr;
91void (NV_SDL_APIENTRY *SDL_WM_SetCaption) (const char *title, const char *icon) = nullptr;
92void (NV_SDL_APIENTRY *SDL_WM_GetCaption) (char **title, char **icon) = nullptr;
93void (NV_SDL_APIENTRY *SDL_WM_SetIcon) (SDL_Surface *icon, Uint8 *mask) = nullptr;
94int (NV_SDL_APIENTRY *SDL_WM_IconifyWindow) (void) = nullptr;
95int (NV_SDL_APIENTRY *SDL_WM_ToggleFullScreen) (SDL_Surface *surface) = nullptr;
96SDL_GrabMode (NV_SDL_APIENTRY *SDL_WM_GrabInput) (SDL_GrabMode mode) = nullptr;
97
98/* SDL_audio.h functions */
99int (NV_SDL_APIENTRY *SDL_AudioInit) (const char *driver_name) = nullptr;
100void (NV_SDL_APIENTRY *SDL_AudioQuit) (void) = nullptr;
101char * (NV_SDL_APIENTRY *SDL_AudioDriverName) (char *namebuf, int maxlen) = nullptr;
102int (NV_SDL_APIENTRY *SDL_OpenAudio) (SDL_AudioSpec *desired, SDL_AudioSpec *obtained) = nullptr;
103SDL_audiostatus (NV_SDL_APIENTRY *SDL_GetAudioStatus) (void) = nullptr;
104void (NV_SDL_APIENTRY *SDL_PauseAudio) (int pause_on) = nullptr;
105SDL_AudioSpec * (NV_SDL_APIENTRY *SDL_LoadWAV_RW) (SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) = nullptr;
106void (NV_SDL_APIENTRY *SDL_FreeWAV) (Uint8 *audio_buf) = nullptr;
107int (NV_SDL_APIENTRY *SDL_BuildAudioCVT) (SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate) = nullptr;
108int (NV_SDL_APIENTRY *SDL_ConvertAudio) (SDL_AudioCVT *cvt) = nullptr;
109void (NV_SDL_APIENTRY *SDL_MixAudio) (Uint8 *dst, const Uint8 *src, Uint32 len, int volume) = nullptr;
110void (NV_SDL_APIENTRY *SDL_LockAudio) (void) = nullptr;
111void (NV_SDL_APIENTRY *SDL_UnlockAudio) (void) = nullptr;
112void (NV_SDL_APIENTRY *SDL_CloseAudio) (void) = nullptr; 
113
114/* SDL_cpuinfo.h functions */
115SDL_bool (NV_SDL_APIENTRY *SDL_HasRDTSC) (void) = nullptr;
116SDL_bool (NV_SDL_APIENTRY *SDL_HasMMX) (void) = nullptr;
117SDL_bool (NV_SDL_APIENTRY *SDL_HasMMXExt) (void) = nullptr;
118SDL_bool (NV_SDL_APIENTRY *SDL_Has3DNow) (void) = nullptr;
119SDL_bool (NV_SDL_APIENTRY *SDL_Has3DNowExt) (void) = nullptr;
120SDL_bool (NV_SDL_APIENTRY *SDL_HasSSE) (void) = nullptr;
121SDL_bool (NV_SDL_APIENTRY *SDL_HasSSE2) (void) = nullptr;
122SDL_bool (NV_SDL_APIENTRY *SDL_HasAltiVec) (void) = nullptr;
123
124/* SDL_error.h functions */
125void (NV_SDL_APIENTRY *SDL_SetError) (const char *fmt, ...) = nullptr;
126char * (NV_SDL_APIENTRY *SDL_GetError) (void) = nullptr;
127void (NV_SDL_APIENTRY *SDL_ClearError) (void) = nullptr;
128void (NV_SDL_APIENTRY *SDL_Error) (SDL_errorcode code) = nullptr;
129
130/* SDL_active.h functions */
131Uint8 (NV_SDL_APIENTRY *SDL_GetAppState) (void) = nullptr;
132
133/* SDL_keyboard.h functions */
134int (NV_SDL_APIENTRY *SDL_EnableUNICODE) (int enable) = nullptr;
135int (NV_SDL_APIENTRY *SDL_EnableKeyRepeat) (int delay, int interval) = nullptr;
136void (NV_SDL_APIENTRY *SDL_GetKeyRepeat) (int *delay, int *interval) = nullptr;
137Uint8 * (NV_SDL_APIENTRY *SDL_GetKeyState) (int *numkeys) = nullptr;
138SDLMod (NV_SDL_APIENTRY *SDL_GetModState) (void) = nullptr;
139void (NV_SDL_APIENTRY *SDL_SetModState) (SDLMod modstate) = nullptr;
140char * (NV_SDL_APIENTRY *SDL_GetKeyName) (SDLKey key) = nullptr;
141 
142/* SDL_mouse.h functions */
143Uint8 (NV_SDL_APIENTRY *SDL_GetMouseState) (int *x, int *y) = nullptr;
144Uint8 (NV_SDL_APIENTRY *SDL_GetRelativeMouseState) (int *x, int *y) = nullptr;
145void (NV_SDL_APIENTRY *SDL_WarpMouse) (Uint16 x, Uint16 y) = nullptr;
146SDL_Cursor * (NV_SDL_APIENTRY *SDL_CreateCursor) (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y) = nullptr;
147void (NV_SDL_APIENTRY *SDL_SetCursor) (SDL_Cursor *cursor) = nullptr;
148SDL_Cursor * (NV_SDL_APIENTRY *SDL_GetCursor) (void) = nullptr;
149void (NV_SDL_APIENTRY *SDL_FreeCursor) (SDL_Cursor *cursor) = nullptr;
150int (NV_SDL_APIENTRY *SDL_ShowCursor) (int toggle) = nullptr;
151
152/* SDL_joystick.h functions */
153int (NV_SDL_APIENTRY *SDL_NumJoysticks) (void) = nullptr;
154const char * (NV_SDL_APIENTRY *SDL_JoystickName) (int device_index) = nullptr;
155SDL_Joystick * (NV_SDL_APIENTRY *SDL_JoystickOpen) (int device_index) = nullptr;
156int (NV_SDL_APIENTRY *SDL_JoystickOpened) (int device_index) = nullptr;
157int (NV_SDL_APIENTRY *SDL_JoystickIndex) (SDL_Joystick *joystick) = nullptr;
158int (NV_SDL_APIENTRY *SDL_JoystickNumAxes) (SDL_Joystick *joystick) = nullptr;
159int (NV_SDL_APIENTRY *SDL_JoystickNumBalls) (SDL_Joystick *joystick) = nullptr;
160int (NV_SDL_APIENTRY *SDL_JoystickNumHats) (SDL_Joystick *joystick) = nullptr;
161int (NV_SDL_APIENTRY *SDL_JoystickNumButtons) (SDL_Joystick *joystick) = nullptr;
162void (NV_SDL_APIENTRY *SDL_JoystickUpdate) (void) = nullptr;
163int (NV_SDL_APIENTRY *SDL_JoystickEventState) (int state) = nullptr;
164Sint16 (NV_SDL_APIENTRY *SDL_JoystickGetAxis) (SDL_Joystick *joystick, int axis) = nullptr;
165Uint8 (NV_SDL_APIENTRY *SDL_JoystickGetHat) (SDL_Joystick *joystick, int hat) = nullptr;
166int (NV_SDL_APIENTRY *SDL_JoystickGetBall) (SDL_Joystick *joystick, int ball, int *dx, int *dy) = nullptr;
167Uint8 (NV_SDL_APIENTRY *SDL_JoystickGetButton) (SDL_Joystick *joystick, int button) = nullptr;
168void (NV_SDL_APIENTRY *SDL_JoystickClose) (SDL_Joystick *joystick) = nullptr;
169
170/* SDL_event.h functions */
171void (NV_SDL_APIENTRY *SDL_PumpEvents) (void) = nullptr;
172int (NV_SDL_APIENTRY *SDL_PeepEvents) (SDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask)  = nullptr;
173int (NV_SDL_APIENTRY *SDL_PollEvent) (SDL_Event *event) = nullptr;
174int (NV_SDL_APIENTRY *SDL_WaitEvent) (SDL_Event *event) = nullptr;
175int (NV_SDL_APIENTRY *SDL_PushEvent) (SDL_Event *event) = nullptr;
176void (NV_SDL_APIENTRY *SDL_SetEventFilter) (SDL_EventFilter filter) = nullptr;
177SDL_EventFilter (NV_SDL_APIENTRY *SDL_GetEventFilter) (void) = nullptr;
178Uint8 (NV_SDL_APIENTRY *SDL_EventState) (Uint8 type, int state) = nullptr;
179
180/* SDL_timer.h functions */
181Uint32 (NV_SDL_APIENTRY *SDL_GetTicks) (void) = nullptr;
182void (NV_SDL_APIENTRY *SDL_Delay) (Uint32 ms) = nullptr;
183int (NV_SDL_APIENTRY *SDL_SetTimer) (Uint32 interval, SDL_TimerCallback callback) = nullptr;
184SDL_TimerID (NV_SDL_APIENTRY *SDL_AddTimer) (Uint32 interval, SDL_NewTimerCallback callback, void *param) = nullptr;
185SDL_bool (NV_SDL_APIENTRY *SDL_RemoveTimer) (SDL_TimerID t) = nullptr;
186
187/* SDL_version.h functions */
188const SDL_version * (NV_SDL_APIENTRY *SDL_Linked_Version) (void) = nullptr;
189
190bool nv::load_sdl_library( const char* path )
191{
192#       define NV_SDL_LOAD( symbol ) *(void **) (&symbol) = sdl_library.get(#symbol);
193        static nv::library sdl_library( path );
194
195/* SDL.h functions */
196        NV_SDL_LOAD( SDL_Init );
197        NV_SDL_LOAD( SDL_InitSubSystem );
198        NV_SDL_LOAD( SDL_QuitSubSystem );
199        NV_SDL_LOAD( SDL_WasInit );
200        NV_SDL_LOAD( SDL_Quit );
201
202/* SDL_rwops.h functions */
203        NV_SDL_LOAD( SDL_RWFromFile );
204        NV_SDL_LOAD( SDL_RWFromFP );
205        NV_SDL_LOAD( SDL_RWFromMem );
206        NV_SDL_LOAD( SDL_RWFromConstMem );
207        NV_SDL_LOAD( SDL_AllocRW );
208        NV_SDL_LOAD( SDL_FreeRW );
209        NV_SDL_LOAD( SDL_ReadLE16 );
210        NV_SDL_LOAD( SDL_ReadBE16 );
211        NV_SDL_LOAD( SDL_ReadLE32 );
212        NV_SDL_LOAD( SDL_ReadBE32 );
213        NV_SDL_LOAD( SDL_ReadLE64 );
214        NV_SDL_LOAD( SDL_ReadBE64 );
215        NV_SDL_LOAD( SDL_WriteLE16 );
216        NV_SDL_LOAD( SDL_WriteBE16 );
217        NV_SDL_LOAD( SDL_WriteLE32 );
218        NV_SDL_LOAD( SDL_WriteBE32 );
219        NV_SDL_LOAD( SDL_WriteLE64 );
220        NV_SDL_LOAD( SDL_WriteBE64 );
221
222/* SDL_video.h defines */
223        NV_SDL_LOAD( SDL_VideoInit );
224        NV_SDL_LOAD( SDL_VideoQuit );
225        NV_SDL_LOAD( SDL_VideoDriverName );
226        NV_SDL_LOAD( SDL_GetVideoSurface );
227        NV_SDL_LOAD( SDL_GetVideoInfo );
228        NV_SDL_LOAD( SDL_VideoModeOK );
229        NV_SDL_LOAD( SDL_ListModes );
230        NV_SDL_LOAD( SDL_SetVideoMode );
231        NV_SDL_LOAD( SDL_UpdateRects );
232        NV_SDL_LOAD( SDL_UpdateRect );
233        NV_SDL_LOAD( SDL_Flip );
234        NV_SDL_LOAD( SDL_SetGamma );
235        NV_SDL_LOAD( SDL_SetGammaRamp );
236        NV_SDL_LOAD( SDL_GetGammaRamp );
237        NV_SDL_LOAD( SDL_SetColors );
238        NV_SDL_LOAD( SDL_SetPalette );
239        NV_SDL_LOAD( SDL_MapRGB );
240        NV_SDL_LOAD( SDL_MapRGBA );
241        NV_SDL_LOAD( SDL_GetRGB );
242        NV_SDL_LOAD( SDL_GetRGBA );
243        NV_SDL_LOAD( SDL_CreateRGBSurface );
244        NV_SDL_LOAD( SDL_CreateRGBSurfaceFrom );
245        NV_SDL_LOAD( SDL_FreeSurface );
246        NV_SDL_LOAD( SDL_LockSurface );
247        NV_SDL_LOAD( SDL_UnlockSurface );
248        NV_SDL_LOAD( SDL_LoadBMP_RW );
249        NV_SDL_LOAD( SDL_SaveBMP_RW );
250        NV_SDL_LOAD( SDL_SetColorKey );
251        NV_SDL_LOAD( SDL_SetAlpha );
252        NV_SDL_LOAD( SDL_SetClipRect );
253        NV_SDL_LOAD( SDL_GetClipRect );
254        NV_SDL_LOAD( SDL_ConvertSurface );
255        NV_SDL_LOAD( SDL_UpperBlit );
256        NV_SDL_LOAD( SDL_LowerBlit );
257        NV_SDL_LOAD( SDL_FillRect );
258        NV_SDL_LOAD( SDL_DisplayFormat );
259        NV_SDL_LOAD( SDL_DisplayFormatAlpha );
260        NV_SDL_LOAD( SDL_CreateYUVOverlay );
261        NV_SDL_LOAD( SDL_LockYUVOverlay );
262        NV_SDL_LOAD( SDL_UnlockYUVOverlay );
263        NV_SDL_LOAD( SDL_DisplayYUVOverlay );
264        NV_SDL_LOAD( SDL_FreeYUVOverlay );
265        NV_SDL_LOAD( SDL_GL_LoadLibrary );
266        NV_SDL_LOAD( SDL_GL_GetProcAddress );
267        NV_SDL_LOAD( SDL_GL_SetAttribute );
268        NV_SDL_LOAD( SDL_GL_GetAttribute );
269        NV_SDL_LOAD( SDL_GL_SwapBuffers );
270        NV_SDL_LOAD( SDL_GL_UpdateRects );
271        NV_SDL_LOAD( SDL_GL_Lock );
272        NV_SDL_LOAD( SDL_GL_Unlock );
273        NV_SDL_LOAD( SDL_WM_SetCaption );
274        NV_SDL_LOAD( SDL_WM_GetCaption );
275        NV_SDL_LOAD( SDL_WM_SetIcon );
276        NV_SDL_LOAD( SDL_WM_IconifyWindow );
277        NV_SDL_LOAD( SDL_WM_ToggleFullScreen );
278        NV_SDL_LOAD( SDL_WM_GrabInput );
279
280/* SDL_audio.h functions */
281        NV_SDL_LOAD( SDL_AudioInit );
282        NV_SDL_LOAD( SDL_AudioQuit );
283        NV_SDL_LOAD( SDL_AudioDriverName );
284        NV_SDL_LOAD( SDL_OpenAudio );
285        NV_SDL_LOAD( SDL_GetAudioStatus );
286        NV_SDL_LOAD( SDL_PauseAudio );
287        NV_SDL_LOAD( SDL_LoadWAV_RW );
288        NV_SDL_LOAD( SDL_FreeWAV );
289        NV_SDL_LOAD( SDL_BuildAudioCVT );
290        NV_SDL_LOAD( SDL_ConvertAudio );
291        NV_SDL_LOAD( SDL_MixAudio );
292        NV_SDL_LOAD( SDL_LockAudio );
293        NV_SDL_LOAD( SDL_UnlockAudio );
294        NV_SDL_LOAD( SDL_CloseAudio ); 
295
296/* SDL_cpuinfo.h functions */
297        NV_SDL_LOAD( SDL_HasRDTSC );
298        NV_SDL_LOAD( SDL_HasMMX );
299        NV_SDL_LOAD( SDL_HasMMXExt );
300        NV_SDL_LOAD( SDL_Has3DNow );
301        NV_SDL_LOAD( SDL_Has3DNowExt );
302        NV_SDL_LOAD( SDL_HasSSE );
303        NV_SDL_LOAD( SDL_HasSSE2 );
304        NV_SDL_LOAD( SDL_HasAltiVec );
305
306/* SDL_error.h functions */
307        NV_SDL_LOAD( SDL_SetError );
308        NV_SDL_LOAD( SDL_GetError );
309        NV_SDL_LOAD( SDL_ClearError );
310        NV_SDL_LOAD( SDL_Error );
311
312/* SDL_active.h functions */
313        NV_SDL_LOAD( SDL_GetAppState );
314
315/* SDL_keyboard.h functions */
316        NV_SDL_LOAD( SDL_EnableUNICODE );
317        NV_SDL_LOAD( SDL_EnableKeyRepeat );
318        NV_SDL_LOAD( SDL_GetKeyRepeat );
319        NV_SDL_LOAD( SDL_GetKeyState );
320        NV_SDL_LOAD( SDL_GetModState );
321        NV_SDL_LOAD( SDL_SetModState );
322        NV_SDL_LOAD( SDL_GetKeyName );
323 
324/* SDL_mouse.h functions */
325        NV_SDL_LOAD( SDL_GetMouseState );
326        NV_SDL_LOAD( SDL_GetRelativeMouseState );
327        NV_SDL_LOAD( SDL_WarpMouse );
328        NV_SDL_LOAD( SDL_CreateCursor );
329        NV_SDL_LOAD( SDL_SetCursor );
330        NV_SDL_LOAD( SDL_GetCursor );
331        NV_SDL_LOAD( SDL_FreeCursor );
332        NV_SDL_LOAD( SDL_ShowCursor );
333
334/* SDL_joystick.h functions */
335        NV_SDL_LOAD( SDL_NumJoysticks );
336        NV_SDL_LOAD( SDL_JoystickName );
337        NV_SDL_LOAD( SDL_JoystickOpen );
338        NV_SDL_LOAD( SDL_JoystickOpened );
339        NV_SDL_LOAD( SDL_JoystickIndex );
340        NV_SDL_LOAD( SDL_JoystickNumAxes );
341        NV_SDL_LOAD( SDL_JoystickNumBalls );
342        NV_SDL_LOAD( SDL_JoystickNumHats );
343        NV_SDL_LOAD( SDL_JoystickNumButtons );
344        NV_SDL_LOAD( SDL_JoystickUpdate );
345        NV_SDL_LOAD( SDL_JoystickEventState );
346        NV_SDL_LOAD( SDL_JoystickGetAxis );
347        NV_SDL_LOAD( SDL_JoystickGetHat );
348        NV_SDL_LOAD( SDL_JoystickGetBall );
349        NV_SDL_LOAD( SDL_JoystickGetButton );
350        NV_SDL_LOAD( SDL_JoystickClose );
351
352/* SDL_timer.h functions */
353        NV_SDL_LOAD( SDL_GetTicks );
354        NV_SDL_LOAD( SDL_Delay );
355        NV_SDL_LOAD( SDL_SetTimer );
356        NV_SDL_LOAD( SDL_AddTimer );
357        NV_SDL_LOAD( SDL_RemoveTimer );
358
359/* SDL_version.h functions */
360        NV_SDL_LOAD( SDL_Linked_Version );
361
362/* SDL_event.h functions */
363        NV_SDL_LOAD( SDL_PumpEvents );
364        NV_SDL_LOAD( SDL_PeepEvents );
365        NV_SDL_LOAD( SDL_PollEvent );
366        NV_SDL_LOAD( SDL_WaitEvent );
367        NV_SDL_LOAD( SDL_PushEvent );
368        NV_SDL_LOAD( SDL_SetEventFilter );
369        NV_SDL_LOAD( SDL_GetEventFilter );
370        NV_SDL_LOAD( SDL_EventState );
371
372#       undef NV_SDL_LOAD
373        return true;
374}
375#endif
Note: See TracBrowser for help on using the repository browser.