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
|
|
@ -2,7 +2,6 @@
|
|||
#include <Platform/PlatformInput.h>
|
||||
#include <Spectre/Input/Keyboard.h>
|
||||
#include <Spectre/Input/Mouse.h>
|
||||
#include <Spectre/Input/InputEvent.h>
|
||||
#include <Spectre/Input/InputDevice.h>
|
||||
#include <Spectre/Input/InputModule.h>
|
||||
|
||||
|
|
@ -35,16 +34,6 @@ void InputModule::addInputDevice(InputDevice *device)
|
|||
m_devices.push_back(device);
|
||||
}
|
||||
|
||||
void InputModule::registerListener(InputListener* listener)
|
||||
{
|
||||
m_listeners.push_back(listener);
|
||||
}
|
||||
|
||||
void InputModule::removeListener(InputListener* listener)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Mouse* InputModule::getMouse()
|
||||
{
|
||||
return m_mouse;
|
||||
|
|
@ -55,13 +44,6 @@ Keyboard* InputModule::getKeyboard()
|
|||
return m_keyboard;
|
||||
}
|
||||
|
||||
void InputModule::postInputEvent(const InputEvent& event)
|
||||
{
|
||||
if (m_buffer.size() < 128) {
|
||||
m_buffer.push_back(event);
|
||||
}
|
||||
}
|
||||
|
||||
void InputModule::update()
|
||||
{
|
||||
InputDeviceVec::iterator it;
|
||||
|
|
@ -70,28 +52,6 @@ void InputModule::update()
|
|||
for(it = m_devices.begin(); it != m_devices.end(); it++) {
|
||||
(*it)->update(this);
|
||||
}
|
||||
|
||||
// Dispatch all events to listeners.
|
||||
dispatch();
|
||||
}
|
||||
|
||||
void InputModule::dispatch()
|
||||
{
|
||||
std::deque<InputEvent>::iterator it;
|
||||
|
||||
for(it = m_buffer.begin(); it != m_buffer.end(); it++) {
|
||||
|
||||
const InputEvent& event = *it;
|
||||
|
||||
// Call listeners.
|
||||
std::vector<InputListener*>::iterator it;
|
||||
for(it = m_listeners.begin(); it != m_listeners.end(); it++) {
|
||||
|
||||
(*it)->onInputEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
m_buffer.clear();
|
||||
}
|
||||
|
||||
} // namespace sp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue