sdlHasEvent function

bool sdlHasEvent(
  1. int type
)

Check for the existence of a certain event type in the event queue.

If you need to check for a range of event types, use SDL_HasEvents() instead.

\param type the type of event to be queried; see SDL_EventType for details. \returns true if events matching type are present, or false if events matching type are not present.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_HasEvents

extern SDL_DECLSPEC bool SDLCALL SDL_HasEvent(Uint32 type)

Implementation

bool sdlHasEvent(int type) {
  final sdlHasEventLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Uint32 type), int Function(int type)>('SDL_HasEvent');
  return sdlHasEventLookupFunction(type) == 1;
}