Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between SDL_HasEvent() and SDL_GetEventState()?

Tags:

c++

sdl-2

    I understand that the SDL_HasEvent(Uint32 type) check whether type is present in the event queue or not. However, I don't understand what the SDL_GetEventState(Uint32 type) does.
    It is stated in the SDL2.0 wiki that we use SDL_GetEventState() to query the current processing state of a specified SDL_EventType. I thought these two functions are the same. Could anyone explain to me what the second function does? Thank you very much.

like image 247
Stoatman Avatar asked Nov 21 '25 12:11

Stoatman


1 Answers

SDL_GetEventState is related to the SDL_EventState function. The SDL_EventState function allows you to enable and disable events by type. In other words:

SDL_HasEvent tells you whether the event queue contains a certain type of event. SDL_GetEventState tells you whether the event queue is ignoring a certain type of event.

like image 82
Conduit Avatar answered Nov 24 '25 04:11

Conduit