diff options
Diffstat (limited to 'source/modules/asura-core/Input/InputDevice.h')
-rw-r--r-- | source/modules/asura-core/Input/InputDevice.h | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/source/modules/asura-core/Input/InputDevice.h b/source/modules/asura-core/Input/InputDevice.h index 0ecce99..2b3ff9b 100644 --- a/source/modules/asura-core/Input/InputDevice.h +++ b/source/modules/asura-core/Input/InputDevice.h @@ -1,9 +1,11 @@ #ifndef _ASURA_ENGINE_INPUT_BASE_H_ #define _ASURA_ENGINE_INPUT_BASE_H_ -#include <asura-utils/Math/Vector2.hpp> -#include <asura-utils/Scripting/Portable.hpp> -#include <asura-utils/Singleton.hpp> +#include <asura-base/Math/Vector2.hpp> +#include <asura-base/Scripting/Scripting.h> +#include <asura-base/Singleton.hpp> + +#include <windows.h> #include "../CoreConfig.h" @@ -14,28 +16,63 @@ namespace_begin(AsuraEngine) namespace_begin(Input) -class InputDevice +class InputDevice ASURA_FINAL { public: InputDevice(); - virtual ~InputDevice(); + ~InputDevice(); + +#if ASURA_EDITOR + + bool Open(HWND window); + void Close(); + + bool ToggleFullscreen(bool fullscreen, HWND window); + + bool Process(bool discard); + LRESULT OnKey(HWND window, UINT message, WPARAM wParam, LPARAM lParam); + LRESULT OnInput(HWND window, UINT message, WPARAM wParam, LPARAM lParam); + LRESULT OnDeviceChange(LPCWSTR name, bool add); + + static bool ConvertPositionToClientAreaCoord(HWND activeWindow, POINT position, AEMath::Vector2f& newPos); + +#elif ASURA_RUNNER + + bool Open(); + void Close(); + +#endif + + bool Activate(bool active); + + bool GetJoystickNames(std::vector<std::string> &names); protected: - virtual bool UpdateState(); + bool UpdateState(); MouseState m_Mouse; KeyboardState m_Keyboard; JoystickState m_Joysticks; -private: +private: bool UpdateMousePosition(); }; -//bool ConvertPositionToClientAreaCoord(); +extern InputDevice g_InputDevice; + +#if ASURA_EDITOR + +bool ConvertPositionToClientAreaCoord(); + +#elif ASURA_RUNNER + +bool ConvertPositionToClientAreaCoord(); + +#endif namespace_end namespace_end |