SDL_FlushEvents(3)
β¨ SDL_FlushEvents β¨
okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_FlushEvents(3) π
πΈ NAME πΈ
SDL_FlushEvents β clear events of a range of types from the event queue π§Ήβ¨
π SYNOPSIS π
#include <SDL3/SDL_events.h>
void SDL_FlushEvents(Uint32 minType, Uint32 maxType);
π¦ DESCRIPTION π¦
This will unconditionally remove any events from the queue that are in the range of minType to maxType, inclusive. no vibe check, no "hmm should i", it just yeets them. ποΈ
If you need to remove a single event type, use SDL_FlushEvent() instead β that's the solo version, this one is the group chat. π¬
ngl it's also completely normal to just ignore events you don't care about in your event loop without calling this function at all. like, living your life and simply not responding? valid. π
This function only affects currently queued events. So if you want to make sure that all pending OS events are flushed, you can call SDL_PumpEvents() on the main thread immediately before the flush call. pump first, then flush. that's the order, fr fr. π₯
π FUNCTION PARAMETERS π
minTypeβ the low end of event type to be cleared, inclusive; seeSDL_EventTypefor details. the bottom of the range, she's the floor π«ΆmaxTypeβ the high end of event type to be cleared, inclusive; seeSDL_EventTypefor details. the top of the range, she's the ceiling π
π THREAD SAFETY π
It is safe to call this function from any thread. literally any of them. go off, all your threads can do this π
β AVAILABILITY β
This function is available since SDL 3.2.0. if you're on something older... babe, we need to talk π
π SEE ALSO π
Simple Directmedia Layer made this, and this lil doc is sitting on SDL 3.4.18 πΈ so yeah β mwah, kisses from the SDL 3.4.18 era, thanks for reading bestie, you ate this page fr fr π β¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms