Refactoring, Exception handling and Events.
This commit is contained in:
parent
b159f83c63
commit
a3df4a3189
14 changed files with 1377 additions and 916 deletions
24
src/Events.cpp
Normal file
24
src/Events.cpp
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue