summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-core/input
diff options
context:
space:
mode:
Diffstat (limited to 'source/libs/asura-lib-core/input')
-rw-r--r--source/libs/asura-lib-core/input/cursor.h23
-rw-r--r--source/libs/asura-lib-core/input/event.h45
-rw-r--r--source/libs/asura-lib-core/input/input_device.hpp9
-rw-r--r--source/libs/asura-lib-core/input/joypad.h0
-rw-r--r--source/libs/asura-lib-core/input/mouse.defs7
5 files changed, 65 insertions, 19 deletions
diff --git a/source/libs/asura-lib-core/input/cursor.h b/source/libs/asura-lib-core/input/cursor.h
index da4a765..a8e53a6 100644
--- a/source/libs/asura-lib-core/input/cursor.h
+++ b/source/libs/asura-lib-core/input/cursor.h
@@ -4,16 +4,18 @@
#include <SDL2/SDL.h>
-#include "Scripting/Portable.h"
-#include "Graphics/ImageData.h"
-#include "InputDevice.hpp"
+#include <asura-lib-utils/scripting/portable.hpp>
+
+#include "../graphics/image_data.h"
+
+#include "input_device.hpp"
namespace AsuraEngine
{
namespace Input
{
- class Cursor : public Scripting::Portable
+ class Cursor ASURA_FINAL : public AEScripting::Portable<Cursor>
{
public:
@@ -29,6 +31,8 @@ namespace AsuraEngine
CursorType GetType() const;
SystemCursor GetSystemType() const;
+ LUAX_DECL_FACTORY(Cursor);
+
private:
SDL_Cursor* mCursorHandle;
@@ -36,17 +40,6 @@ namespace AsuraEngine
CursorType mType;
SystemCursor mSystemType;
- public:
-
- //----------------------------------------------------------------------------------------------------------
-
- LUAX_DECL_FACTORY(Cursor);
-
- LUAX_DECL_ENUM(EnumCursorType);
- LUAX_DECL_ENUM(EnumSystemCursor);
-
- //----------------------------------------------------------------------------------------------------------
-
};
}
diff --git a/source/libs/asura-lib-core/input/event.h b/source/libs/asura-lib-core/input/event.h
new file mode 100644
index 0000000..a24e806
--- /dev/null
+++ b/source/libs/asura-lib-core/input/event.h
@@ -0,0 +1,45 @@
+#ifndef __ASURA_ENGINE_EVENT_H__
+#define __ASURA_ENGINE_EVENT_H__
+
+namespace AsuraEngine
+{
+ namespace Input
+ {
+
+ enum EventType
+ {
+ EVENT_BEGIN_MOUSE__ ,
+ EVENT_LEFT_DOWN ,
+ EVENT_LEFT_UP ,
+ EVENT_LEFT_DCLICK ,
+ EVENT_MIDDLE_DOWN ,
+ EVENT_MIDDLE_UP ,
+ EVENT_MIDDLE_DCLICK ,
+ EVENT_RIGHT_DOWN ,
+ EVENT_RIGHT_UP ,
+ EVENT_RIGHT_DCLICK ,
+ EVENT_MOTION ,
+ EVENT_END_MOUSE__ ,
+ EVENT_ENTER_WINDOW ,
+ EVENT_LEAVE_WINDOW ,
+ EVENT_MOUSEWHEEL
+ };
+
+ struct Event
+ {
+ int type;
+ union
+ {
+ // 갴¼
+ struct {
+ int id;
+ } button;
+ };
+ };
+
+ }
+}
+
+namespace AEInput = AsuraEngine::Input;
+
+#endif \ No newline at end of file
diff --git a/source/libs/asura-lib-core/input/input_device.hpp b/source/libs/asura-lib-core/input/input_device.hpp
index eb0b7a3..46f5be8 100644
--- a/source/libs/asura-lib-core/input/input_device.hpp
+++ b/source/libs/asura-lib-core/input/input_device.hpp
@@ -1,9 +1,10 @@
#ifndef __ASURA_ENGINE_INPUT_BASE_H__
#define __ASURA_ENGINE_INPUT_BASE_H__
-#include "Scripting/Portable.h"
-#include "Config.h"
-#include "Singleton.hpp"
+#include <asura-lib-utils/scripting/portable.hpp>
+
+#include "../core_config.h"
+#include "../singleton.hpp"
namespace AsuraEngine
{
@@ -15,7 +16,7 @@ namespace AsuraEngine
///
template<class T>
ASURA_ABSTRACT class InputDevice
- : virtual public Scripting::Portable
+ : virtual public Scripting::Portable<T>
, virtual public Singleton<T>
{
public:
diff --git a/source/libs/asura-lib-core/input/joypad.h b/source/libs/asura-lib-core/input/joypad.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/source/libs/asura-lib-core/input/joypad.h
diff --git a/source/libs/asura-lib-core/input/mouse.defs b/source/libs/asura-lib-core/input/mouse.defs
new file mode 100644
index 0000000..de1d117
--- /dev/null
+++ b/source/libs/asura-lib-core/input/mouse.defs
@@ -0,0 +1,7 @@
+
+enum MouseButton
+{
+ MOUSE_BUTTON_LEFT,
+ MOUSE_BUTTON_MIDDLE,
+ MOUSE_BUTTON_RIGHT,
+};