Refactoring, Exception handling and Events.

This commit is contained in:
Tim Schubert 2016-01-23 03:27:32 +01:00
parent b159f83c63
commit a3df4a3189
14 changed files with 1377 additions and 916 deletions

24
src/Events.cpp Normal file
View file

@ -0,0 +1,24 @@
#include "Events.hpp"
void Timer::start_timer()
{
this->timer_started = SDL_GetTicks();
}
Uint32 Timer::get_timer()
{
Uint32 ticks_passed = SDL_GetTicks() - this->timer_started;
return ticks_passed;
}
Uint32 Timer::reset_timer()
{
Uint32 ticks_passed = this->get_timer();
this->timer_started = SDL_GetTicks();
return ticks_passed;
}
Uint32 register_events(Uint32 n)
{
return SDL_RegisterEvents(n);
}