SDL_FilterEvents(3)
π SDL_FilterEvents(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one is literally called SDL_FilterEvents and it's lowkey iconic. sit down, grab a strawberry π, let's go.
β¨ NAME β¨
SDL_FilterEvents β run a specific filter function on the current event queue, removing any events for which the filter returns false.
like, it does a little vibe check on your event queue and yeets the ones your filter says no to. periodt. π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_events.h>
void SDL_FilterEvents(SDL_EventFilter filter, void *userdata);
that's it, that's the whole signature, no cap.
πΈ DESCRIPTION πΈ
so, if you want the full lore, go read SDL_SetEventFilter() β this one's whole deal is explained over there.
the BIG difference though, and this is the part that matters: unlike SDL_SetEventFilter(), this function does NOT change the filter permanently. it only uses the filter you hand it until this function returns. that's it. after that, everything goes back to how it was. it's giving "borrowed your hoodie for one night and gave it back" energy π«Ά
no lasting commitment, just a quick little pass through the queue. obsessed.
π FUNCTION PARAMETERS π
filterβ theSDL_EventFilterfunction to call when an event happens. this is the little bouncer at the door, deciding who gets in and who gets filtered out πuserdataβ a pointer that is passed tofilter. your lil care package, hand-delivered straight to your filter function π
π§ THREAD SAFETY π§
it is safe to call this function from any thread. yes, any thread. go off, multitask, slay. β¨
β AVAILABILITY β
this function is available since SDL 3.2.0. so if you're on anything older, bestie, that's a no from the compiler π
π SEE ALSO π
go read those too, they're the sibling lore, iykyk π
Simple Directmedia Layer made this, and this particular page is from SDL 3.4.18. tysm for reading, love u, bye bestie ππ¦π
π¦ 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