Input: remove InputEvent and InputListener and related code. Those are handled in System/Event
This commit is contained in:
parent
3c209ba01b
commit
cdaed77bf7
8 changed files with 0 additions and 161 deletions
|
|
@ -3,7 +3,6 @@
|
|||
#define SPECTRE_GAME_H
|
||||
|
||||
#include <Spectre/Graphics.h>
|
||||
#include <Spectre/Input/InputEvent.h>
|
||||
#include <Spectre/Game/FPSCounter.h>
|
||||
|
||||
class InputModule;
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
|
||||
#ifndef SPECTRE_INPUT_EVENT_H
|
||||
#define SPECTRE_INPUT_EVENT_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <Spectre/Input/Mouse.h>
|
||||
#include <Spectre/Input/Keyboard.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
typedef struct InputEvent
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
None,
|
||||
Key,
|
||||
MouseButton,
|
||||
MousePosition
|
||||
};
|
||||
|
||||
struct KeyEvent {
|
||||
Keyboard::Key code;
|
||||
bool pressed; /* true if pressed, false if released. */
|
||||
|
||||
std::string getKeyName() const; /* Get the key name */
|
||||
};
|
||||
|
||||
struct MouseButtonEvent {
|
||||
Mouse::Button button;
|
||||
bool pressed; /* true if pressed, false if released. */
|
||||
|
||||
std::string getName() const;
|
||||
};
|
||||
|
||||
struct MouseEvent {
|
||||
unsigned int x;
|
||||
unsigned int y;
|
||||
};
|
||||
|
||||
Type type;
|
||||
union {
|
||||
struct KeyEvent key;
|
||||
struct MouseEvent mouse;
|
||||
struct MouseButtonEvent mouseButton;
|
||||
};
|
||||
|
||||
InputEvent(Type type = None);
|
||||
|
||||
} InputEvent;
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INPUT_EVENT_H */
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
#ifndef SPECTRE_INPUT_LISTENER_H
|
||||
#define SPECTRE_INPUT_LISTENER_H
|
||||
|
||||
#include "InputEvent.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class InputListener
|
||||
{
|
||||
public :
|
||||
virtual void onInputEvent(const InputEvent& event);
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
||||
#endif /* SPECTRE_INPUT_LISTENER_H */
|
||||
|
|
@ -5,9 +5,6 @@
|
|||
#include <deque>
|
||||
#include <vector>
|
||||
|
||||
#include "InputListener.h"
|
||||
#include "InputEvent.h"
|
||||
|
||||
namespace sp {
|
||||
|
||||
class Mouse;
|
||||
|
|
@ -28,12 +25,6 @@ public :
|
|||
|
||||
void addInputDevice(InputDevice *device);
|
||||
|
||||
void registerListener(InputListener* listener);
|
||||
|
||||
void removeListener(InputListener* listener);
|
||||
|
||||
void postInputEvent(const InputEvent& event);
|
||||
|
||||
// NOTE: Update devices here! (for winapi, process keyboard/mouse messages)
|
||||
void update();
|
||||
|
||||
|
|
@ -48,11 +39,6 @@ protected :
|
|||
|
||||
Keyboard *m_keyboard;
|
||||
|
||||
// Buffered input queue.
|
||||
std::deque<InputEvent> m_buffer;
|
||||
|
||||
std::vector<InputListener*> m_listeners;
|
||||
|
||||
PlatformInput *m_platform;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue