- Timestamp:
- 08/26/14 15:44:32 (11 years ago)
- Location:
- trunk/nv/lib
- Files:
-
- 4 deleted
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/lib/detail/sdl_functions.inc
r171 r325 103 103 NV_SDL_FUN( int, SDL_GL_GetAttribute, (SDL_GLattr attr, int* value) ); 104 104 105 /* SDL_video.h defines */ 106 NV_SDL_FUN( int , SDL_GetNumVideoDrivers, (void) ); 107 NV_SDL_FUN( const char *, SDL_GetVideoDriver, (int index) ); 108 NV_SDL_FUN( int , SDL_VideoInit, (const char *driver_name) ); 109 NV_SDL_FUN( void , SDL_VideoQuit, (void) ); 110 NV_SDL_FUN( const char *, SDL_GetCurrentVideoDriver, (void) ); 111 NV_SDL_FUN( int , SDL_GetNumVideoDisplays, (void) ); 112 NV_SDL_FUN( const char * , SDL_GetDisplayName, (int displayIndex) ); 113 NV_SDL_FUN( int , SDL_GetDisplayBounds, (int displayIndex, SDL_Rect * rect) ); 114 NV_SDL_FUN( int , SDL_GetNumDisplayModes, (int displayIndex) ); 115 NV_SDL_FUN( int , SDL_GetDisplayMode, (int displayIndex, int modeIndex,SDL_DisplayMode * mode) ); 116 NV_SDL_FUN( int , SDL_GetDesktopDisplayMode, (int displayIndex, SDL_DisplayMode * mode) ); 117 NV_SDL_FUN( int , SDL_GetCurrentDisplayMode, (int displayIndex, SDL_DisplayMode * mode) ); 118 NV_SDL_FUN( SDL_DisplayMode * , SDL_GetClosestDisplayMode, (int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest) ); 119 NV_SDL_FUN( int , SDL_GetWindowDisplayIndex, (SDL_Window * window) ); 120 NV_SDL_FUN( int , SDL_SetWindowDisplayMode, (SDL_Window * window,const SDL_DisplayMode* mode) ); 121 NV_SDL_FUN( int , SDL_GetWindowDisplayMode, (SDL_Window * window,SDL_DisplayMode * mode) ); 122 NV_SDL_FUN( Uint32 , SDL_GetWindowPixelFormat, (SDL_Window * window) ); 123 NV_SDL_FUN( SDL_Window * , SDL_CreateWindow, (const char *title,int x, int y, int w,int h, Uint32 flags) ); 124 NV_SDL_FUN( SDL_Window * , SDL_CreateWindowFrom, (const void *data) ); 125 NV_SDL_FUN( Uint32 , SDL_GetWindowID, (SDL_Window * window) ); 126 NV_SDL_FUN( SDL_Window * , SDL_GetWindowFromID, (Uint32 id) ); 127 NV_SDL_FUN( Uint32 , SDL_GetWindowFlags, (SDL_Window * window) ); 128 NV_SDL_FUN( void , SDL_SetWindowTitle, (SDL_Window * window,const char *title) ); 129 NV_SDL_FUN( const char *, SDL_GetWindowTitle, (SDL_Window * window) ); 130 NV_SDL_FUN( void , SDL_SetWindowIcon, (SDL_Window * window,SDL_Surface * icon) ); 131 NV_SDL_FUN( void* , SDL_SetWindowData, (SDL_Window * window,const char *name,void *userdata) ); 132 NV_SDL_FUN( void *, SDL_GetWindowData, (SDL_Window * window,const char *name) ); 133 NV_SDL_FUN( void , SDL_SetWindowPosition, (SDL_Window * window,int x, int y) ); 134 NV_SDL_FUN( void , SDL_GetWindowPosition, (SDL_Window * window,int *x, int *y) ); 135 NV_SDL_FUN( void , SDL_SetWindowSize, (SDL_Window * window, int w,int h) ); 136 NV_SDL_FUN( void , SDL_GetWindowSize, (SDL_Window * window, int *w,int *h) ); 137 NV_SDL_FUN( void , SDL_SetWindowMinimumSize, (SDL_Window * window,int min_w, int min_h) ); 138 NV_SDL_FUN( void , SDL_GetWindowMinimumSize, (SDL_Window * window,int *w, int *h) ); 139 NV_SDL_FUN( void , SDL_SetWindowMaximumSize, (SDL_Window * window,int max_w, int max_h) ); 140 NV_SDL_FUN( void , SDL_GetWindowMaximumSize, (SDL_Window * window,int *w, int *h) ); 141 NV_SDL_FUN( void , SDL_SetWindowBordered, (SDL_Window * window,SDL_bool bordered) ); 142 NV_SDL_FUN( void , SDL_ShowWindow, (SDL_Window * window) ); 143 NV_SDL_FUN( void , SDL_HideWindow, (SDL_Window * window) ); 144 NV_SDL_FUN( void , SDL_RaiseWindow, (SDL_Window * window) ); 145 NV_SDL_FUN( void , SDL_MaximizeWindow, (SDL_Window * window) ); 146 NV_SDL_FUN( void , SDL_MinimizeWindow, (SDL_Window * window) ); 147 NV_SDL_FUN( void , SDL_RestoreWindow, (SDL_Window * window) ); 148 NV_SDL_FUN( int , SDL_SetWindowFullscreen, (SDL_Window * window,Uint32 flags) ); 149 NV_SDL_FUN( SDL_Surface * , SDL_GetWindowSurface, (SDL_Window * window) ); 150 NV_SDL_FUN( int , SDL_UpdateWindowSurface, (SDL_Window * window) ); 151 NV_SDL_FUN( int , SDL_UpdateWindowSurfaceRects, (SDL_Window * window,const SDL_Rect * rects,int numrects) ); 152 NV_SDL_FUN( void , SDL_SetWindowGrab, (SDL_Window * window,SDL_bool grabbed) ); 153 NV_SDL_FUN( SDL_bool , SDL_GetWindowGrab, (SDL_Window * window) ); 154 NV_SDL_FUN( int , SDL_SetWindowBrightness, (SDL_Window * window, float brightness) ); 155 NV_SDL_FUN( float , SDL_GetWindowBrightness, (SDL_Window * window) ); 156 NV_SDL_FUN( int , SDL_SetWindowGammaRamp, (SDL_Window * window,const Uint16 * red,const Uint16 * green,const Uint16 * blue) ); 157 NV_SDL_FUN( int , SDL_GetWindowGammaRamp, (SDL_Window * window,Uint16 * red,Uint16 * green,Uint16 * blue) ); 158 NV_SDL_FUN( void , SDL_DestroyWindow, (SDL_Window * window) ); 159 NV_SDL_FUN( SDL_bool , SDL_IsScreenSaverEnabled, (void) ); 160 NV_SDL_FUN( void , SDL_EnableScreenSaver, (void) ); 161 NV_SDL_FUN( void , SDL_DisableScreenSaver, (void) ); 162 NV_SDL_FUN( void , SDL_GL_UnloadLibrary, (void) ); 163 NV_SDL_FUN( SDL_bool , SDL_GL_ExtensionSupported, (const char*extension) ); 164 NV_SDL_FUN( SDL_GLContext , SDL_GL_CreateContext, (SDL_Window *window) ); 165 NV_SDL_FUN( int , SDL_GL_MakeCurrent, (SDL_Window * window,SDL_GLContext context) ); 166 NV_SDL_FUN( SDL_Window* , SDL_GL_GetCurrentWindow, (void) ); 167 NV_SDL_FUN( SDL_GLContext , SDL_GL_GetCurrentContext, (void) ); 168 NV_SDL_FUN( int , SDL_GL_SetSwapInterval, (int interval) ); 169 NV_SDL_FUN( int , SDL_GL_GetSwapInterval, (void) ); 170 NV_SDL_FUN( void , SDL_GL_SwapWindow, (SDL_Window * window) ); 171 NV_SDL_FUN( void , SDL_GL_DeleteContext, (SDL_GLContext context) ); 172 173 /* SDL_audio.h functions */ 174 NV_SDL_FUN( int , SDL_GetNumAudioDrivers, (void) ); 175 NV_SDL_FUN( const char *, SDL_GetAudioDriver, (int index) ); 176 NV_SDL_FUN( const char *, SDL_GetCurrentAudioDriver, (void) ); 177 NV_SDL_FUN( int , SDL_GetNumAudioDevices, (int iscapture) ); 178 NV_SDL_FUN( const char *, SDL_GetAudioDeviceName, (int index, int iscapture) ); 179 NV_SDL_FUN( SDL_AudioDeviceID , SDL_OpenAudioDevice, (const char *device, int iscapture, const SDL_AudioSpec * desired, SDL_AudioSpec * obtained, int allowed_changes) ); 180 NV_SDL_FUN( SDL_AudioStatus , SDL_GetAudioDeviceStatus, (SDL_AudioDeviceID dev) ); 181 NV_SDL_FUN( void , SDL_PauseAudioDevice, (SDL_AudioDeviceID dev, int pause_on) ); 182 NV_SDL_FUN( void , SDL_MixAudioFormat, (Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, Uint32 len, int volume) ); 183 NV_SDL_FUN( void , SDL_LockAudioDevice, (SDL_AudioDeviceID dev) ); 184 NV_SDL_FUN( void , SDL_UnlockAudioDevice, (SDL_AudioDeviceID dev) ); 185 NV_SDL_FUN( void , SDL_CloseAudioDevice, (SDL_AudioDeviceID dev) ); 186 // NV_SDL_FUN( int , SDL_AudioDeviceConnected, (SDL_AudioDeviceID dev) ); 187 188 /* SDL_cpuinfo.h functions */ 189 NV_SDL_FUN( int , SDL_GetCPUCount, (void) ); 190 NV_SDL_FUN( int , SDL_GetCPUCacheLineSize, (void) ); 191 NV_SDL_FUN( SDL_bool, SDL_HasSSE3, (void) ); 192 NV_SDL_FUN( SDL_bool, SDL_HasSSE41, (void) ); 193 NV_SDL_FUN( SDL_bool, SDL_HasSSE42, (void) ); 194 195 /* SDL_error.h functions */ 196 NV_SDL_FUN( int, SDL_SetError, (const char *fmt, ...) ); 197 NV_SDL_FUN( int, SDL_Error, (SDL_errorcode code) ); 198 199 /* SDL_keyboard.h functions */ 200 NV_SDL_FUN( SDL_Window * , SDL_GetKeyboardFocus, (void) ); 201 NV_SDL_FUN( const Uint8 *, SDL_GetKeyboardState, (int *numkeys) ); 202 NV_SDL_FUN( SDL_Keymod , SDL_GetModState, (void) ); 203 NV_SDL_FUN( void , SDL_SetModState, (SDL_Keymod modstate) ); 204 NV_SDL_FUN( SDL_Keycode , SDL_GetKeyFromScancode, (SDL_Scancode scancode) ); 205 NV_SDL_FUN( SDL_Scancode , SDL_GetScancodeFromKey, (SDL_Keycode key) ); 206 NV_SDL_FUN( const char *, SDL_GetScancodeName, (SDL_Scancode scancode) ); 207 NV_SDL_FUN( SDL_Scancode , SDL_GetScancodeFromName, (const char *name) ); 208 NV_SDL_FUN( const char *, SDL_GetKeyName, (SDL_Keycode key) ); 209 NV_SDL_FUN( SDL_Keycode , SDL_GetKeyFromName, (const char *name) ); 210 NV_SDL_FUN( void , SDL_StartTextInput, (void) ); 211 NV_SDL_FUN( SDL_bool , SDL_IsTextInputActive, (void) ); 212 NV_SDL_FUN( void , SDL_StopTextInput, (void) ); 213 NV_SDL_FUN( void , SDL_SetTextInputRect, (SDL_Rect *rect) ); 214 NV_SDL_FUN( SDL_bool , SDL_HasScreenKeyboardSupport, (void) ); 215 NV_SDL_FUN( SDL_bool , SDL_IsScreenKeyboardShown, (SDL_Window *window) ); 216 217 /* SDL_mouse.h functions */ 218 NV_SDL_FUN( SDL_Window * , SDL_GetMouseFocus, (void) ); 219 NV_SDL_FUN( Uint32 , SDL_GetMouseState, (int *x, int *y) ); 220 NV_SDL_FUN( Uint32 , SDL_GetRelativeMouseState, (int *x, int *y) ); 221 NV_SDL_FUN( void , SDL_WarpMouseInWindow, (SDL_Window * window,int x, int y) ); 222 NV_SDL_FUN( int , SDL_SetRelativeMouseMode, (SDL_bool enabled) ); 223 NV_SDL_FUN( SDL_bool , SDL_GetRelativeMouseMode, (void) ); 224 NV_SDL_FUN( SDL_Cursor *, SDL_CreateCursor, (const Uint8 * data,const Uint8 * mask,int w, int h, int hot_x,int hot_y) ); 225 NV_SDL_FUN( SDL_Cursor *, SDL_CreateColorCursor, (SDL_Surface *surface,int hot_x,int hot_y) ); 226 NV_SDL_FUN( SDL_Cursor *, SDL_CreateSystemCursor, (SDL_SystemCursor id) ); 227 NV_SDL_FUN( SDL_Cursor *, SDL_GetDefaultCursor, (void) ); 228 229 NV_SDL_FUN( const char *, SDL_JoystickName, (SDL_Joystick * joystick) ); 230 NV_SDL_FUN( const char *, SDL_JoystickNameForIndex, (int device_index) ); 231 NV_SDL_FUN( SDL_JoystickGUID , SDL_JoystickGetDeviceGUID, (int device_index) ); 232 NV_SDL_FUN( SDL_JoystickGUID , SDL_JoystickGetGUID, (SDL_Joystick * joystick) ); 233 NV_SDL_FUN( void, SDL_JoystickGetGUIDString, (SDL_JoystickGUID guid, char *pszGUID, int cbGUID) ); 234 NV_SDL_FUN( SDL_JoystickGUID , SDL_JoystickGetGUIDFromString, (const char *pchGUID) ); 235 NV_SDL_FUN( SDL_bool , SDL_JoystickGetAttached, (SDL_Joystick * joystick) ); 236 NV_SDL_FUN( SDL_JoystickID , SDL_JoystickInstanceID, (SDL_Joystick * joystick) ); 237 238 NV_SDL_FUN( Uint64 , SDL_GetPerformanceCounter, (void) ); 239 NV_SDL_FUN( Uint64 , SDL_GetPerformanceFrequency, (void) ); 240 241 /* SDL_version.h functions */ 242 NV_SDL_FUN( void , SDL_GetVersion, (SDL_version * ver) ); 243 NV_SDL_FUN( const char *, SDL_GetRevision, (void) ); 244 NV_SDL_FUN( int , SDL_GetRevisionNumber, (void) ); 245 246 /* SDL_event.h functions */ 247 NV_SDL_FUN( int , SDL_PeepEvents, (SDL_Event * events, int numevents,SDL_eventaction action,Uint32 minType, Uint32 maxType) ); 248 NV_SDL_FUN( SDL_bool , SDL_HasEvent, (Uint32 type) ); 249 NV_SDL_FUN( SDL_bool , SDL_HasEvents, (Uint32 minType, Uint32 maxType) ); 250 NV_SDL_FUN( void , SDL_FlushEvent, (Uint32 type) ); 251 NV_SDL_FUN( void , SDL_FlushEvents, (Uint32 minType, Uint32 maxType) ); 252 NV_SDL_FUN( int , SDL_WaitEventTimeout, (SDL_Event * event,int timeout) ); 253 NV_SDL_FUN( void , SDL_SetEventFilter, (SDL_EventFilter filter,void *userdata) ); 254 NV_SDL_FUN( SDL_bool , SDL_GetEventFilter, (SDL_EventFilter * filter,void **userdata) ); 255 NV_SDL_FUN( void , SDL_AddEventWatch, (SDL_EventFilter filter,void *userdata) ); 256 NV_SDL_FUN( void , SDL_DelEventWatch, (SDL_EventFilter filter,void *userdata) ); 257 NV_SDL_FUN( void , SDL_FilterEvents, (SDL_EventFilter filter,void *userdata) ); 258 NV_SDL_FUN( Uint8 , SDL_EventState, (Uint32 type, int state) ); 259 NV_SDL_FUN( Uint32 , SDL_RegisterEvents, (int numevents) ); 260 261 /* SDL_clipboard.h functions */ 262 NV_SDL_FUN( int, SDL_SetClipboardText, (const char *text) ); 263 NV_SDL_FUN( char *, SDL_GetClipboardText, (void) ); 264 NV_SDL_FUN( SDL_bool, SDL_HasClipboardText, (void) ); 265 266 /* SDL_gamecontroller.h functions */ 267 NV_SDL_FUN( int , SDL_GameControllerAddMapping, ( const char* mappingString ) ); 268 NV_SDL_FUN( char * , SDL_GameControllerMappingForGUID, ( SDL_JoystickGUID guid ) ); 269 NV_SDL_FUN( char * , SDL_GameControllerMapping, ( SDL_GameController * gamecontroller ) ); 270 NV_SDL_FUN( SDL_bool , SDL_IsGameController, (int joystick_index) ); 271 NV_SDL_FUN( const char *, SDL_GameControllerNameForIndex, (int joystick_index) ); 272 NV_SDL_FUN( SDL_GameController *, SDL_GameControllerOpen, (int joystick_index) ); 273 NV_SDL_FUN( const char *, SDL_GameControllerName, (SDL_GameController *gamecontroller) ); 274 NV_SDL_FUN( SDL_bool , SDL_GameControllerGetAttached, (SDL_GameController *gamecontroller) ); 275 NV_SDL_FUN( SDL_Joystick *, SDL_GameControllerGetJoystick, (SDL_GameController *gamecontroller) ); 276 NV_SDL_FUN( int , SDL_GameControllerEventState, (int state) ); 277 NV_SDL_FUN( void , SDL_GameControllerUpdate, (void) ); 278 NV_SDL_FUN( SDL_GameControllerAxis , SDL_GameControllerGetAxisFromString, (const char *pchString) ); 279 NV_SDL_FUN( const char* , SDL_GameControllerGetStringForAxis, (SDL_GameControllerAxis axis) ); 280 NV_SDL_FUN( SDL_GameControllerButtonBind , SDL_GameControllerGetBindForAxis, (SDL_GameController *gamecontroller,SDL_GameControllerAxis axis) ); 281 NV_SDL_FUN( Sint16 , SDL_GameControllerGetAxis, (SDL_GameController *gamecontroller,SDL_GameControllerAxis axis) ); 282 NV_SDL_FUN( SDL_GameControllerButton , SDL_GameControllerGetButtonFromString, (const char *pchString) ); 283 NV_SDL_FUN( const char* , SDL_GameControllerGetStringForButton, (SDL_GameControllerButton button) ); 284 NV_SDL_FUN( SDL_GameControllerButtonBind , SDL_GameControllerGetBindForButton, (SDL_GameController *gamecontroller,SDL_GameControllerButton button) ); 285 NV_SDL_FUN( Uint8 , SDL_GameControllerGetButton, (SDL_GameController *gamecontroller,SDL_GameControllerButton button) ); 286 NV_SDL_FUN( void , SDL_GameControllerClose, (SDL_GameController *gamecontroller) ); 287 288 /* SDL_hints.h functions */ 289 NV_SDL_FUN( SDL_bool , SDL_SetHintWithPriority, (const char *name,const char *value,SDL_HintPriority priority) ); 290 NV_SDL_FUN( SDL_bool , SDL_SetHint, (const char *name,const char *value) ); 291 NV_SDL_FUN( const char * , SDL_GetHint, (const char *name) ); 292 NV_SDL_FUN( void , SDL_ClearHints, (void) ); 293 294 /* SDL_main.h functions */ 295 NV_SDL_FUN( void , SDL_SetMainReady, (void) ); 296 // NV_SDL_FUN( int , SDL_RegisterApp, (char *name, Uint32 style,void *hInst) ); 297 // NV_SDL_FUN( void , SDL_UnregisterApp, (void) ); 298 299 /* SDL_messagebox.h functions */ 300 NV_SDL_FUN( int , SDL_ShowMessageBox, (const SDL_MessageBoxData *messageboxdata, int *buttonid) ); 301 NV_SDL_FUN( int , SDL_ShowSimpleMessageBox, (Uint32 flags, const char *title, const char *message, SDL_Window *window) ); 302 303 /* SDL_pixels.h functions */ 304 NV_SDL_FUN( const char* , SDL_GetPixelFormatName, (Uint32 format) ); 305 NV_SDL_FUN( SDL_bool , SDL_PixelFormatEnumToMasks, (Uint32 format,int *bpp,Uint32 * Rmask,Uint32 * Gmask,Uint32 * Bmask,Uint32 * Amask) ); 306 NV_SDL_FUN( Uint32 , SDL_MasksToPixelFormatEnum, (int bpp,Uint32 Rmask,Uint32 Gmask,Uint32 Bmask,Uint32 Amask) ); 307 NV_SDL_FUN( SDL_PixelFormat * , SDL_AllocFormat, (Uint32 pixel_format) ); 308 NV_SDL_FUN( void , SDL_FreeFormat, (SDL_PixelFormat *format) ); 309 NV_SDL_FUN( SDL_Palette *, SDL_AllocPalette, (int ncolors) ); 310 NV_SDL_FUN( int , SDL_SetPixelFormatPalette, (SDL_PixelFormat * format,SDL_Palette *palette) ); 311 NV_SDL_FUN( int , SDL_SetPaletteColors, (SDL_Palette * palette,const SDL_Color * colors,int firstcolor, int ncolors) ); 312 NV_SDL_FUN( void , SDL_FreePalette, (SDL_Palette * palette) ); 313 NV_SDL_FUN( Uint32 , SDL_MapRGB, (const SDL_PixelFormat * format,Uint8 r, Uint8 g, Uint8 b) ); 314 NV_SDL_FUN( Uint32 , SDL_MapRGBA, (const SDL_PixelFormat * format,Uint8 r, Uint8 g, Uint8 b,Uint8 a) ); 315 NV_SDL_FUN( void , SDL_GetRGB, (Uint32 pixel,const SDL_PixelFormat * format,Uint8 * r, Uint8 * g, Uint8 * b) ); 316 NV_SDL_FUN( void , SDL_GetRGBA, (Uint32 pixel,const SDL_PixelFormat * format,Uint8 * r, Uint8 * g, Uint8 * b,Uint8 * a) ); 317 NV_SDL_FUN( void , SDL_CalculateGammaRamp, (float gamma, Uint16 * ramp) ); 318 319 /* SDL_platform.h functions */ 320 NV_SDL_FUN( const char * , SDL_GetPlatform , (void) ); 321 322 /* SDL_power.h functions */ 323 NV_SDL_FUN( SDL_PowerState , SDL_GetPowerInfo, (int *secs, int *pct) ); 324 325 /* SDL_renderer.h functions */ 326 NV_SDL_FUN( int , SDL_GetNumRenderDrivers, (void) ); 327 NV_SDL_FUN( int , SDL_GetRenderDriverInfo, (int index,SDL_RendererInfo * info) ); 328 NV_SDL_FUN( int , SDL_CreateWindowAndRenderer, (int width, int height, Uint32 window_flags,SDL_Window **window, SDL_Renderer **renderer) ); 329 NV_SDL_FUN( SDL_Renderer * , SDL_CreateRenderer, (SDL_Window * window,int index, Uint32 flags) ); 330 NV_SDL_FUN( SDL_Renderer * , SDL_CreateSoftwareRenderer, (SDL_Surface * surface) ); 331 NV_SDL_FUN( SDL_Renderer * , SDL_GetRenderer, (SDL_Window * window) ); 332 NV_SDL_FUN( int , SDL_GetRendererInfo, (SDL_Renderer * renderer,SDL_RendererInfo * info) ); 333 NV_SDL_FUN( int , SDL_GetRendererOutputSize, (SDL_Renderer * renderer,int *w, int *h) ); 334 NV_SDL_FUN( SDL_Texture * , SDL_CreateTexture, (SDL_Renderer * renderer,Uint32 format,int access, int w,int h) ); 335 NV_SDL_FUN( SDL_Texture * , SDL_CreateTextureFromSurface, (SDL_Renderer * renderer, SDL_Surface * surface) ); 336 NV_SDL_FUN( int , SDL_QueryTexture, (SDL_Texture * texture,Uint32 * format, int *access,int *w, int *h) ); 337 NV_SDL_FUN( int , SDL_SetTextureColorMod, (SDL_Texture * texture,Uint8 r, Uint8 g, Uint8 b) ); 338 NV_SDL_FUN( int , SDL_GetTextureColorMod, (SDL_Texture * texture,Uint8 * r, Uint8 * g,Uint8 * b) ); 339 NV_SDL_FUN( int , SDL_SetTextureAlphaMod, (SDL_Texture * texture,Uint8 alpha) ); 340 NV_SDL_FUN( int , SDL_GetTextureAlphaMod, (SDL_Texture * texture,Uint8 * alpha) ); 341 NV_SDL_FUN( int , SDL_SetTextureBlendMode, (SDL_Texture * texture,SDL_BlendMode blendMode) ); 342 NV_SDL_FUN( int , SDL_GetTextureBlendMode, (SDL_Texture * texture,SDL_BlendMode *blendMode) ); 343 NV_SDL_FUN( int , SDL_UpdateTexture, (SDL_Texture * texture,const SDL_Rect * rect,const void *pixels, int pitch) ); 344 NV_SDL_FUN( int , SDL_LockTexture, (SDL_Texture * texture,const SDL_Rect * rect,void **pixels, int *pitch) ); 345 NV_SDL_FUN( void , SDL_UnlockTexture, (SDL_Texture * texture) ); 346 NV_SDL_FUN( SDL_bool , SDL_RenderTargetSupported, (SDL_Renderer *renderer) ); 347 NV_SDL_FUN( int , SDL_SetRenderTarget, (SDL_Renderer *renderer,SDL_Texture *texture) ); 348 NV_SDL_FUN( SDL_Texture * , SDL_GetRenderTarget, (SDL_Renderer *renderer) ); 349 NV_SDL_FUN( int , SDL_RenderSetLogicalSize, (SDL_Renderer * renderer, int w, int h) ); 350 NV_SDL_FUN( void , SDL_RenderGetLogicalSize, (SDL_Renderer * renderer, int *w, int *h) ); 351 NV_SDL_FUN( int , SDL_RenderSetViewport, (SDL_Renderer * renderer,const SDL_Rect * rect) ); 352 NV_SDL_FUN( void , SDL_RenderGetViewport, (SDL_Renderer * renderer,SDL_Rect * rect) ); 353 NV_SDL_FUN( int , SDL_RenderSetClipRect, (SDL_Renderer * renderer,const SDL_Rect * rect) ); 354 NV_SDL_FUN( void , SDL_RenderGetClipRect, (SDL_Renderer * renderer,SDL_Rect * rect) ); 355 NV_SDL_FUN( int , SDL_RenderSetScale, (SDL_Renderer * renderer,float scaleX, float scaleY) ); 356 NV_SDL_FUN( void , SDL_RenderGetScale, (SDL_Renderer * renderer,float *scaleX, float *scaleY) ); 357 NV_SDL_FUN( int , SDL_SetRenderDrawColor, (SDL_Renderer * renderer,Uint8 r, Uint8 g, Uint8 b,Uint8 a) ); 358 NV_SDL_FUN( int , SDL_GetRenderDrawColor, (SDL_Renderer * renderer,Uint8 * r, Uint8 * g, Uint8 * b,Uint8 * a) ); 359 NV_SDL_FUN( int , SDL_SetRenderDrawBlendMode, (SDL_Renderer * renderer,SDL_BlendMode blendMode) ); 360 NV_SDL_FUN( int , SDL_GetRenderDrawBlendMode, (SDL_Renderer * renderer,SDL_BlendMode *blendMode) ); 361 NV_SDL_FUN( int , SDL_RenderClear, (SDL_Renderer * renderer) ); 362 NV_SDL_FUN( int , SDL_RenderDrawPoint, (SDL_Renderer * renderer,int x, int y) ); 363 NV_SDL_FUN( int , SDL_RenderDrawPoints, (SDL_Renderer * renderer,const SDL_Point * points,int count) ); 364 NV_SDL_FUN( int , SDL_RenderDrawLine, (SDL_Renderer * renderer,int x1, int y1, int x2, int y2) ); 365 NV_SDL_FUN( int , SDL_RenderDrawLines, (SDL_Renderer * renderer,const SDL_Point * points,int count) ); 366 NV_SDL_FUN( int , SDL_RenderDrawRect, (SDL_Renderer * renderer,const SDL_Rect * rect) ); 367 NV_SDL_FUN( int , SDL_RenderDrawRects, (SDL_Renderer * renderer,const SDL_Rect * rects,int count) ); 368 NV_SDL_FUN( int , SDL_RenderFillRect, (SDL_Renderer * renderer,const SDL_Rect * rect) ); 369 NV_SDL_FUN( int , SDL_RenderFillRects, (SDL_Renderer * renderer,const SDL_Rect * rects,int count) ); 370 NV_SDL_FUN( int , SDL_RenderCopy, (SDL_Renderer * renderer,SDL_Texture * texture,const SDL_Rect * srcrect,const SDL_Rect * dstrect) ); 371 NV_SDL_FUN( int , SDL_RenderCopyEx, (SDL_Renderer * renderer,SDL_Texture * texture,const SDL_Rect * srcrect,const SDL_Rect * dstrect,const double angle,const SDL_Point *center,const SDL_RendererFlip flip) ); 372 NV_SDL_FUN( int , SDL_RenderReadPixels, (SDL_Renderer * renderer,const SDL_Rect * rect,Uint32 format,void *pixels, int pitch) ); 373 NV_SDL_FUN( void , SDL_RenderPresent, (SDL_Renderer * renderer) ); 374 NV_SDL_FUN( void , SDL_DestroyTexture, (SDL_Texture * texture) ); 375 NV_SDL_FUN( void , SDL_DestroyRenderer, (SDL_Renderer * renderer) ); 376 NV_SDL_FUN( int , SDL_GL_BindTexture, (SDL_Texture *texture, float *texw, float *texh) ); 377 NV_SDL_FUN( int , SDL_GL_UnbindTexture, (SDL_Texture *texture) ); 378 379 /* SDL_shape.h functions */ 380 NV_SDL_FUN( int , SDL_SetWindowShape, (SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) ); 381 NV_SDL_FUN( int , SDL_GetShapedWindowMode, (SDL_Window *window,SDL_WindowShapeMode *shape_mode) ); 382 383 /* SDL_surface.h functions */ 384 NV_SDL_FUN( int , SDL_SetSurfacePalette, (SDL_Surface * surface,SDL_Palette * palette) ); 385 NV_SDL_FUN( int , SDL_SetSurfaceRLE, (SDL_Surface * surface,int flag) ); 386 NV_SDL_FUN( int , SDL_SetColorKey, (SDL_Surface * surface,int flag, Uint32 key) ); 387 NV_SDL_FUN( int , SDL_GetColorKey, (SDL_Surface * surface,Uint32 * key) ); 388 NV_SDL_FUN( int , SDL_SetSurfaceColorMod, (SDL_Surface * surface,Uint8 r, Uint8 g, Uint8 b) ); 389 NV_SDL_FUN( int , SDL_GetSurfaceColorMod, (SDL_Surface * surface,Uint8 * r, Uint8 * g,Uint8 * b) ); 390 NV_SDL_FUN( int , SDL_SetSurfaceAlphaMod, (SDL_Surface * surface,Uint8 alpha) ); 391 NV_SDL_FUN( int , SDL_GetSurfaceAlphaMod, (SDL_Surface * surface,Uint8 * alpha) ); 392 NV_SDL_FUN( int , SDL_SetSurfaceBlendMode, (SDL_Surface * surface,SDL_BlendMode blendMode) ); 393 NV_SDL_FUN( int , SDL_GetSurfaceBlendMode, (SDL_Surface * surface,SDL_BlendMode *blendMode) ); 394 395 NV_SDL_FUN( SDL_Surface *, SDL_ConvertSurfaceFormat, (SDL_Surface * src, Uint32 pixel_format, Uint32 flags) ); 396 NV_SDL_FUN( int , SDL_ConvertPixels, (int width, int height,Uint32 src_format,const void * src, int src_pitch,Uint32 dst_format,void * dst, int dst_pitch) ); 397 NV_SDL_FUN( int , SDL_FillRect, (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color) ); 398 NV_SDL_FUN( int , SDL_FillRects, (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color) ); 399 NV_SDL_FUN( int , SDL_UpperBlit, (SDL_Surface * src, const SDL_Rect * srcrect,SDL_Surface * dst, SDL_Rect * dstrect) ); 400 NV_SDL_FUN( int , SDL_LowerBlit, (SDL_Surface * src, SDL_Rect * srcrect,SDL_Surface * dst, SDL_Rect * dstrect) ); 401 NV_SDL_FUN( int , SDL_SoftStretch, (SDL_Surface * src,const SDL_Rect * srcrect,SDL_Surface * dst,const SDL_Rect * dstrect) ); 402 NV_SDL_FUN( int , SDL_UpperBlitScaled, (SDL_Surface * src, const SDL_Rect * srcrect,SDL_Surface * dst, SDL_Rect * dstrect) ); 403 NV_SDL_FUN( int , SDL_LowerBlitScaled, (SDL_Surface * src, SDL_Rect * srcrect,SDL_Surface * dst, SDL_Rect * dstrect) ); 404 NV_SDL_FUN( int , SDL_GetNumTouchDevices, (void) ); 405 NV_SDL_FUN( SDL_TouchID , SDL_GetTouchDevice, (int index) ); 406 NV_SDL_FUN( int , SDL_GetNumTouchFingers, (SDL_TouchID touchID) ); 407 NV_SDL_FUN( SDL_Finger * , SDL_GetTouchFinger, (SDL_TouchID touchID, int index) ); 408 409 NV_SDL_FUN( char *, SDL_getenv, (const char *name) ); 410 NV_SDL_FUN( int , SDL_setenv, (const char *name, const char *value, int overwrite) ); 411 NV_SDL_FUN( int , SDL_isdigit, (int x) ); 412 NV_SDL_FUN( int , SDL_isspace, (int x) ); 413 NV_SDL_FUN( int , SDL_toupper, (int x) ); 414 NV_SDL_FUN( int , SDL_tolower, (int x) ); -
trunk/nv/lib/sdl.hh
r319 r325 13 13 //#define NV_SDL_SHARED 14 14 15 #define NV_SDL_C 016 #define NV_SDL_12 117 #define NV_SDL_20 218 19 #if !defined(NV_SDL_VERSION)20 # define NV_SDL_VERSION NV_SDL_2021 #endif22 23 15 #if NV_PLATFORM == NV_WINDOWS 24 # define NV_SDL_PATH_12 "SDL.dll" 25 # define NV_SDL_PATH_20 "SDL2.dll" 16 # define NV_SDL_PATH "SDL2.dll" 26 17 #elif NV_PLATFORM == NV_APPLE 27 # define NV_SDL_PATH_12 "SDL.framework/SDL" 28 # define NV_SDL_PATH_20 "SDL2.framework/SDL" 18 # define NV_SDL_PATH "SDL2.framework/SDL" 29 19 #else 30 # define NV_SDL_PATH_12 "libSDL-1.2.so.0" 31 # define NV_SDL_PATH_20 "libSDL-1.2.so.0" 32 #endif 33 34 #if NV_SDL_VERSION == NV_SDL_12 35 # define NV_SDL_PATH NV_SDL_PATH_12 36 #elif NV_SDL_VERSION == NV_SDL_20 37 # define NV_SDL_PATH NV_SDL_PATH_20 38 #elif NV_SDL_VERSION == NV_SDL_C 39 # define NV_SDL_PATH nullptr 40 #else 41 # error "Unrecognized NV_SDL_VERSION!" 20 # define NV_SDL_PATH "libSDL2-2.0.so.0" 42 21 #endif 43 22 … … 91 70 /* SDL.h defines */ 92 71 93 #define SDL_INIT_TIMER 0x00000001 94 #define SDL_INIT_AUDIO 0x00000010 95 #define SDL_INIT_VIDEO 0x00000020 96 #define SDL_INIT_JOYSTICK 0x00000200 97 #if NV_SDL_VERSION == NV_SDL_20 98 #define SDL_INIT_NOPARACHUTE 0x00100000 99 #define SDL_INIT_EVENTTHREAD 0x01000000 100 #define SDL_INIT_EVERYTHING 0x0000FFFF 101 #else 72 #define SDL_INIT_TIMER 0x00000001 73 #define SDL_INIT_AUDIO 0x00000010 74 #define SDL_INIT_VIDEO 0x00000020 75 #define SDL_INIT_JOYSTICK 0x00000200 102 76 #define SDL_INIT_HAPTIC 0x00001000 103 77 #define SDL_INIT_GAMECONTROLLER 0x00002000 … … 108 82 SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \ 109 83 ) 110 #endif111 84 112 85 #define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression) … … 132 105 /* SDL_rwops.h defines */ 133 106 typedef struct SDL_RWops { 134 #if NV_SDL_VERSION == NV_SDL_20135 107 Sint64 (NV_SDL_APIENTRY *size)(struct SDL_RWops *context); 136 108 Sint64 (NV_SDL_APIENTRY *seek)(struct SDL_RWops *context, Sint64 offset, int whence); 137 109 size_t (NV_SDL_APIENTRY *read)(struct SDL_RWops *context, void *ptr, size_t size, size_t maxnum); 138 110 size_t (NV_SDL_APIENTRY *write)(struct SDL_RWops *context, const void *ptr, size_t size, size_t num); 139 #else140 int (NV_SDL_APIENTRY *seek)(struct SDL_RWops *context, int offset, int whence);141 int (NV_SDL_APIENTRY *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);142 int (NV_SDL_APIENTRY *write)(struct SDL_RWops *context, const void *ptr, int size, int num);143 #endif144 111 int (NV_SDL_APIENTRY *close)(struct SDL_RWops *context); 145 112 … … 178 145 #define SDL_ALPHA_TRANSPARENT 0 179 146 180 #if NV_SDL_VERSION == NV_SDL_20181 147 typedef struct 182 148 { … … 189 155 int w, h; 190 156 } SDL_Rect; 191 #else192 typedef struct SDL_Rect {193 Sint16 x, y;194 Uint16 w, h;195 } SDL_Rect;196 #endif197 157 198 158 typedef struct SDL_Color { … … 200 160 Uint8 g; 201 161 Uint8 b; 202 #if NV_SDL_VERSION == NV_SDL_20203 162 Uint8 unused; 204 #else205 Uint8 a;206 #endif207 163 } SDL_Color; 208 164 … … 210 166 int ncolors; 211 167 SDL_Color *colors; 212 #if NV_SDL_VERSION == NV_SDL_20213 168 Uint32 version; 214 169 int refcount; 215 #endif216 217 170 } SDL_Palette; 218 171 219 #if NV_SDL_VERSION == NV_SDL_20220 172 #define SDL_RWOPS_UNKNOWN 0 221 173 #define SDL_RWOPS_WINFILE 1 … … 224 176 #define SDL_RWOPS_MEMORY 4 225 177 #define SDL_RWOPS_MEMORY_RO 5 226 #endif 227 228 /* SDL_pixels.h defines (2.0 only) */ 229 #if NV_SDL_VERSION == NV_SDL_20 178 179 /* SDL_pixels.h defines */ 230 180 enum 231 181 { … … 429 379 SDL_POWERSTATE_CHARGED 430 380 } SDL_PowerState; 431 #endif432 433 #if NV_SDL_VERSION == NV_SDL_20434 381 435 382 typedef enum … … 462 409 struct SDL_PixelFormat *next; 463 410 } SDL_PixelFormat; 464 #else 465 typedef struct SDL_PixelFormat { 466 SDL_Palette *palette; 467 Uint8 BitsPerPixel; 468 Uint8 BytesPerPixel; 469 Uint8 Rloss; 470 Uint8 Gloss; 471 Uint8 Bloss; 472 Uint8 Aloss; 473 Uint8 Rshift; 474 Uint8 Gshift; 475 Uint8 Bshift; 476 Uint8 Ashift; 477 Uint32 Rmask; 478 Uint32 Gmask; 479 Uint32 Bmask; 480 Uint32 Amask; 481 482 Uint32 colorkey; 483 Uint8 alpha; 484 } SDL_PixelFormat; 485 #endif 486 487 #if NV_SDL_VERSION == NV_SDL_20 411 488 412 typedef struct 489 413 { … … 494 418 void *driverdata; 495 419 } SDL_DisplayMode; 496 #endif 497 498 #if NV_SDL_VERSION == NV_SDL_20 420 499 421 typedef struct SDL_Surface 500 422 { … … 511 433 int refcount; 512 434 } SDL_Surface; 513 #else 514 typedef struct SDL_Surface 515 { 516 Uint32 flags; 517 SDL_PixelFormat *format; 518 int w, h; 519 Uint16 pitch; 520 void *pixels; 521 int offset; 522 struct private_hwdata *hwdata; 523 SDL_Rect clip_rect; 524 Uint32 unused1; 525 Uint32 locked; 526 struct SDL_BlitMap *map; 527 unsigned int format_version; 528 int refcount; 529 } SDL_Surface; 530 #endif 531 532 #if NV_SDL_VERSION == NV_SDL_20 435 533 436 #define SDL_SWSURFACE 0 534 437 #define SDL_PREALLOC 0x00000001 … … 537 440 538 441 #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) 539 #else 540 #define SDL_SWSURFACE 0x00000000 541 #define SDL_HWSURFACE 0x00000001 542 #define SDL_ASYNCBLIT 0x00000004 543 #define SDL_ANYFORMAT 0x10000000 544 #define SDL_HWPALETTE 0x20000000 545 #define SDL_DOUBLEBUF 0x40000000 546 #define SDL_FULLSCREEN 0x80000000 547 #define SDL_OPENGL 0x00000002 548 #define SDL_OPENGLBLIT 0x0000000A 549 #define SDL_RESIZABLE 0x00000010 550 #define SDL_NOFRAME 0x00000020 551 #define SDL_HWACCEL 0x00000100 552 #define SDL_SRCCOLORKEY 0x00001000 553 #define SDL_RLEACCELOK 0x00002000 554 #define SDL_RLEACCEL 0x00004000 555 #define SDL_SRCALPHA 0x00010000 556 #define SDL_PREALLOC 0x01000000 557 558 #define SDL_MUSTLOCK(surface) \ 559 (surface->offset || \ 560 ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) 561 562 #endif 563 442 # 564 443 typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, 565 444 struct SDL_Surface *dst, SDL_Rect *dstrect); 566 445 567 #if NV_SDL_VERSION == NV_SDL_12568 typedef struct SDL_VideoInfo {569 Uint32 hw_available :1;570 Uint32 wm_available :1;571 Uint32 UnusedBits1 :6;572 Uint32 UnusedBits2 :1;573 Uint32 blit_hw :1;574 Uint32 blit_hw_CC :1;575 Uint32 blit_hw_A :1;576 Uint32 blit_sw :1;577 Uint32 blit_sw_CC :1;578 Uint32 blit_sw_A :1;579 Uint32 blit_fill :1;580 Uint32 UnusedBits3 :16;581 Uint32 video_mem;582 SDL_PixelFormat *vfmt;583 int current_w;584 int current_h;585 } SDL_VideoInfo;586 #endif587 588 #if NV_SDL_VERSION == NV_SDL_20589 446 typedef enum 590 447 { … … 715 572 716 573 typedef void *SDL_GLContext; 717 #endif718 719 574 720 575 typedef enum { … … 735 590 SDL_GL_MULTISAMPLESAMPLES, 736 591 SDL_GL_ACCELERATED_VISUAL, 737 #if NV_SDL_VERSION == NV_SDL_12738 SDL_GL_SWAP_CONTROL739 #else740 592 SDL_GL_RETAINED_BACKING, 741 593 SDL_GL_CONTEXT_MAJOR_VERSION, … … 745 597 SDL_GL_CONTEXT_PROFILE_MASK, 746 598 SDL_GL_SHARE_WITH_CURRENT_CONTEXT 747 #endif748 599 } SDL_GLattr; 749 600 750 #if NV_SDL_VERSION == NV_SDL_20751 601 typedef enum 752 602 { … … 763 613 SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 764 614 } SDL_GLcontextFlag; 765 #endif 766 767 #if NV_SDL_VERSION == NV_SDL_12 615 768 616 typedef enum { 769 617 SDL_GRAB_QUERY = -1, … … 772 620 SDL_GRAB_FULLSCREEN /**< Used internally */ 773 621 } SDL_GrabMode; 774 #endif775 622 776 623 /* SDL_audio.h defines */ … … 783 630 #define AUDIO_U16 AUDIO_U16LSB 784 631 #define AUDIO_S16 AUDIO_S16LSB 785 786 #if NV_SDL_VERSION == NV_SDL_20787 632 #define AUDIO_S32LSB 0x8020 788 633 #define AUDIO_S32MSB 0x9020 … … 791 636 #define AUDIO_F32MSB 0x9120 792 637 #define AUDIO_F32 AUDIO_F32LSB 793 #endif794 638 795 639 /* NOTE : assuming LSB! */ 796 640 #define AUDIO_U16SYS AUDIO_U16LSB 797 641 #define AUDIO_S16SYS AUDIO_S16LSB 798 #if NV_SDL_VERSION == NV_SDL_20799 642 #define AUDIO_S32SYS AUDIO_S32LSB 800 643 #define AUDIO_F32SYS AUDIO_F32LSB 801 #endif802 644 803 645 typedef Uint16 SDL_AudioFormat; … … 843 685 typedef SDL_audiostatus SDL_AudioStatus; 844 686 845 #if NV_SDL_VERSION == NV_SDL_20846 687 #define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 847 688 #define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 848 689 #define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 849 690 #define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE) 850 #endif851 691 852 692 #define SDL_MIX_MAXVOLUME 128 853 693 854 #if NV_SDL_VERSION == NV_SDL_20855 694 /* SDL_hints.h defines */ 856 695 #define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" … … 876 715 SDL_HINT_OVERRIDE 877 716 } SDL_HintPriority; 878 #endif 879 880 #if NV_SDL_VERSION == NV_SDL_20 717 881 718 /* SDL_messagebox.h defines */ 882 719 typedef enum … … 932 769 const SDL_MessageBoxColorScheme *colorScheme; 933 770 } SDL_MessageBoxData; 934 #endif935 936 937 /* SDL_active.h defines */938 #if NV_SDL_VERSION == NV_SDL_12939 #define SDL_APPMOUSEFOCUS 0x01940 #define SDL_APPINPUTFOCUS 0x02941 #define SDL_APPACTIVE 0x04942 #endif943 771 944 772 /* SDL_keyboard.h defines */ 945 #if NV_SDL_VERSION == NV_SDL_20 946 #include <nv/lib/detail/sdl_keys_20.inc> 947 #else 948 #include <nv/lib/detail/sdl_keys_12.inc> 949 #endif 773 #include <nv/lib/detail/sdl_keys.inc> 950 774 951 775 typedef enum { … … 978 802 #define SDL_DEFAULT_REPEAT_INTERVAL 30 979 803 980 #if NV_SDL_VERSION == NV_SDL_12981 typedef struct SDL_keysym {982 Uint8 scancode;983 SDLKey sym;984 SDLMod mod;985 Uint16 unicode;986 } SDL_keysym;987 988 #define SDL_ALL_HOTKEYS 0xFFFFFFFF989 #else990 804 typedef Sint32 SDL_Keycode; 991 805 typedef struct SDL_Keysym … … 996 810 Uint32 unused; 997 811 } SDL_Keysym; 998 #endif999 812 1000 813 /* SDL_mouse.h defines */ 1001 #if NV_SDL_VERSION == NV_SDL_201002 814 typedef enum 1003 815 { … … 1016 828 SDL_NUM_SYSTEM_CURSORS 1017 829 } SDL_SystemCursor; 1018 #endif1019 830 1020 831 typedef struct WMcursor WMcursor; … … 1032 843 #define SDL_BUTTON_MIDDLE 2 1033 844 #define SDL_BUTTON_RIGHT 3 1034 #if NV_SDL_VERSION == NV_SDL_201035 845 #define SDL_BUTTON_X1 4 1036 846 #define SDL_BUTTON_X2 5 1037 #else1038 #define SDL_BUTTON_WHEELUP 41039 #define SDL_BUTTON_WHEELDOWN 51040 #define SDL_BUTTON_X1 61041 #define SDL_BUTTON_X2 71042 #endif1043 847 #define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) 1044 848 #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) … … 1052 856 typedef struct _SDL_Joystick SDL_Joystick; 1053 857 1054 #if NV_SDL_VERSION == NV_SDL_201055 858 typedef struct { 1056 859 Uint8 data[16]; … … 1058 861 1059 862 typedef Sint32 SDL_JoystickID; 1060 #endif1061 1062 863 1063 864 #define SDL_HAT_CENTERED 0x00 … … 1076 877 #define SDL_PRESSED 1 1077 878 1078 /* SDL_gamecontroller.h defines (2.0 only)*/ 1079 #if NV_SDL_VERSION == NV_SDL_20 879 /* SDL_gamecontroller.h defines */ 1080 880 struct _SDL_GameController; 1081 881 typedef struct _SDL_GameController SDL_GameController; … … 1138 938 1139 939 typedef Sint64 SDL_GestureID; 1140 #endif 1141 1142 #if NV_SDL_VERSION == NV_SDL_12 1143 #include <nv/lib/detail/sdl_events_12.inc> 1144 #else 1145 #include <nv/lib/detail/sdl_events_20.inc> 1146 #endif 1147 1148 #if NV_SDL_VERSION == NV_SDL_20 940 941 #include <nv/lib/detail/sdl_events.inc> 942 1149 943 typedef int (NV_SDL_APIENTRY * SDL_EventFilter) (void *userdata, SDL_Event * event); 1150 #endif1151 944 1152 945 #define SDL_QUERY -1 … … 1156 949 1157 950 /* SDL_timer.h defines */ 1158 #if NV_SDL_VERSION == NV_SDL_201159 951 typedef Uint32 (NV_SDL_APIENTRY *SDL_TimerCallback)(Uint32 interval, void *param); 1160 952 typedef int SDL_TimerID; 1161 #else1162 #define SDL_TIMESLICE 101163 #define TIMER_RESOLUTION 101164 typedef Uint32 (NV_SDL_APIENTRY *SDL_TimerCallback)(Uint32 interval, void *param);1165 typedef struct _SDL_TimerID *SDL_TimerID;1166 #endif1167 953 1168 954 /* SDL_version.h defines */ … … 1173 959 } SDL_version; 1174 960 1175 #if NV_SDL_VERSION == NV_SDL_201176 961 #define SDL_MAJOR_VERSION 2 1177 962 #define SDL_MINOR_VERSION 0 1178 963 #define SDL_PATCHLEVEL 0 1179 #else1180 #define SDL_MAJOR_VERSION 11181 #define SDL_MINOR_VERSION 21182 #define SDL_PATCHLEVEL 151183 #endif1184 964 1185 965 #if defined(NV_SDL_DYNAMIC) … … 1189 969 #endif 1190 970 #include <nv/lib/detail/sdl_functions.inc> 1191 #if NV_SDL_VERSION == NV_SDL_121192 #include <nv/lib/detail/sdl_functions_12.inc>1193 #elif NV_SDL_VERSION == NV_SDL_201194 #include <nv/lib/detail/sdl_functions_20.inc>1195 #endif1196 971 #undef NV_SDL_FUN 1197 972 -
trunk/nv/lib/sdl_image.hh
r319 r325 12 12 13 13 #if NV_PLATFORM == NV_WINDOWS 14 # define NV_SDL_IMAGE_PATH_12 "SDL_image.dll" 15 # define NV_SDL_IMAGE_PATH_20 "SDL2_image.dll" 14 # define NV_SDL_IMAGE_PATH "SDL2_image.dll" 16 15 #elif NV_PLATFORM == NV_APPLE 17 # define NV_SDL_IMAGE_PATH_12 "SDL_image.framework/SDL_image" 18 # define NV_SDL_IMAGE_PATH_20 "SDL2_image.framework/SDL_image" 16 # define NV_SDL_IMAGE_PATH "SDL2_image.framework/SDL_image" 19 17 #else 20 # define NV_SDL_IMAGE_PATH_12 "libSDL_image-1.2.so.0" 21 # define NV_SDL_IMAGE_PATH_20 "libSDL2_image-2.0.so.0" 22 #endif 23 24 #if NV_SDL_VERSION == NV_SDL_12 25 # define NV_SDL_IMAGE_PATH NV_SDL_IMAGE_PATH_12 26 #elif NV_SDL_VERSION == NV_SDL_20 27 # define NV_SDL_IMAGE_PATH NV_SDL_IMAGE_PATH_20 28 #elif NV_SDL_VERSION == NV_SDL_C 29 # define NV_SDL_IMAGE_PATH nullptr 30 #else 31 # error "Unrecognized NV_SDL_VERSION!" 18 # define NV_SDL_IMAGE_PATH "libSDL2_image-2.0.so.0" 32 19 #endif 33 20 … … 35 22 36 23 /** SDL_image defines */ 37 #if NV_SDL_VERSION == NV_SDL_2038 24 #define SDL_IMAGE_MAJOR_VERSION 2 39 25 #define SDL_IMAGE_MINOR_VERSION 0 40 26 #define SDL_IMAGE_PATCHLEVEL 0 41 #else42 #define SDL_IMAGE_MAJOR_VERSION 143 #define SDL_IMAGE_MINOR_VERSION 244 #define SDL_IMAGE_PATCHLEVEL 1145 #endif46 27 47 28 #define SDL_IMAGE_VERSION(X) \ -
trunk/nv/lib/sdl_mixer.hh
r319 r325 12 12 13 13 #if NV_PLATFORM == NV_WINDOWS 14 # define NV_SDL_MIXER_PATH_12 "SDL_mixer.dll" 15 # define NV_SDL_MIXER_PATH_20 "SDL2_mixer.dll" 14 # define NV_SDL_MIXER_PATH "SDL2_mixer.dll" 16 15 #elif NV_PLATFORM == NV_APPLE 17 # define NV_SDL_MIXER_PATH_12 "SDL_mixer.framework/SDL_mixer" 18 # define NV_SDL_MIXER_PATH_20 "SDL2_mixer.framework/SDL_mixer" 16 # define NV_SDL_MIXER_PATH "SDL2_mixer.framework/SDL_mixer" 19 17 #else 20 # define NV_SDL_MIXER_PATH_12 "libSDL_mixer-1.2.so.0" 21 # define NV_SDL_MIXER_PATH_20 "libSDL2_mixer-2.0.so.0" 22 #endif 23 24 #if NV_SDL_VERSION == NV_SDL_12 25 # define NV_SDL_MIXER_PATH NV_SDL_MIXER_PATH_12 26 #elif NV_SDL_VERSION == NV_SDL_20 27 # define NV_SDL_MIXER_PATH NV_SDL_MIXER_PATH_20 28 #elif NV_SDL_VERSION == NV_SDL_C 29 # define NV_SDL_MIXER_PATH nullptr 30 #else 31 # error "Unrecognized NV_SDL_VERSION!" 18 # define NV_SDL_MIXER_PATH "libSDL2_mixer-2.0.so.0" 32 19 #endif 33 20 34 21 extern "C" { 35 22 36 #if NV_SDL_VERSION == NV_SDL_2037 23 #define SDL_MIXER_MAJOR_VERSION 2 38 24 #define SDL_MIXER_MINOR_VERSION 0 39 25 #define SDL_MIXER_PATCHLEVEL 0 40 #else41 #define SDL_MIXER_MAJOR_VERSION 142 #define SDL_MIXER_MINOR_VERSION 243 #define SDL_MIXER_PATCHLEVEL 1244 #endif45 26 46 27 #define SDL_MIXER_VERSION(X) \
Note: See TracChangeset
for help on using the changeset viewer.