mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-01 19:33:38 +00:00
events: Add pinch event category
Needed to allow SDL_GetWindowFromEvent() to work with pinch events.
(cherry picked from commit 6b18df27f7)
This commit is contained in:
@@ -140,6 +140,11 @@ SDL_EventCategory SDL_GetEventCategory(Uint32 type)
|
||||
case SDL_EVENT_FINGER_MOTION:
|
||||
return SDL_EVENTCATEGORY_TFINGER;
|
||||
|
||||
case SDL_EVENT_PINCH_BEGIN:
|
||||
case SDL_EVENT_PINCH_UPDATE:
|
||||
case SDL_EVENT_PINCH_END:
|
||||
return SDL_EVENTCATEGORY_PINCH;
|
||||
|
||||
case SDL_EVENT_CLIPBOARD_UPDATE:
|
||||
return SDL_EVENTCATEGORY_CLIPBOARD;
|
||||
|
||||
@@ -240,6 +245,9 @@ SDL_Window *SDL_GetWindowFromEvent(const SDL_Event *event)
|
||||
case SDL_EVENTCATEGORY_RENDER:
|
||||
windowID = event->render.windowID;
|
||||
break;
|
||||
case SDL_EVENTCATEGORY_PINCH:
|
||||
windowID = event->pinch.windowID;
|
||||
break;
|
||||
default:
|
||||
// < 0 -> invalid event type (error is set by SDL_GetEventCategory)
|
||||
// else -> event has no associated window (not an error)
|
||||
|
||||
@@ -63,6 +63,7 @@ typedef enum SDL_EventCategory
|
||||
SDL_EVENTCATEGORY_DROP,
|
||||
SDL_EVENTCATEGORY_CLIPBOARD,
|
||||
SDL_EVENTCATEGORY_RENDER,
|
||||
SDL_EVENTCATEGORY_PINCH,
|
||||
} SDL_EventCategory;
|
||||
|
||||
extern SDL_EventCategory SDL_GetEventCategory(Uint32 type);
|
||||
|
||||
Reference in New Issue
Block a user