SDL Utility
Mouse.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 #include "structures/Vector2.hpp"
10 
16 class Mouse
17 {
18 public:
22  enum class Button {
23  Left = 1,
24  Right = 2,
25  Middle = 3,
26  XButton1 = 4,
27  XButton2 = 5
28  };
29 
36 
43  static bool IsButtonDown(Button button);
44 
51 
58  static Vector2i GetPosition(const RenderWindow& relativeTo);
59 
65  static void SetPosition(const Vector2i& position);
66 
73  static void SetPosition(const Vector2i& position, const RenderWindow& relativeTo);
74 };
75 SDLU_END
A wrapper around SDL_Window and SDL_Renderer.
#define SDLU_BEGIN
Definition: Util.hpp:32
uint32_t Uint32
Definition: Util.hpp:23
Provides a structure for simple vector calculations.
A static class that contains/handles data about mouse position and button states.
Definition: Mouse.hpp:17
static bool IsButtonDown(Button button)
Checks if a specific button is pressed.
static Uint32 GetButtonState()
Returns the current mouse button state.
Button
Mouse buttons.
Definition: Mouse.hpp:22
static void SetPosition(const Vector2i &position, const RenderWindow &relativeTo)
Sets current relative position of the mouse.
static Vector2i GetPosition()
Gets the absolute position of the mouse.
static Vector2i GetPosition(const RenderWindow &relativeTo)
Gets current relative position of the mouse.
static void SetPosition(const Vector2i &position)
Sets the absolute position of the mouse.
A class that handles window related functionality.
Definition: RenderWindow.hpp:29
A struct to handle basic 2D vector operations.
Definition: Vector2.hpp:22