Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
Flint::AppEvent Struct Reference

A tagged union representing a single application input or window event. More...

#include <flint/input/event.h>

+ Collaboration diagram for Flint::AppEvent:

Public Attributes

EventType type
 
union { 
 
   struct { 
 
      GamepadAxis   axis 
 
      float   value 
 
   }   gamepadAxis 
 Data for GamepadAxisMove events.
 
   struct { 
 
      GamepadButton   button 
 
   }   gamepadButton 
 Data for GamepadButtonPressed / GamepadButtonReleased events.
 
   struct { 
 
      SDL_Keycode   keycode 
 
   }   key 
 Data for KeyDown / KeyUp events.
 
   struct { 
 
      Vec2< float >   position 
 
   }   mouseMove 
 Data for MouseMove events.
 
   struct { 
 
      uint8_t   button 
 
      Vec2f   position 
 
   }   mouseButton 
 Data for MouseButtonDown / MouseButtonUp events.
 
};  
 

Detailed Description

A tagged union representing a single application input or window event.

The active union member is determined by the type field. Access the appropriate sub-struct after checking type.

Definition at line 90 of file event.h.

Member Data Documentation

◆ axis

GamepadAxis Flint::AppEvent::axis

Which axis changed.

Definition at line 96 of file event.h.

◆ button [1/2]

GamepadButton Flint::AppEvent::button

Which button changed state.

Definition at line 102 of file event.h.

◆ button [2/2]

uint8_t Flint::AppEvent::button

SDL mouse button index.

Definition at line 117 of file event.h.

◆ keycode

SDL_Keycode Flint::AppEvent::keycode

SDL virtual key identifier.

Definition at line 107 of file event.h.

◆ position [1/2]

Vec2<float> Flint::AppEvent::position

Cursor position in window-space pixels.

Definition at line 112 of file event.h.

◆ position [2/2]

Vec2f Flint::AppEvent::position

Screen-space pixel coordinates of the cursor at the exact frame fraction of the click.

Definition at line 118 of file event.h.

◆ type

EventType Flint::AppEvent::type

Discriminator for which union member is active.

Definition at line 91 of file event.h.

◆ value

float Flint::AppEvent::value

New axis value in [-1, 1] (triggers in [0, 1]).

Definition at line 97 of file event.h.


The documentation for this struct was generated from the following file: