8#ifndef GALAXY_INPUT_MOUSE_HPP_
9#define GALAXY_INPUT_MOUSE_HPP_
11#include <glm/vec2.hpp>
12#include <SDL3/SDL_mouse.h>
65 void warp_mouse(
const float x,
const float y)
const noexcept;
105 void use_custom_mouse(
const std::string& cursor,
const glm::ivec2& offset = glm::ivec2(0, 0));
150 void set_mouse_mapping(
const int x,
const int y,
const float scale_x,
const float scale_y)
const noexcept;
bool set_window_mouse_rect(iRect &rect) noexcept
Confines the cursor to the specified area of a window.
glm::ivec2 mouse_delta(int *dx, int *dy) noexcept
Retrieve relative mouse movement (delta) since the last call.
sl::Bitmap * m_cursor_bitmap
Mouse custom bitmap.
void set_mouse_mapping(const int x, const int y, const float scale_x, const float scale_y) const noexcept
Set mouse relative mapping to another coord space.
bool is_mouse_down(const MouseButton btn) const noexcept
Check if a mouse button was pressed.
void set_cursor_system(const SDL_SystemCursor cursor) noexcept
Set cursor to a system cursor.
Mouse() noexcept
Constructor.
Mouse & operator=(Mouse &&)=delete
Move assignment operator.
void clear_mouse_mapping() const noexcept
Return mouse_x()/mouse_y() to plain screen coordinates.
void destroy_cursor() noexcept
Destroy any existing cursor.
bool relative_mouse_mode() const noexcept
Return whether relative mouse mode is currently enabled.
void hide_cursor() const noexcept
Hide cursor.
Mouse & operator=(const Mouse &)=delete
Copy assignment operator.
void set_relative_mouse_mode(const bool enabled) const noexcept
Enable or disable relative mouse mode (locks cursor to window, hides it, and reports relative motion)...
Mouse(Mouse &&)=delete
Move constructor.
void restore_cursor() noexcept
Set the cursor back to default.
void set_mouse_grab(const bool grabbed) const noexcept
Toggle mouse grab.
int mouse_y() const noexcept
Get current cursor y position.
void show_cursor() const noexcept
Show cursor.
SDL_Cursor * m_cursor
Holds data for a custom cursor.
int mouse_x() const noexcept
Get current cursor x position.
Mouse(const Mouse &)=delete
Copy constructor.
bool mouse_connected() const noexcept
Check if there is a mouse connected.
void warp_mouse(const float x, const float y) const noexcept
Move the mouse cursor to the given position within the window.
void use_custom_mouse(const std::string &cursor, const glm::ivec2 &offset=glm::ivec2(0, 0))
Replaces the system cursor with a bitmap.
WindowBindable() noexcept
Constructor.
Rect< int > iRect
Type definition for an int rectangle.
MouseButton
Enum class representing mouse buttons.