From 066e5987c515dfc34537d73ca9d2a81ddd1f9e1b Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 21 Oct 2018 13:37:27 +0800 Subject: =?UTF-8?q?*=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Input/je_event.h | 18 +++++++++++++++++- src/libjin/Input/je_joypad.h | 8 +++++++- src/libjin/Input/je_keyboard.h | 3 +++ src/libjin/Input/je_mouse.h | 18 ++++++++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) (limited to 'src/libjin/Input') diff --git a/src/libjin/Input/je_event.h b/src/libjin/Input/je_event.h index ca5dab7..2e87dc9 100644 --- a/src/libjin/Input/je_event.h +++ b/src/libjin/Input/je_event.h @@ -14,6 +14,9 @@ namespace JinEngine typedef SDL_Keycode Key; typedef SDL_MouseWheelEvent Wheel; + /// + /// + /// enum EventType { QUIT = SDL_QUIT, /* keyboard events */ @@ -39,6 +42,9 @@ namespace JinEngine WINDOW_EVENT = SDL_WINDOWEVENT, }; + /// + /// + /// enum WindowEvent { WINDOW_SHOWN = SDL_WINDOWEVENT_SHOWN , WINDOW_HIDDEN = SDL_WINDOWEVENT_HIDDEN , @@ -58,16 +64,25 @@ namespace JinEngine 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) @@ -102,4 +117,5 @@ namespace JinEngine } // namespace JinEngine #endif // LIBJIN_MODULES_INPUT -#endif \ No newline at end of file + +#endif // __JE_EVENT_H \ No newline at end of file diff --git a/src/libjin/Input/je_joypad.h b/src/libjin/Input/je_joypad.h index 49cd2d8..74173af 100644 --- a/src/libjin/Input/je_joypad.h +++ b/src/libjin/Input/je_joypad.h @@ -8,6 +8,9 @@ namespace JinEngine namespace Input { + /// + /// + /// inline const char* getJoyButtonName(int button) { switch (button) @@ -31,6 +34,9 @@ namespace JinEngine } } + /// + /// + /// inline const char* getJoyAxisName(int axis) { switch (axis) @@ -47,4 +53,4 @@ namespace JinEngine } // namespace Input } // namespace JinEngine -#endif \ No newline at end of file +#endif // __JE_JOYPAD_H \ No newline at end of file diff --git a/src/libjin/Input/je_keyboard.h b/src/libjin/Input/je_keyboard.h index 85b6267..61da361 100644 --- a/src/libjin/Input/je_keyboard.h +++ b/src/libjin/Input/je_keyboard.h @@ -6,6 +6,9 @@ namespace JinEngine namespace Input { + /// + /// + /// class Keyboard { diff --git a/src/libjin/Input/je_mouse.h b/src/libjin/Input/je_mouse.h index 6f01993..bd25e9c 100644 --- a/src/libjin/Input/je_mouse.h +++ b/src/libjin/Input/je_mouse.h @@ -10,16 +10,33 @@ namespace JinEngine namespace Input { + /// + /// + /// class Mouse : public Singleton { public: + /// + /// + /// void getState(int* x, int* y); + + /// + /// + /// void setVisible(bool visible); private: singleton(Mouse); + /// + /// + /// Mouse() {}; + + /// + /// + /// ~Mouse() {}; }; @@ -28,4 +45,5 @@ namespace JinEngine } // namespace JinEngine #endif // LIBJIN_MODULES_INPUT + #endif // __JE_MOUSE_H \ No newline at end of file -- cgit v1.1-26-g67d0