Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
foray::osi::Event Class Reference

Base class for operating system events. More...

#include <foray_event.hpp>

Inheritance diagram for foray::osi::Event:
foray::Polymorphic foray::osi::EventInput foray::osi::EventWindowCloseRequested foray::osi::EventWindowFocusChanged foray::osi::EventWindowResized foray::osi::EventInputAnalogue foray::osi::EventInputBinary foray::osi::EventInputDeviceAvailability foray::osi::EventInputDirectional foray::osi::EventInputMouseMoved

Public Types

enum class  EType : int16_t {
  Undefined = -1 , InputAnalogue , InputBinary , InputDirectional ,
  InputMouseMoved , WindowResized , WindowFocusChanged , WindowCloseRequested ,
  WindowItemDropped , InputDeviceAvailability , Custom , ENUM_MAX
}
 Event type enum, allows handling events in switch structures. More...
 

Public Member Functions

 Event ()=default
 
 Event (Window *const source, const uint32_t timestamp, const EType type)
 
 Event (Window *const source, const uint32_t timestamp, const int8_t customtype)
 
virtual ~Event ()
 

Public Attributes

WindowSource = nullptr
 Source window that recorded the event, if applicable.
 
uint32_t Timestamp = 0
 Timestamp when the action was recorded.
 
EType Type = EType::Undefined
 Event type.
 
int16_t CustomType = 0
 For custom event type overloads, this value may be set.
 
SDL_Event RawSdlEventData = {}
 Raw SDL_Event data this event was derived from.
 

Additional Inherited Members

- Protected Member Functions inherited from foray::Polymorphic
virtual void __makeMePolymorphic ()
 

Detailed Description

Base class for operating system events.

Member Enumeration Documentation

◆ EType

enum class foray::osi::Event::EType : int16_t
strong

Event type enum, allows handling events in switch structures.

Enumerator
Undefined 
InputAnalogue 

Analogue inputs, ex. controller stick axis.

InputBinary 

Binary inputs, ex. buttons, keys.

InputDirectional 

Directional stateless inputs, ex. scroll wheel, joystick hatswitches, etc.

InputMouseMoved 

Mouse position input type.

WindowResized 

WindowPtr resized.

WindowFocusChanged 

WindowPtr lost/gained focus.

WindowCloseRequested 

User requested window closed.

WindowItemDropped 

File/Folder was dragged on top of the window.

InputDeviceAvailability 

An input device was connected or removed.

Custom 

Custom type.

ENUM_MAX 

Constructor & Destructor Documentation

◆ Event() [1/3]

foray::osi::Event::Event ( )
inlinedefault

◆ Event() [2/3]

foray::osi::Event::Event ( Window *const  source,
const uint32_t  timestamp,
const EType  type 
)
inline

◆ Event() [3/3]

foray::osi::Event::Event ( Window *const  source,
const uint32_t  timestamp,
const int8_t  customtype 
)
inline

◆ ~Event()

virtual foray::osi::Event::~Event ( )
inlinevirtual

Member Data Documentation

◆ CustomType

int16_t foray::osi::Event::CustomType = 0

For custom event type overloads, this value may be set.

◆ RawSdlEventData

SDL_Event foray::osi::Event::RawSdlEventData = {}

Raw SDL_Event data this event was derived from.

◆ Source

Window* foray::osi::Event::Source = nullptr

Source window that recorded the event, if applicable.

◆ Timestamp

uint32_t foray::osi::Event::Timestamp = 0

Timestamp when the action was recorded.

◆ Type

EType foray::osi::Event::Type = EType::Undefined

Event type.


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