mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-04 03:15:59 -04:00
Fixed some event code that depends on the SDL version
This commit is contained in:
parent
3c903e101f
commit
4b74730b1d
@ -29,6 +29,7 @@
|
||||
#include <type_traits>
|
||||
|
||||
#include <SDL_events.h>
|
||||
#include <SDL_version.h>
|
||||
|
||||
namespace SDL2pp {
|
||||
/*
|
||||
@ -40,7 +41,9 @@ namespace Private {
|
||||
*/
|
||||
using ValidEventTypes = std::tuple<
|
||||
SDL_Event,
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 5)
|
||||
SDL_AudioDeviceEvent,
|
||||
#endif
|
||||
SDL_ControllerAxisEvent,
|
||||
SDL_ControllerButtonEvent,
|
||||
SDL_ControllerDeviceEvent,
|
||||
|
@ -80,7 +80,7 @@ namespace Private {
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 5)
|
||||
SDL2PP_DEFINE_EVENT_MAPPING(SDL_DropEvent, event.type == SDL_DROPFILE || event.type == SDL_DROPTEXT || event.type == SDL_DROPBEGIN || event.type == SDL_DROPCOMPLETE, event.drop);
|
||||
#else
|
||||
SDL2PP_DEFINE_EVENT_MAPPING(SDL_DropEvent, event.type == SDL_DROPFILE || event.type == SDL_DROPTEXT, event.drop);
|
||||
SDL2PP_DEFINE_EVENT_MAPPING(SDL_DropEvent, event.type == SDL_DROPFILE, event.drop);
|
||||
#endif
|
||||
SDL2PP_DEFINE_EVENT_MAPPING(SDL_JoyAxisEvent, event.type == SDL_JOYAXISMOTION, event.jaxis);
|
||||
SDL2PP_DEFINE_EVENT_MAPPING(SDL_JoyBallEvent, event.type == SDL_JOYBALLMOTION, event.jball);
|
||||
|
Loading…
x
Reference in New Issue
Block a user