4 * Created on: Apr 8, 2012
8 #ifndef APP_APPLICATIONSTATE_H_
9 #define APP_APPLICATIONSTATE_H_
25 /// called when the state first enters the stack
26 /// @param ctrl the Application running the state
27 virtual void EnterState(Application &ctrl, SDL_Surface *screen) = 0;
29 /// called when the state is popped from the stack
30 virtual void ExitState(Application &ctrl, SDL_Surface *screen) = 0;
31 /// called when the state becomes the active one
32 virtual void ResumeState(Application &ctrl, SDL_Surface *screen) = 0;
33 /// called when the state becomes inactive
34 virtual void PauseState(Application &ctrl, SDL_Surface *screen) = 0;
36 /// adapt the state's graphics to given dimensions
37 virtual void Resize(int width, int height) = 0;
39 virtual void HandleEvents(const Input &) = 0;
40 virtual void UpdateWorld(float deltaT) = 0;
41 virtual void Render(SDL_Surface *) = 0;
44 Timers<Uint32> &GraphicsTimers() { return graphicsTimers; }
45 Timers<float> &PhysicsTimers() { return physicsTimers; }
48 Timers<Uint32> graphicsTimers;
49 Timers<float> physicsTimers;
55 #endif /* APP_STATE_H_ */