Move everything from global namespace to "sp" namespace
When writing the X11 (linux) implementation there was a problem with X11 defining a "Display" type and we also have a Display class in the engine. So to fix that problem and minimize the risk for running into other name conflicts. We move everything from global namespace.
This commit is contained in:
parent
9da8addeb2
commit
e10daeaaa6
120 changed files with 551 additions and 105 deletions
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "InputModule.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class InputDevice
|
||||
{
|
||||
friend class InputModule;
|
||||
|
|
@ -18,4 +20,6 @@ protected :
|
|||
virtual void update(InputModule *input) = 0;
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INTPUT_DEVICE_H */
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace sp {
|
||||
|
||||
namespace MouseButton {
|
||||
|
||||
enum Type {
|
||||
|
|
@ -120,7 +122,7 @@ typedef struct InputEvent
|
|||
MousePosition
|
||||
};
|
||||
|
||||
struct KeyEvent {
|
||||
struct KeyEvent {
|
||||
Key::Type code;
|
||||
bool pressed; /* true if pressed, false if released. */
|
||||
|
||||
|
|
@ -150,4 +152,6 @@ typedef struct InputEvent
|
|||
|
||||
} InputEvent;
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INPUT_EVENT_H */
|
||||
|
|
|
|||
|
|
@ -4,10 +4,14 @@
|
|||
|
||||
#include "InputEvent.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class InputListener
|
||||
{
|
||||
public :
|
||||
virtual void onInputEvent(const InputEvent& event);
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INPUT_LISTENER_H */
|
||||
|
|
@ -8,6 +8,8 @@
|
|||
#include "InputListener.h"
|
||||
#include "InputEvent.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class Mouse;
|
||||
class Keyboard;
|
||||
class InputDevice;
|
||||
|
|
@ -38,7 +40,7 @@ public :
|
|||
protected :
|
||||
|
||||
void dispatch();
|
||||
|
||||
|
||||
typedef std::vector<InputDevice*> InputDeviceVec;
|
||||
InputDeviceVec m_devices;
|
||||
|
||||
|
|
@ -54,4 +56,6 @@ protected :
|
|||
PlatformInput *m_platform;
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INPUT_MODULE_H */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
#include "InputEvent.h"
|
||||
#include "InputDevice.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class Keyboard : public InputDevice
|
||||
{
|
||||
public :
|
||||
|
|
@ -16,4 +18,6 @@ public :
|
|||
static std::string getKeyName(Key::Type key);
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INPUT_KEYBOARD_H */
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
#include "InputEvent.h"
|
||||
#include "InputDevice.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class Mouse : public InputDevice
|
||||
{
|
||||
public :
|
||||
|
|
@ -22,4 +24,6 @@ public :
|
|||
static std::string getButtonName(MouseButton::Type button);
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INPUT_MOUSE_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue