aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Input/je_mouse.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-23 12:23:58 +0800
committerchai <chaifix@163.com>2018-10-23 12:23:58 +0800
commit40fc27154fe754181934dc7ee31375e6bdfb33fc (patch)
tree897ad98d759bc308ef66561181ba88b85f2ccd47 /src/libjin/Input/je_mouse.cpp
parent1480c9445100075c9e1a894eb07c0ef727b509a1 (diff)
*merge from minimal
Diffstat (limited to 'src/libjin/Input/je_mouse.cpp')
-rw-r--r--src/libjin/Input/je_mouse.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libjin/Input/je_mouse.cpp b/src/libjin/Input/je_mouse.cpp
new file mode 100644
index 0000000..476b1a2
--- /dev/null
+++ b/src/libjin/Input/je_mouse.cpp
@@ -0,0 +1,28 @@
+#include "../core/je_configuration.h"
+#if defined(jin_input)
+
+#include "SDL.h"
+
+#include "je_mouse.h"
+
+namespace JinEngine
+{
+ namespace Input
+ {
+
+ void Mouse::getState(int* x, int* y)
+ {
+ #ifdef jin_input == jin_input_sdl
+ SDL_GetMouseState(x, y);
+ #endif
+ }
+
+ void Mouse::setVisible(bool visible)
+ {
+ SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE);
+ }
+
+ } // namespace Input
+} // namespace JinEngine
+
+#endif // defined(jin_input) \ No newline at end of file