Changeset 168 for trunk/src/lib/sdl12.cc


Ignore:
Timestamp:
07/17/13 05:20:15 (12 years ago)
Author:
epyon
Message:
  • sdl and sdl_image - using new function loading method
  • sdl - started modifing towards 2.0 support
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/sdl12.cc

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