X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsdl.h;h=a45e68ec89ecd1d0898471943e14c55ae16275f1;hb=c8689f0335cd584d24570046c6eb5a3b75701305;hp=4f9ced82a7cc193a6a2561c01b0cf9631f9af740;hpb=d3e24bbfb70edb9a805806345eede28c7129baf8;p=rocksndiamonds.git diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index 4f9ced82..a45e68ec 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -4,7 +4,7 @@ // (c) 1995-2014 by Artsoft Entertainment // Holger Schemel // info@artsoft.org -// http://www.artsoft.org/ +// https://www.artsoft.org/ // ---------------------------------------------------------------------------- // sdl.h // ============================================================================ @@ -17,13 +17,13 @@ #include #include #include -#if defined(PLATFORM_WIN32) +#if defined(PLATFORM_WINDOWS) #include #endif // definitions needed for "system.c" -#define SURFACE_FLAGS (0) +#define SURFACE_FLAGS (SDL_WINDOW_RESIZABLE) #define SET_TRANSPARENT_PIXEL (SDL_TRUE) #define UNSET_TRANSPARENT_PIXEL (SDL_FALSE) @@ -64,9 +64,8 @@ typedef SDL_TextInputEvent TextEvent; typedef SDL_Event PauseResumeEvent; typedef SDL_WindowEvent WindowEvent; typedef SDL_KeyboardEvent KeyEvent; -typedef SDL_Event ExposeEvent; -typedef SDL_Event FocusChangeEvent; -typedef SDL_Event ClientMessageEvent; + +typedef SDL_EventFilter EventFilter; // structure definitions @@ -91,6 +90,21 @@ struct MouseCursorInfo byte mask[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8]; }; +struct UserEventInfo +{ + // same as in "struct SDL_UserEvent" + Uint32 type; + Uint32 timestamp; + Uint32 windowID; + Sint32 code; + + // changed to use integer values instead of void pointers + Uint32 value1; + Uint32 value2; +}; + +typedef struct UserEventInfo UserEvent; + // SDL symbol definitions @@ -109,12 +123,8 @@ struct MouseCursorInfo #define EVENT_TEXTINPUT SDL_TEXTINPUT #define EVENT_KEYPRESS SDL_KEYDOWN #define EVENT_KEYRELEASE SDL_KEYUP -#define EVENT_EXPOSE SDL_USEREVENT + 0 -#define EVENT_FOCUSIN SDL_USEREVENT + 1 -#define EVENT_FOCUSOUT SDL_USEREVENT + 2 -#define EVENT_CLIENTMESSAGE SDL_QUIT -#define EVENT_MAPNOTIFY SDL_USEREVENT + 4 -#define EVENT_UNMAPNOTIFY SDL_USEREVENT + 5 +#define EVENT_USER SDL_USEREVENT +#define EVENT_QUIT SDL_QUIT #define KSYM_UNDEFINED SDLK_UNKNOWN @@ -340,6 +350,21 @@ struct MouseCursorInfo #define KSYM_FKEY_LAST KSYM_F12 #define KSYM_NUM_FKEYS (KSYM_FKEY_LAST - KSYM_FKEY_FIRST + 1) +#define KSYM_RAW(k) (((k) >= KSYM_a && \ + (k) <= KSYM_z) || \ + ((k) >= KSYM_0 && \ + (k) <= KSYM_9) || \ + (k) == KSYM_space) + +#define KSYM_PRINTABLE(k) (((k) >= KSYM_space && \ + (k) <= KSYM_z) || \ + (k) == KSYM_Adiaeresis || \ + (k) == KSYM_Odiaeresis || \ + (k) == KSYM_Udiaeresis || \ + (k) == KSYM_adiaeresis || \ + (k) == KSYM_odiaeresis || \ + (k) == KSYM_udiaeresis) + #define KMOD_None KMOD_NONE #define KMOD_Shift_L KMOD_LSHIFT #define KMOD_Shift_R KMOD_RSHIFT @@ -363,8 +388,11 @@ struct MouseCursorInfo #define KMOD_TextInput (KMOD_Shift | KMOD_Alt_R) + // SDL function definitions +void SDLSetAlpha(SDL_Surface *, boolean, int); +const char *SDLGetRendererName(void); boolean SDLSetNativeSurface(SDL_Surface **); SDL_Surface *SDLGetNativeSurface(SDL_Surface *); void SDLCreateBitmapTextures(Bitmap *); @@ -413,7 +441,7 @@ void SDLOpenAudio(void); void SDLCloseAudio(void); void SDLWaitEvent(Event *); -void SDLHandleWindowManagerEvent(Event *); +void SDLCorrectRawMousePosition(int *, int *); void HandleJoystickEvent(Event *); void SDLInitJoysticks(void);