1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef MOUSE_H
- #define MOUSE_H
- #include "GameEngine.h"
- class Mouse
- {
- public:
- static bool isDown(int mapping);
- static bool isReleased(int mapping);
- static unsigned int getDownTime(int mapping);
- static void resetDownTime(int mapping);
- static bool map(int mapping, int key);
-
- friend GameEngine;
- private:
- Mouse();
-
- static const int NUMBER_OF_BUTTONS = GLFW_MOUSE_BUTTON_LAST + 1;
- static bool isInRange(int i);
- static void init();
- static void tick();
- static bool press(int button);
- static bool release(int button);
-
- bool down = false;
- bool shouldRelease = false;
- unsigned int downTime = 0;
-
- static Mouse mouseArray[NUMBER_OF_BUTTONS];
- static int mappingArray[NUMBER_OF_BUTTONS];
- };
- #endif
|