SDL_EventState(3)

πŸ’– SDL_EventState πŸ’–

okay bestie, welcome to the SDL API Reference corner of the group chat, because today we are talking about SDL_EventState(3) and honestly? it's giving event queue manager and I'm obsessed 🫢


✨ NAME ✨

SDL_EventState β€” this function lets you set the state of processing certain events. like, you're the bouncer at the club and some event types are on the list and some are... not πŸ’…


🌸 SYNOPSIS 🌸

#include "SDL.h"

Uint8 SDL_EventState(Uint8 type, int state);

look at that signature. clean. iconic. two args and a return value, no notes πŸ’œ


πŸ¦‹ DESCRIPTION πŸ¦‹

So. This function allows you to set the state of processing certain event type's. That's the whole vibe. You hand it a type and a state, and it does the thing ✨

Here's the tea on what state can be, because this is the part that actually matters:

  • If state is set to SDL_IGNORE, that event type will be automatically dropped from the event queue and will not be filtered. like it's gone gone. not parked, not pending, not "we'll get to it later" β€” dropped 😭
  • If state is set to SDL_ENABLE, that event type will be processed normally. business as usual, no cap πŸŽ€
  • If state is set to SDL_QUERY, then SDL_EventState will return the current processing state of the specified event type. so it's not setting anything, it's just asking "hey girl, what's your status?" and getting a real answer back πŸ‘‘
A list of event type's can be found in the SDL_Event section. go look, bestie, the receipts are there 🧚

⭐ SEE ALSO ⭐

  • SDL_Event β€” the whole event family, the source of truth, the main character πŸ‘‘

and that's the page fr fr πŸ’– stay hydrated, keep your event queue clean, and remember: ignore means DROPPED, not filtered 🌈

SDL Β· Tue 11 Sep 2001, 22:59 Β· mwah, bye bestie πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from