galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::MouseWheel Struct Referencefinal

Contains mouse wheel movement data. More...

#include <MouseWheel.hpp>

+ Inheritance diagram for galaxy::MouseWheel:
+ Collaboration diagram for galaxy::MouseWheel:

Public Member Functions

 MouseWheel (const float ax, const float ay, const SDL_MouseWheelDirection dir, const float mx, const float my, const int tx, const int ty) noexcept
 Constructor.
 
- Public Member Functions inherited from galaxy::Event
 Event () noexcept
 Constructor.
 
 Event (Event &&) noexcept
 Move constructor.
 
Eventoperator= (Event &&) noexcept
 Move assignment operator.
 
 Event (const Event &) noexcept
 Copy constructor.
 
Eventoperator= (const Event &) noexcept
 Copy assignment operator.
 
virtual ~Event () noexcept
 Destructor.
 
void consume () noexcept
 Mark this event as consumed.
 
bool consumed () const noexcept
 Is this event already consumed?
 

Public Attributes

float m_amount_x = 0.0f
 The amount scrolled horizontally, positive to the right and negative to the left.
 
float m_amount_y = 0.0f
 The amount scrolled vertically, positive away from the user and negative toward the user.
 
SDL_MouseWheelDirection m_direction = SDL_MOUSEWHEEL_NORMAL
 When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back.
 
float m_mouse_x = 0.0f
 X coordinate, relative to window.
 
float m_mouse_y = 0.0f
 Y coordinate, relative to window.
 
int m_total_x = 0
 The amount scrolled horizontally, accumulated to whole scroll "ticks".
 
int m_total_y = 0
 The amount scrolled vertically, accumulated to whole scroll "ticks".
 

Additional Inherited Members

- Protected Attributes inherited from galaxy::Event
bool m_handled
 Keeps track if event has been used already.
 

Detailed Description

Contains mouse wheel movement data.

Definition at line 19 of file MouseWheel.hpp.

Constructor & Destructor Documentation

◆ MouseWheel()

galaxy::MouseWheel::MouseWheel ( const float ax,
const float ay,
const SDL_MouseWheelDirection dir,
const float mx,
const float my,
const int tx,
const int ty )
noexcept

Constructor.

Parameters
axThe amount scrolled horizontally, positive to the right and negative to the left.
ayThe amount scrolled vertically, positive away from the user and negative toward the user.
dirMousewheel direction.
mxX coordinate, relative to window.
myY coordinate, relative to window.
txThe amount scrolled horizontally, accumulated to whole scroll "ticks".
tyThe amount scrolled vertically, accumulated to whole scroll "ticks".

Definition at line 12 of file MouseWheel.cpp.

Member Data Documentation

◆ m_amount_x

float galaxy::MouseWheel::m_amount_x = 0.0f

The amount scrolled horizontally, positive to the right and negative to the left.

Definition at line 37 of file MouseWheel.hpp.

◆ m_amount_y

float galaxy::MouseWheel::m_amount_y = 0.0f

The amount scrolled vertically, positive away from the user and negative toward the user.

Definition at line 42 of file MouseWheel.hpp.

◆ m_direction

SDL_MouseWheelDirection galaxy::MouseWheel::m_direction = SDL_MOUSEWHEEL_NORMAL

When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back.

Definition at line 48 of file MouseWheel.hpp.

◆ m_mouse_x

float galaxy::MouseWheel::m_mouse_x = 0.0f

X coordinate, relative to window.

Definition at line 53 of file MouseWheel.hpp.

◆ m_mouse_y

float galaxy::MouseWheel::m_mouse_y = 0.0f

Y coordinate, relative to window.

Definition at line 58 of file MouseWheel.hpp.

◆ m_total_x

int galaxy::MouseWheel::m_total_x = 0

The amount scrolled horizontally, accumulated to whole scroll "ticks".

Definition at line 63 of file MouseWheel.hpp.

◆ m_total_y

int galaxy::MouseWheel::m_total_y = 0

The amount scrolled vertically, accumulated to whole scroll "ticks".

Definition at line 68 of file MouseWheel.hpp.


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