I should have commit when I knew what changes I made.

This commit is contained in:
2019-08-21 20:12:59 -04:00
parent 05ffe20bb4
commit 1e1a33f3f9
23 changed files with 820 additions and 175 deletions
@@ -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;
}