Optimized SDL_HasEvent() and SDL_HasEvents()

Also document the counting behavior of SDL_PEEKEVENT.

Fixes https://github.com/libsdl-org/SDL/issues/6209
This commit is contained in:
Sam Lantinga
2024-09-25 21:20:00 -07:00
parent 3abb213083
commit d9a7da4fac
2 changed files with 19 additions and 3 deletions

View File

@@ -1011,7 +1011,7 @@ typedef enum SDL_EventAction
* event queue.
* - `SDL_PEEKEVENT`: `numevents` events at the front of the event queue,
* within the specified minimum and maximum type, will be returned to the
* caller and will _not_ be removed from the queue.
* caller and will _not_ be removed from the queue. If you pass NULL for `events`, then `numevents` is ignored and the total number of matching events will be returned.
* - `SDL_GETEVENT`: up to `numevents` events at the front of the event queue,
* within the specified minimum and maximum type, will be returned to the
* caller and will be removed from the queue.