1
0
Fork 0
spectre/include/Spectre/Input/Mouse.h
Henrik Hautakoski 7e79663dce include/Spectre/Input/Mouse.h rename Button1,Button2 to XButton1 and XButton2
Button1 and Button2 are defined by Xlib. So lets change our ones to avoid headache.
2020-12-26 18:08:39 +01:00

42 lines
827 B
C++

#ifndef SPECTRE_INPUT_MOUSE_H
#define SPECTRE_INPUT_MOUSE_H
#include <string>
#include <Spectre/Math/Vector2.h>
#include <Spectre/Input/InputDevice.h>
namespace sp {
class Mouse : public InputDevice
{
public :
enum Button {
Unknown,
Left,
Right,
Middle,
XButton1,
XButton2,
NUM_MBUTTONS
};
public :
virtual ~Mouse();
// Get the position in relative (focused window) coordinates.
// coordinates are relative to the window's top-left corner.
virtual Vector2f getPosition() const = 0;
// Get the position in absolute (screen) coordinates.
// 0,0 is located at the screen's top-left corner.
virtual Vector2f getAbsPosition() const = 0;
virtual bool isButtonDown(Button button) const = 0;
static std::string getButtonName(Button button);
};
}; // namespace sp
#endif /* SPECTRE_INPUT_MOUSE_H */