diff --git a/src/input/input_internal.h b/src/input/input_internal.h new file mode 100644 index 00000000..803a0168 --- /dev/null +++ b/src/input/input_internal.h @@ -0,0 +1,42 @@ +// +// Lol Engine +// +// Copyright: (c) 2010-2013 Benjamin Litzelmann +// This program is free software; you can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To +// Public License, Version 2, as published by Sam Hocevar. See +// http://www.wtfpl.net/ for more details. +// + +#if !defined __LOL_INPUT_DEVICE_INTERNAL_H__ +#define __LOL_INPUT_DEVICE_H__ + +#include "core.h" + +namespace lol +{ + +/** Internal class (not public) that allows to construct an InputDevice dynamically, when the keys, axis and cursors are not known at compile time */ +class InputDeviceInternal : InputDevice +{ +public: + InputDeviceInternal(const char* name) : InputDevice(name) { } + + void AddKey(const char* name); + void AddAxis(const char* name, float sensitivity = 1.0f); + void AddCursor(const char* name); + + void SetKey(int index, bool state) { m_keys[index] = state; } + void SetAxis(int index, float value) { m_axis[index].m1 = value; } + void SetCursor(int index, const vec2& position, const ivec2& pixel) { m_cursors[index].m1 = position; m_cursors[index].m2 = pixel; } + + static bool GetMouseCapture() { return m_capturemouse; } + + static InputDeviceInternal* CreateStandardKeyboard(); + static InputDeviceInternal* CreateStandardMouse(); +}; + +} /* namespace lol */ + +#endif // __LOL_INPUT_DEVICE_INTERNAL_H__ + diff --git a/src/lolcore.vcxproj.filters b/src/lolcore.vcxproj.filters index dc05fb99..e8cbe605 100644 --- a/src/lolcore.vcxproj.filters +++ b/src/lolcore.vcxproj.filters @@ -64,19 +64,19 @@ {01285b11-c6c7-4a9e-8dee-daa2c63901e4} - + {a11c55f8-8e10-4270-be24-38e8d4fcf589} - + {4089421f-2cc2-4036-a6b2-9df8a2f4efc8} - + {317cb5cc-5dcc-4e14-be90-40a125a2e2ec} - + {a914e15d-3201-467a-a9c9-d7c5244b13ee} - + {c6c6b597-ed6c-4d82-a166-964beeeeb525} @@ -94,10 +94,10 @@ debug - mesh\platform\sdl + platform\sdl - mesh\platform\sdl + platform\sdl math @@ -151,10 +151,10 @@ image\codec - mesh\platform\xbox + platform\xbox - mesh\platform\xbox + platform\xbox gpu @@ -163,7 +163,7 @@ input - mesh\platform\d3d9 + platform\d3d9 ... @@ -262,10 +262,10 @@ generated - mesh\platform\ps3 + platform\ps3 - mesh\platform\ps3 + platform\ps3 gpu @@ -321,10 +321,10 @@ debug - mesh\platform\sdl + platform\sdl - mesh\platform\sdl + platform\sdl lol\image @@ -360,16 +360,16 @@ image - mesh\platform\xbox + platform\xbox - mesh\platform\xbox + platform\xbox input - mesh\platform\d3d9 + platform\d3d9 ... @@ -486,13 +486,13 @@ gpu - mesh\platform\ps3 + platform\ps3 - mesh\platform\ps3 + platform\ps3 - mesh\platform\ps3 + platform\ps3 src\...