EventSystem.odin

ResetWindowFlags

ResetWindowFlags (state: ^WindowState)

Resets all transient window flags in preparation for the next frame. This should be called at the start of every frame.

Parameters:
  • state: Pointer to the WindowState struct to reset

ConvertSDLKeycodeToKEYS

ConvertSDLKeycodeToKEYS (sym: sdl2.Keycode) -> KEYS

Converts an SDL2 keycode to the engine's KEYS enum. Returns KEYS.NONE if no match is found. NOTE: This is internal and only documented for internal use

Parameters:
  • sym: SDL2 keycode
Returns: Corresponding KEYS enum value

ConvertSDLModToMODKEYS

ConvertSDLModToMODKEYS (mod: sdl2.Keymod) -> MOD_KEYS

Converts SDL2 modifier flags into the engine's MOD_KEYS enum. Only returns one modifier at a time. Returns MOD_KEYS.NONE if no relevant modifier is active. NOTE: This is internal and only documented for internal use

Parameters:
  • mod: SDL2 modifier bitfield
Returns: Corresponding MOD_KEYS value

HandleEvents

HandleEvents (mouse: ^Mouse, keyboard: ^Keyboard, win: ^WindowState)

Polls SDL2 for all events and updates the engine's input and window state. This function should be called once per frame.

Parameters:
  • mouse: Pointer to the Mouse struct to update
  • keyboard: Pointer to the Keyboard struct to update
  • win: Pointer to the WindowState struct to update