]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Engine.hh
new level-based controllers
[chaz/yoink] / src / Moof / Engine.hh
index 0617b1a5c3094025331233fe4c8ced0a5742010e..a0c23002080ff5ef65fa1a336cedd1294e101a35 100644 (file)
 #ifndef _MOOF_ENGINE_HH_
 #define _MOOF_ENGINE_HH_
 
-#include <stdexcept>
-
 #include <boost/shared_ptr.hpp>
 
-#include <Moof/Event.hh>
 #include <Moof/Exception.hh>
+#include <Moof/Layer.hh>
 #include <Moof/Math.hh>
 
 
 namespace Mf {
 
 
-// forward declaration
+// forward declarations
 class Video;
 
-class Engine
+struct Engine
 {
-protected:
-
-       Engine(int argc, char* argv[], const std::string& configFile,
-                       const std::string& name, const std::string& iconFile);
+       Engine(int argc, char* argv[], const std::string& name, 
+                       const std::string& iconFile, const std::string& configFile);
+       ~Engine() {}
 
-public:
+       // get global instance
+       static Engine& getInstance();
 
-       virtual ~Engine();
-
-       int run();
-       void stop(int exitCode = 0);
+       void run();
 
        void setTimestep(Scalar ts);
-       Scalar getTimestep();
+       Scalar getTimestep() const;
        void setMaxFrameRate(long maxFps);
-       long getMaxFrameRate();
+       long getMaxFrameRate() const;
 
-       Video& getVideo();
-       long getFrameRate();
+       Video& getVideo() const;
+       long getFrameRate() const;
 
-       // override these if you want
-       virtual void update(Scalar t, Scalar dt);
-       virtual void draw(Scalar alpha);
-       virtual void handleEvent(const Event& event);
+       void pushLayer(LayerP layer);
+       void popLayer();
+       void popLayer(Layer* layer);
+       void clearLayers();
 
        struct Exception : public Mf::Exception
        {
@@ -83,8 +78,6 @@ public:
        };
 
 private:
-       Engine() {} // this class must be subclassed to be useful
-
        class Impl;
        boost::shared_ptr<Impl> impl_;
 };
This page took 0.028222 seconds and 4 git commands to generate.