X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FMoof%2FCore.hh;fp=src%2FMoof%2FCore.hh;h=0000000000000000000000000000000000000000;hb=e0c0a3b5e7337cde55e520801d2e59e03dc97d9c;hp=eaa98b4a474d8f8dad318d9614f13770bba5bbc8;hpb=ed5fcf5f1357fc42749408f705e9ec55531ff006;p=chaz%2Fyoink diff --git a/src/Moof/Core.hh b/src/Moof/Core.hh deleted file mode 100644 index eaa98b4..0000000 --- a/src/Moof/Core.hh +++ /dev/null @@ -1,98 +0,0 @@ - -/*] Copyright (c) 2009-2010, Charles McGarvey [************************** -**] All rights reserved. -* -* vi:ts=4 sw=4 tw=75 -* -* Distributable under the terms and conditions of the 2-clause BSD license; -* see the file COPYING for a complete text of the license. -* -**************************************************************************/ - -#ifndef _MOOF_CORE_HH_ -#define _MOOF_CORE_HH_ - -#include - -#include - -#include -#include -#include - - -namespace Mf { - - -/** - * The core 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 sent - * to each layer from the top down until a layer signals the event was - * handled. The core is also responsible for firing timers on time. The - * core will continue running as long as there are layers on the stack. - */ - -class Core -{ -public: - - Core(); - - // loads settings: rngseed, timestep, framerate, showfps - void init(); - - 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 layers above it - void clear(); // remove all layers (the core 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); - -private: - - class Impl; - boost::shared_ptr mImpl; -}; - -extern Core core; - - -/* - * Some classes and subsystems require certain backend libraries to be - * initialized. This is the mechanism to accomplish that. Classes which - * rely on any backend libraries just need to instantiate this class as a - * member. Backend cleanup will occur automagically when there are no more - * instances. - */ - -class Backend -{ -public: - - Backend(); - ~Backend(); - - static bool isInitialized(); - static const Error& getError(); -}; - - -} // namespace Mf - -#endif // _MOOF_CORE_HH_ -