Argentum Online - Cliente
sdl_timer.h
1 #ifndef __TIMER_H
2 #define __TIMER_H
3 #include <cstdint>
4 
9 class SDLTimer {
10  private:
11  uint32_t start_ticks;
12  uint32_t pause_ticks;
13  bool _is_paused;
14  bool _is_started;
15 
16 
17  public:
22  SDLTimer();
23  ~SDLTimer();
24 
30  SDLTimer(const SDLTimer &other);
31  SDLTimer &operator=(const SDLTimer &other);
32 
33  /* Constructor por movimiento. */
34  SDLTimer(SDLTimer &&other);
35  SDLTimer &operator=(SDLTimer &&other);
36 
41  void start();
42 
47  void stop();
48 
53  void pause();
54 
59  void unpause();
60 
66  uint32_t get_ticks() const;
67 
74  bool is_started() const;
75 
82  bool is_paused() const;
83 };
84 
85 #endif
SDLTimer::SDLTimer
SDLTimer()
Crea un objeto SDLTimer.
Definition: sdl_timer.cpp:5
SDLTimer::get_ticks
uint32_t get_ticks() const
Devuelve el tiempo transcurrido desde que se inicio el timer.
Definition: sdl_timer.cpp:70
SDLTimer::pause
void pause()
Pausa la cuenta del timer.
Definition: sdl_timer.cpp:54
SDLTimer
Timer basado en la cuenta de SDL.
Definition: sdl_timer.h:9
SDLTimer::start
void start()
Inicia la cuenta del timer.
Definition: sdl_timer.cpp:39
SDLTimer::is_paused
bool is_paused() const
Indica si el timer esta pausado.
Definition: sdl_timer.cpp:80
SDLTimer::unpause
void unpause()
Despausa la cuenta del timer.
Definition: sdl_timer.cpp:62
SDLTimer::is_started
bool is_started() const
Indica si el timer esta iniciado.
Definition: sdl_timer.cpp:78
SDLTimer::stop
void stop()
Detiene la cuenta del timer.
Definition: sdl_timer.cpp:47