include/Spectre/Input/InputEvent.h: Move MouseButton::Type to Mouse class.
This commit is contained in:
parent
b2ca926a00
commit
762d26f368
5 changed files with 35 additions and 37 deletions
|
|
@ -4,22 +4,10 @@
|
|||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <Spectre/Input/Mouse.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
namespace MouseButton {
|
||||
|
||||
enum Type {
|
||||
Unknown,
|
||||
Left,
|
||||
Right,
|
||||
Middle,
|
||||
Button1,
|
||||
Button2,
|
||||
NUM_MBUTTONS,
|
||||
};
|
||||
};
|
||||
|
||||
namespace Key {
|
||||
|
||||
enum Type {
|
||||
|
|
@ -130,7 +118,7 @@ typedef struct InputEvent
|
|||
};
|
||||
|
||||
struct MouseButtonEvent {
|
||||
MouseButton::Type button;
|
||||
Mouse::Button button;
|
||||
bool pressed; /* true if pressed, false if released. */
|
||||
|
||||
std::string getName() const;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,23 @@
|
|||
|
||||
#include <string>
|
||||
#include <Spectre/Math/Vector2.h>
|
||||
#include "InputEvent.h"
|
||||
#include "InputDevice.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class Mouse : public InputDevice
|
||||
{
|
||||
public :
|
||||
enum Button {
|
||||
Unknown,
|
||||
Left,
|
||||
Right,
|
||||
Middle,
|
||||
Button1,
|
||||
Button2,
|
||||
NUM_MBUTTONS
|
||||
};
|
||||
|
||||
public :
|
||||
virtual ~Mouse();
|
||||
|
||||
|
|
@ -19,11 +29,11 @@ public :
|
|||
|
||||
//virtual Vector2i getPositionAbs() const = 0;
|
||||
|
||||
virtual bool isButtonDown(MouseButton::Type button) const = 0;
|
||||
virtual bool isButtonDown(Button button) const = 0;
|
||||
|
||||
static std::string getButtonName(MouseButton::Type button);
|
||||
static std::string getButtonName(Button button);
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
}; // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INPUT_MOUSE_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue