class State {
public:
+ State();
virtual ~State();
public:
/// 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:
/// Do some setup that needs an application and/or screen handle and thus
/// can not be done by the constructor.
Timers<float> &PhysicsTimers() { return physicsTimers; }
private:
+ Application *ctrl;
Timers<Uint32> graphicsTimers;
Timers<float> physicsTimers;