-
Notifications
You must be signed in to change notification settings - Fork 0
cInputState
A struct to hold a complex input state. Can hold every key pressed on the keyboard pressed, a click event, and flags to decide if there is a click input or not, and if the input is a quit-like input.
const Uint8*
An array of unsigned 8-bit integers that hold the state of all keys on the keyboard. Interface with this using SDL_SCANCODE defines; to get a boolean value determining if a key is pressed or not, use the following: keyStates[SDL_SCANCODE_<key>]. Gives 1 if pressed, 0 if unpressed.
SDL_MouseButtonEvent
Holds the latest SDL mouse click event. See the SDL Documentation for more information.
SDL_MouseMotionEvent
Holds the latest SDL mouse motion event. See the SDL Documentation for more information.
SDL_Keysym
Holds the latest SDL keyboard information, in a different manner than the raw inputs from keyStates. See the SDL Documentation for more information.
bool
A flag to signal if there was a click input collected. If true, click is filled with a valid click input. If false, click should be ignored and not read to determine inputs.
bool
A flag to signal if the input given was quit-like; In particular, if an SDL_QUIT event type is triggered (the window close button is clicked, the task is ended somehow, etc). For each time you read a cInputState, it is best practice to only continue the current loop/game state if the user isn't trying to quit.
cInputState cGetInputState(bool useMouse)
Gets the current input state this frame/input window and returns a cInputState. If useMouse is true, mouse click events will be collected.