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