SDL_HasEvent(3)

✨ SDL_HasEvent(3) ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual πŸ’– this one's about peeking into your event queue and going "hey, is this kind of event in there?" β€” and it's giving detective energy, fr fr πŸ”


🌸 NAME 🌸

SDL_HasEvent β€” check if a certain event type is literally just vibing in the event queue. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_events.h>

bool SDL_HasEvent(Uint32 type);

πŸŽ€ DESCRIPTION πŸŽ€

So like, you hand it an event type and it tells you whether events of that type are hanging out in the queue. Simple, iconic, no drama. 🫢

but bestie, listen β€” if you need to check for a range of event types, you should use SDL_HasEvents() instead. Don't come for me, that's just the rule. πŸ™ˆ

πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • type β€” the type of event you're querying, queen πŸ‘‘; peep SDL_EventType for the deets.

⭐ RETURN VALUE ⭐

  • Returns true if events matching type are present πŸ’–
  • Returns false if events matching type are not present πŸ’€

🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread. no cap. every thread. go off. 🌈πŸ”₯


🌸 AVAILABILITY 🌸

This function has been available since SDL 3.2.0 ✨ so if you're on something older, that's a vibe check fail, sorry babe.


πŸ“ SEE ALSO πŸ“


okay that's the whole page, you ate it, periodt πŸ’…βœ¨

mwah πŸ’‹ this has been brought to you by Simple Directmedia Layer β€” SDL 3.4.18, the iconic-est. stay hydrated, check your event queue, and don't forget to free your stuff πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from