diff options
Diffstat (limited to 'src/libjin/input')
-rw-r--r-- | src/libjin/input/event.cpp | 7 | ||||
-rw-r--r-- | src/libjin/input/event.h | 91 | ||||
-rw-r--r-- | src/libjin/input/input.h | 8 | ||||
-rw-r--r-- | src/libjin/input/joypad.cpp | 0 | ||||
-rw-r--r-- | src/libjin/input/joypad.h | 14 | ||||
-rw-r--r-- | src/libjin/input/keyboard.cpp | 0 | ||||
-rw-r--r-- | src/libjin/input/keyboard.h | 15 | ||||
-rw-r--r-- | src/libjin/input/mouse.cpp | 22 | ||||
-rw-r--r-- | src/libjin/input/mouse.h | 29 |
9 files changed, 0 insertions, 186 deletions
diff --git a/src/libjin/input/event.cpp b/src/libjin/input/event.cpp deleted file mode 100644 index 8eb45e6..0000000 --- a/src/libjin/input/event.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "event.h" -#include "SDL2\SDL.h" - -namespace jin -{ - -}
\ No newline at end of file diff --git a/src/libjin/input/event.h b/src/libjin/input/event.h deleted file mode 100644 index 9feb3a5..0000000 --- a/src/libjin/input/event.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __JIN_EVENT_H -#define __JIN_EVENT_H -#include "../modules.h" -#if JIN_MODULES_INPUT - -namespace jin -{ -namespace input -{ -#if JIN_INPUT_SDL -#include "SDL.h" - - typedef SDL_Event Event; - typedef SDL_Keycode Key; - typedef SDL_MouseWheelEvent Wheel; - - enum EventType { - QUIT = SDL_QUIT, - KEY_DOWN = SDL_KEYDOWN, - KEY_UP = SDL_KEYUP, - MOUSE_MOTION = SDL_MOUSEMOTION, - MOUSE_BUTTON_DOWN = SDL_MOUSEBUTTONDOWN, - MOUSE_BUTTON_UP = SDL_MOUSEBUTTONUP, - MOUSE_WHEEL = SDL_MOUSEWHEEL, - WINDOW_EVENT = SDL_WINDOWEVENT, - }; - - enum WindowEvent { - WINDOW_SHOWN = SDL_WINDOWEVENT_SHOWN , - WINDOW_HIDDEN = SDL_WINDOWEVENT_HIDDEN , - WINDOW_EXPOSED = SDL_WINDOWEVENT_EXPOSED , - WINDOW_MOVED = SDL_WINDOWEVENT_MOVED , - WINDOW_RESIZED = SDL_WINDOWEVENT_RESIZED , - WINDOW_SIZE_CAHNGE = SDL_WINDOWEVENT_SIZE_CHANGED , - WINDOW_MINIMIZED = SDL_WINDOWEVENT_MINIMIZED , - WINDOW_MAXIMIZED = SDL_WINDOWEVENT_MAXIMIZED , - WINDOW_RESTORED = SDL_WINDOWEVENT_RESTORED , - WINDOW_ENTER = SDL_WINDOWEVENT_ENTER , - WINDOW_LEAVE = SDL_WINDOWEVENT_LEAVE , - WINDOW_FOCUS_GAINED = SDL_WINDOWEVENT_FOCUS_GAINED, - WINDOW_FOCUS_LOST = SDL_WINDOWEVENT_FOCUS_LOST , - WINDOW_CLOSE = SDL_WINDOWEVENT_CLOSE , - WINDOW_TAKE_FOCUS = SDL_WINDOWEVENT_TAKE_FOCUS , - WINDOW_HIT_TEST = SDL_WINDOWEVENT_HIT_TEST , - }; - - inline int pollEvent(Event* e) - { - return SDL_PollEvent(e); - } - - inline const char* getKeyName(Key key) - { - return SDL_GetKeyName(key); - } - - inline const char* getButtonName(int button) - { - switch (button) - { - case 1: return "left"; - case 2: return "middle"; - case 3: return "right"; - case 4: return "wheelup"; - case 5: return "wheeldown"; - default: return "?"; - } - } - -/* - inline const char* getWheelName(Wheel wheel) - { - if (wheel.x == -1) - return "left"; - else if (wheel.x == 1) - return "right"; - else if (wheel.y == -1) - return "near"; - else if (wheel.y == 1) - return "far"; - else - return "none"; - } -*/ - -#endif // JIN_INPUT_SDL -} // input -} // jin - -#endif // JIN_MODULES_INPUT -#endif
\ No newline at end of file diff --git a/src/libjin/input/input.h b/src/libjin/input/input.h deleted file mode 100644 index 217edd2..0000000 --- a/src/libjin/input/input.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __JIN_INPUT_H -#define __JIN_INPUT_H - -#include "event.h" -#include "keyboard.h" -#include "mouse.h" - -#endif
\ No newline at end of file diff --git a/src/libjin/input/joypad.cpp b/src/libjin/input/joypad.cpp deleted file mode 100644 index e69de29..0000000 --- a/src/libjin/input/joypad.cpp +++ /dev/null diff --git a/src/libjin/input/joypad.h b/src/libjin/input/joypad.h deleted file mode 100644 index e8d309b..0000000 --- a/src/libjin/input/joypad.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __JIN_JOYPAD_H -#define __JIN_JOYPAD_H - -namespace jin -{ -namespace input -{ - - - -} -} - -#endif
\ No newline at end of file diff --git a/src/libjin/input/keyboard.cpp b/src/libjin/input/keyboard.cpp deleted file mode 100644 index e69de29..0000000 --- a/src/libjin/input/keyboard.cpp +++ /dev/null diff --git a/src/libjin/input/keyboard.h b/src/libjin/input/keyboard.h deleted file mode 100644 index 3e78ab1..0000000 --- a/src/libjin/input/keyboard.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef __JIN_KEYBOARD_H -#define __JIN_KEYBOARD_H - -namespace jin -{ -namespace input -{ - class Keyboard - { - - }; -} -} - -#endif // __JIN_KEYBOARD_H
\ No newline at end of file diff --git a/src/libjin/input/mouse.cpp b/src/libjin/input/mouse.cpp deleted file mode 100644 index 98c4a39..0000000 --- a/src/libjin/input/mouse.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "../modules.h" -#ifdef JIN_MODULES_INPUT - -#include "SDL.h" -#include "Mouse.h" - -namespace jin -{ -namespace input -{ - - void Mouse::getState(int* x, int* y) - { -#ifdef JIN_INPUT_SDL - SDL_GetMouseState(x, y); -#endif // JIN_INPUT_SDL - } - -} // input -} // jin - -#endif // JIN_MODULES_INPUT
\ No newline at end of file diff --git a/src/libjin/input/mouse.h b/src/libjin/input/mouse.h deleted file mode 100644 index 5fc6b47..0000000 --- a/src/libjin/input/mouse.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __JIN_MOUSE_H -#define __JIN_MOUSE_H -#include "../modules.h" -#ifdef JIN_MODULES_INPUT - -#include "../Common/Singleton.hpp" - -namespace jin -{ -namespace input -{ - class Mouse : public Singleton<Mouse> - { - public: - - // - void getState(int* x, int* y); - - private: - Mouse() {}; - ~Mouse() {}; - - SINGLETON(Mouse); - }; -} -} - -#endif // JIN_MODULES_INPUT -#endif // __JIN_MOUSE_H
\ No newline at end of file |