+ /// Called by Application when pushing this state.
+ void EnterState(Application &ctrl, SDL_Surface *screen);
+ /// Called by Application when popping this state.
+ void ExitState(Application &ctrl, SDL_Surface *screen);
+ /// Called by Application when this state becomes the top state.
+ void ResumeState(SDL_Surface *screen);
+ /// Called by Application when this state no longer is the top state.
+ void PauseState(SDL_Surface *screen);
+
+ /// Called by Application on SDL window resize events.
+ void Resize(int width, int height);
+
+ /// Handle interactive events such as input and timers.
+ virtual void HandleEvents(const Input &) = 0;
+ /// Update the time-dependant world representation.
+ virtual void UpdateWorld(float deltaT) = 0;
+ /// Draw a picture of the world.
+ virtual void Render(SDL_Surface *) = 0;
+
+protected:
+ /// Get a handle to the application this state is running on.
+ /// Do not call this while the state is off the stack (e.g. in c'tor/d'tor)
+ /// or you'll get a std::domain_error (potentially evil in d'tor)!
+ Application &Ctrl();
+ const Application &Ctrl() const;
+
+private: