Physical mouse device and state management.
More...
#include <Mouse.hpp>
|
| ~Mouse () noexcept |
| Destructor.
|
|
bool | has_mouse () const noexcept |
| Check if there is a mouse connected.
|
|
void | set_mouse_grab (const bool grabbed) const noexcept |
| Toggle mouse grab.
|
|
void | warp_mouse (const float x, const float y) const noexcept |
| Move the mouse cursor to the given position within the window.
|
|
void | show_cursor () const noexcept |
| Show cursor.
|
|
void | hide_cursor () const noexcept |
| Hide cursor.
|
|
void | set_cursor_system (const SDL_SystemCursor cursor) noexcept |
| Set cursor to a system cursor.
|
|
void | set_cursor_custom (const std::string &cursor, const glm::ivec2 &hotspot) noexcept |
| Set custom cursor texture.
|
|
void | restore_cursor () noexcept |
| Set the cursor back to default.
|
|
virtual | ~WindowBindable () noexcept |
| Virtual destructor.
|
|
|
SDL_Cursor * | m_cursor |
| Holds data for a custom cursor.
|
|
Physical mouse device and state management.
Definition at line 21 of file Mouse.hpp.
◆ ~Mouse()
galaxy::Mouse::~Mouse |
( |
| ) |
|
|
noexcept |
◆ Mouse() [1/3]
◆ Mouse() [2/3]
galaxy::Mouse::Mouse |
( |
Mouse && | | ) |
|
|
privatedelete |
◆ Mouse() [3/3]
galaxy::Mouse::Mouse |
( |
const Mouse & | | ) |
|
|
privatedelete |
◆ has_mouse()
bool galaxy::Mouse::has_mouse |
( |
| ) |
const |
|
nodiscardnoexcept |
Check if there is a mouse connected.
- Returns
- True if there is a mouse device connected.
Definition at line 29 of file Mouse.cpp.
◆ set_mouse_grab()
void galaxy::Mouse::set_mouse_grab |
( |
const bool | grabbed | ) |
const |
|
noexcept |
Toggle mouse grab.
- Parameters
-
grabbed | This is true to grab keyboard, and false to release. |
Definition at line 34 of file Mouse.cpp.
◆ warp_mouse()
void galaxy::Mouse::warp_mouse |
( |
const float | x, |
|
|
const float | y ) const |
|
noexcept |
Move the mouse cursor to the given position within the window.
This function generates a mouse motion event.
- Parameters
-
x | The x coordinate within the window. |
y | The y coordinate within the window. |
Definition at line 39 of file Mouse.cpp.
◆ show_cursor()
void galaxy::Mouse::show_cursor |
( |
| ) |
const |
|
noexcept |
◆ hide_cursor()
void galaxy::Mouse::hide_cursor |
( |
| ) |
const |
|
noexcept |
◆ set_cursor_system()
void galaxy::Mouse::set_cursor_system |
( |
const SDL_SystemCursor | cursor | ) |
|
|
noexcept |
Set cursor to a system cursor.
- Parameters
-
cursor | SDL_SystemCursor enum. |
Definition at line 54 of file Mouse.cpp.
◆ set_cursor_custom()
void galaxy::Mouse::set_cursor_custom |
( |
const std::string & | cursor, |
|
|
const glm::ivec2 & | hotspot ) |
|
noexcept |
Set custom cursor texture.
- Parameters
-
cursor | Cursor texture in VFS. |
hotspot | The position of the cursor hot spot where the click is triggered. |
Definition at line 69 of file Mouse.cpp.
◆ restore_cursor()
void galaxy::Mouse::restore_cursor |
( |
| ) |
|
|
noexcept |
Set the cursor back to default.
Definition at line 107 of file Mouse.cpp.
◆ operator=() [1/2]
Move assignment operator.
◆ operator=() [2/2]
Mouse & galaxy::Mouse::operator= |
( |
const Mouse & | | ) |
|
|
privatedelete |
Copy assignment operator.
◆ destroy_cursor()
void galaxy::Mouse::destroy_cursor |
( |
| ) |
|
|
privatenoexcept |
Destroy any existing cursor.
Definition at line 113 of file Mouse.cpp.
◆ m_cursor
SDL_Cursor* galaxy::Mouse::m_cursor |
|
private |
Holds data for a custom cursor.
Definition at line 121 of file Mouse.hpp.
The documentation for this class was generated from the following files: