P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
Loading...
Searching...
No Matches
RayMouse.hpp
Go to the documentation of this file.
1
10
11#ifndef RAYMOUSE_HPP_
12#define RAYMOUSE_HPP_
13
14//Raylib (without conflict)
15#include "RaylibAliases.hpp"
16
17//Interface
18#include "IMouse.hpp"
19
28class RayMouse : public graphic::IMouse {
29
30 public:
31 RayMouse() = default;
32
33 ~RayMouse() override = default;
34
35 bool isButtonPressed(Buttons key) const override {
36 return raylib::IsMouseButtonPressed(key);
37 }
38 bool isButtonDown(Buttons key) const override {
39 return raylib::IsMouseButtonDown(key);
40 }
41 bool isButtonReleased(Buttons key) const override {
42 return raylib::IsMouseButtonReleased(key);
43 }
44 bool isButtonUp(Buttons key) const override {
45 return raylib::IsMouseButtonUp(key);
46 }
47
48 Vector2f getPosition() const override {
49 return {float(raylib::GetMouseX()), float(raylib::GetMouseY())};
50 }
51 void setPosition(Vector2f position) override {
52 raylib::SetMousePosition(int(position.x), int(position.y));
53 }
54
55 float GetMouseWheelMove() const override {
56 return raylib::GetMouseWheelMove();
57 }
58};
59
61
62#endif /* !RAYMOUSE_HPP_ */
bool isButtonUp(Buttons key) const override
notice if a button is up
Definition RayMouse.hpp:44
bool isButtonDown(Buttons key) const override
notice if a button is down
Definition RayMouse.hpp:38
RayMouse()=default
bool isButtonPressed(Buttons key) const override
notice if a button is pressed
Definition RayMouse.hpp:35
Vector2f getPosition() const override
get the position of the mouse
Definition RayMouse.hpp:48
void setPosition(Vector2f position) override
set the position of the mouse
Definition RayMouse.hpp:51
bool isButtonReleased(Buttons key) const override
notice if a button is released
Definition RayMouse.hpp:41
float GetMouseWheelMove() const override
get the mouse wheel move
Definition RayMouse.hpp:55
~RayMouse() override=default
Mouse interface.
Definition IMouse.hpp:30
Buttons
Definition IMouse.hpp:39
Vector2< double > Vector2f
Definition Vector2.hpp:112
T y
Definition Vector2.hpp:21
T x
Definition Vector2.hpp:21