X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEngine.hh;h=28d7fa03eab8119d16a58ca5f2c81ad40da69ad5;hp=c5e99864f103e49dedffee2721609f48e136fe84;hb=4f62ce947db282f0bbf4d49b3aafb83d7cf51adc;hpb=e495074443d9fd7bc16137084cf9de3d031b75c4 diff --git a/src/Moof/Engine.hh b/src/Moof/Engine.hh index c5e9986..28d7fa0 100644 --- a/src/Moof/Engine.hh +++ b/src/Moof/Engine.hh @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -39,10 +40,13 @@ namespace Mf { +class Settings; + + /** * The engine is essentially a stack of layers. While running, it updates each * layer from the bottom up every timestep. It also draws each layer from the - * bottom up, adhering to the maximum frame-rate. Events are send to each layer + * bottom up, adhering to the maximum frame-rate. Events are sent to each layer * from the top down until a layer signals the event was handled. The engine is * also responsible for firing timers on time. The engine will continue running * as long as there are layers on the stack. @@ -52,22 +56,20 @@ class Engine { public: + Engine(); ~Engine() {} + + // loads settings: rngseed, timestep, framerate, showfps + bool initWithSettings(const Settings& settings); - // get global instance - static Engine& getInstance(); + const Error& getError() const; + void clearError(); // setting the video is required before you can run the engine and should // probably be done before adding any layers void setVideo(VideoP video); VideoP getVideo() const; - 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 @@ -90,13 +92,14 @@ public: private: - Engine(); // use getInstance() to access the engine - class Impl; boost::shared_ptr mImpl; }; +extern Engine engine; + + } // namespace Mf #endif // _MOOF_ENGINE_HH_