The docs say of SDL_PushEvent that “A common reason for error is the event queue being full” so in my app I incorporate a ‘retry’ mechanism like this (the queue is drained in another thread):
while (SDL_PushEvent (&event) < 0) SDL_Delay (1) ;
But I notice that SDL itself does not in general bother to check for this condition, for example in SDL_android.c we have this:
SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND); SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND); SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0); SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESTORED, 0, 0);
SDL_SendAppEvent and SDL_SendWindowEvent return a Boolean indicating whether the event was successfully posted or not, but this is ignored. Can I conclude that the “common reason for error” is not so common after all?