- // Override these if you want.
- virtual void update(Scalar t, Scalar dt);
- virtual void draw(Scalar alpha);
- virtual void handleEvent(const Event& event);
+ void setTimestep(int ts);
+ int getTimestep() const;
+
+ void setMaxFps(int maxFps); // draw rate is always capped at the timestep
+ int getMaxFps() const;
+
+ int getFps() const;
+
+ void push(LayerP layer); // push a layer onto the top
+ LayerP pop(); // pop the top layer
+ LayerP pop(Layer* layer); // pops a specific layer and all layers above it
+ void clear(); // remove all layers (the engine will stop)
+
+ int getSize() const; // get the size of the stack
+
+ // set this machine in motion
+ void run();
+
+ Dispatch::Handler addHandler(const std::string& event,
+ const Dispatch::Function& callback);
+ Dispatch::Handler addHandler(const std::string& event,
+ const Dispatch::Function& callback, Dispatch::Handler handler);
+
+ void dispatch(const std::string& event,
+ const Dispatch::Message* message = 0);