X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEngine.hh;h=84b1f588f57e41c55d5a185bec8e0d40abcca198;hp=112b87ea8dba3ea07f8d1cbefe5407003e045b4e;hb=8a1acac01b444dccf8b57cedf08392ada2e473c1;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4 diff --git a/src/Moof/Engine.hh b/src/Moof/Engine.hh index 112b87e..84b1f58 100644 --- a/src/Moof/Engine.hh +++ b/src/Moof/Engine.hh @@ -31,44 +31,47 @@ #include -#include -#include +#include #include -#include namespace Mf { -// forward declaration +// forward declarations class Video; -class Engine : public Singleton +class Engine { public: - Engine(const std::string& name, int argc, char* argv[], - const std::string& configFile); - virtual ~Engine(); - int run(); - void stop(); + Engine(int argc, char* argv[], const std::string& name, + const std::string& iconFile, const std::string& configFile); + ~Engine() {} + + // get global instance + static Engine& getInstance(); + + 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 push(LayerP layer); + LayerP pop(); + // pops a specific layer and all layers above it + LayerP pop(Layer* layer); + void clear(); private: - class EngineImpl; - boost::shared_ptr impl_; + + class Impl; + boost::shared_ptr mImpl; };