27 typedef void (State::* StateHandler)();
28 typedef void (Surface::* SurfaceHandler)();
38 static int maxFrameSkip;
39 static Uint32 gameSlowSpeed;
43 Uint32 _frameSkipStart;
48 SurfaceHandler _surface;
51 Timer(Uint32 interval,
bool frameSkipping =
false);
67 void onTimer(StateHandler handler);
69 void onTimer(SurfaceHandler handler);
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Timer used to run code in fixed intervals.
Definition: Timer.h:35
~Timer()
Cleans up the timer.
Definition: Timer.cpp:59
void setFrameSkipping(bool skip)
Turns frame skipping on or off.
Definition: Timer.cpp:171
void start()
Starts the timer.
Definition: Timer.cpp:66
void stop()
Stops the timer.
Definition: Timer.cpp:75
void think(State *state, Surface *surface)
Advances the timer.
Definition: Timer.cpp:109
void setInterval(Uint32 interval)
Sets the timer's interval.
Definition: Timer.cpp:144
Timer(Uint32 interval, bool frameSkipping=false)
Creates a stopped timer.
Definition: Timer.cpp:51
void onTimer(StateHandler handler)
Hooks a state action handler to the timer interval.
Definition: Timer.cpp:153
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
bool isRunning() const
Gets if the timer's running.
Definition: Timer.cpp:98
Definition: BaseInfoState.cpp:40
Uint32 getTime() const
Gets the current time interval.
Definition: Timer.cpp:85