]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Engine.hh
big batch of changes
[chaz/yoink] / src / Moof / Engine.hh
index aa751356f6a81b6ec1712cf1ee7bdf322384d749..84b1f588f57e41c55d5a185bec8e0d40abcca198 100644 (file)
 #ifndef _MOOF_ENGINE_HH_
 #define _MOOF_ENGINE_HH_
 
-#include <stdexcept>
-
 #include <boost/shared_ptr.hpp>
 
-#include <Moof/Dispatcher.hh>
-#include <Moof/Event.hh>
+#include <Moof/Layer.hh>
 #include <Moof/Math.hh>
 
 
 namespace Mf {
 
 
-// forward declaration
+// forward declarations
 class Video;
 
 class Engine
 {
-protected:
-
-       Engine(int argc, char* argv[], const std::string& configFile,
-                       const std::string& name, const std::string& iconFile);
-
 public:
 
-       virtual ~Engine();
+       Engine(int argc, char* argv[], const std::string& name, 
+                       const std::string& iconFile, const std::string& configFile);
+       ~Engine() {}
 
-       int run();
-       void stop(int exitCode = 0);
+       // get global instance
+       static Engine& getInstance();
+
+       void run();
 
        void setTimestep(Scalar ts);
-       Scalar getTimestep();
+       Scalar getTimestep() const;
        void setMaxFrameRate(long maxFps);
-       long getMaxFrameRate();
-
-       Video& getVideo();
-       long getFrameRate();
+       long getMaxFrameRate() const;
 
-       // override these if you want
-       virtual void update(Scalar t, Scalar dt);
-       virtual void draw(Scalar alpha);
-       virtual void handleEvent(const Event& event);
+       Video& getVideo() const;
+       long getFrameRate() const;
 
-       struct Exception : std::runtime_error
-       {
-               explicit Exception(const std::string& what_arg) :
-                       std::runtime_error(what_arg) {}
-       };
+       void push(LayerP layer);
+       LayerP pop();
+       // pops a specific layer and all layers above it
+       LayerP pop(Layer* layer);
+       void clear();
 
 private:
-       Engine() {} // this class must be subclassed to be useful
 
        class Impl;
-       boost::shared_ptr<Impl> impl_;
+       boost::shared_ptr<Impl> mImpl;
 };
 
 
This page took 0.018603 seconds and 4 git commands to generate.