Skip to content

Commit

Permalink
Updated documentation to note that the event callback is called on th…
Browse files Browse the repository at this point in the history
…e same thread as the main iteration callback
  • Loading branch information
slouken committed Nov 4, 2023
1 parent 4481754 commit 46b940d
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions docs/README-main-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,11 @@ Next:
int SDL_AppEvent(const SDL_Event *event);
```
This will be called once for each event pushed into the SDL queue. This may be
called from any thread, and possibly in parallel to SDL_AppIterate. The fields
in `event` should not be free'd (as you would normally need to do for
SDL_EVENT_DROP_FILE, etc), and your app should not call SDL_PollEvent,
SDL_PumpEvent, etc, as SDL will manage this for you. Return values are the
same as from SDL_AppIterate(), so you can terminate in response to
SDL_EVENT_QUIT, etc.
One can still use their own event filters and watchers. Filters set with
SDL_SetEventFilter will run before SDL_AppEvent, and if it filters out the
event, SDL_AppEvent will not run at all. Watchers set with SDL_AddEventWatch
will run in serial to SDL_AppEvent, as SDL_AppEvent itself is built on top of
an event watcher; which one runs first is not guaranteed.
This will be called whenever an SDL event arrives, on the thread that runs
SDL_AppIterate. You don't need to call SDL_CleanupEvent(), and your app
should not call SDL_PollEvent, SDL_PumpEvent, etc, as SDL will manage this
for you. Return values are the same as from SDL_AppIterate(), so you can
terminate in response to SDL_EVENT_QUIT, etc.
Finally:
Expand Down

0 comments on commit 46b940d

Please sign in to comment.