I should have commit when I knew what changes I made.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#include "cGUIEventHandler.hpp"
|
||||
|
||||
using GUIEventEngine::cGUIEventHandler;
|
||||
|
||||
cGUIEventHandler::cGUIEventHandler()
|
||||
{
|
||||
}
|
||||
|
||||
cGUIEventHandler::~cGUIEventHandler()
|
||||
{
|
||||
for (unsigned int i = 0; i < m_events.size(); ++i) {
|
||||
delete m_events[i];
|
||||
m_events[i] = nullptr;
|
||||
}
|
||||
m_events.clear();
|
||||
}
|
||||
|
||||
/// Functions
|
||||
void cGUIEventHandler::CheckEvents()
|
||||
{
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
std::vector<GUIEventEngine::cGUIEvent*>::iterator it;
|
||||
|
||||
for (it = m_events.begin(); it < m_events.end(); it++) {
|
||||
(*it)->OnEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cGUIEventHandler::AddEvents(GUIEventEngine::cGUIEvent* event )
|
||||
{
|
||||
m_events.push_back(event);
|
||||
}
|
||||
|
||||
/// Sets
|
||||
|
||||
/// Gets
|
||||
std::vector<GUIEventEngine::cGUIEvent*>& cGUIEventHandler::getEvents()
|
||||
{
|
||||
return m_events;
|
||||
}
|
||||
Reference in New Issue
Block a user