aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorMichael Bishop <mbtyke@yahoo.com>2014-01-12 12:46:35 -0500
committerJukka Jylänki <jujjyl@gmail.com>2014-06-10 02:00:06 +0300
commitb71f0def47d8ffbbaffcdaccba20713db5f0f5d1 (patch)
treefdb6f91389860dbbe1dbb17e3e66edf5a8e0526d /system
parentfee203ed899368e0bd0d6bd6c88c72b0ca8d74e8 (diff)
Added an additional call: `SDL_SetEventHandler()` to SDL.
This is not in the official API but it is needed for Mozilla Persona, which makes sure an event handler is on the stack when `navigator.id.request()` is called. Using the standard SDL api, this can never be the case because an SDL app retrieves events from SDL’s event queue independently of when those events are added to the queue (through event handlers that SDL itself registers). With this additional call, apps can receive events directly in response to an actual event handler which will still be on the stack when the event is handled by the SDL-based application.
Diffstat (limited to 'system')
-rw-r--r--system/include/SDL/SDL_events.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/system/include/SDL/SDL_events.h b/system/include/SDL/SDL_events.h
index 183ea4b2..971282db 100644
--- a/system/include/SDL/SDL_events.h
+++ b/system/include/SDL/SDL_events.h
@@ -615,6 +615,13 @@ extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
void *userdata);
+/**
+ * Use instead of SDL_PollEvent. Your application will be called whenever there
+ * are events available.
+ */
+extern DECLSPEC void SDLCALL SDL_SetEventHandler(SDL_EventFilter handler,
+ void *userdata);
+
/*@{*/
#define SDL_QUERY -1
#define SDL_IGNORE 0