Document that you can pass NULL to SDL_PeepEvents()

Fixes https://github.com/libsdl-org/sdlwiki/issues/547
This commit is contained in:
Sam Lantinga
2024-06-06 10:07:53 -07:00
parent 7547d80c05
commit 23db1062fc
2 changed files with 9 additions and 5 deletions

View File

@@ -878,6 +878,10 @@ static int SDL_PeepEventsInternal(SDL_Event *events, int numevents, SDL_EventAct
return -1;
}
if (action == SDL_ADDEVENT) {
if (!events) {
SDL_UnlockMutex(SDL_EventQ.lock);
return SDL_InvalidParamError("events");
}
for (i = 0; i < numevents; ++i) {
used += SDL_AddEvent(&events[i]);
}