]> Dogcows Code - chaz/yoink/blobdiff - src/GameLayer.hh
new level-based controllers
[chaz/yoink] / src / GameLayer.hh
similarity index 82%
rename from src/YoinkApp.hh
rename to src/GameLayer.hh
index 950d31983002443dd83abe9c3c70d4a57321f1b8..b2df7ef11f3aa3433612fc17ed0fec8b86400152 100644 (file)
 
 *******************************************************************************/
 
 
 *******************************************************************************/
 
-#ifndef _YOINKAPP_HH_
-#define _YOINKAPP_HH_
+#ifndef _GAMELAYER_HH_
+#define _GAMELAYER_HH_
 
 /**
 
 /**
- * @file YoinkApp.hh
+ * @file GameLayer.hh
  * This is the big enchilada.
  */
 
 #include <iostream>
 #include <string>
 
  * This is the big enchilada.
  */
 
 #include <iostream>
 #include <string>
 
+#include <boost/shared_ptr.hpp>
+
 #include <Moof/Camera.hh>
 #include <Moof/Dispatcher.hh>
 #include <Moof/Camera.hh>
 #include <Moof/Dispatcher.hh>
-#include <Moof/Engine.hh>
 #include <Moof/Interpolator.hh>
 #include <Moof/Interpolator.hh>
+#include <Moof/Layer.hh>
 #include <Moof/Math.hh>
 #include <Moof/Scene.hh>
 #include <Moof/Sound.hh>
 #include <Moof/Math.hh>
 #include <Moof/Scene.hh>
 #include <Moof/Sound.hh>
 #include "Hud.hh"
 
 
 #include "Hud.hh"
 
 
-class YoinkApp : public Mf::Engine
+class GameLayer;
+typedef boost::shared_ptr<GameLayer> GameLayerP;
+
+class GameLayer : public Mf::Layer
 {
 public:
 {
 public:
-       YoinkApp(int argc, char* argv[]);
-       ~YoinkApp();
+       GameLayer();
 
 
-private:
+       static GameLayerP alloc()
+       {
+               return GameLayerP(new GameLayer);
+       }
+
+       void pushed(Mf::Engine& engine);
        void update(Mf::Scalar t, Mf::Scalar dt);
        void update(Mf::Scalar t, Mf::Scalar dt);
-       void draw(Mf::Scalar alpha);
-       void handleEvent(const Mf::Event& event);
+       void draw(Mf::Scalar alpha) const;
+       bool handleEvent(const Mf::Event& event);
 
 
-       /**
-        * Set OpenGL to a state we can know and depend on.
-        */
-       void setupGL();
-       void contextRecreated(const Mf::Notification* note);
+private:
 
        Mf::Sound music;
 
 
        Mf::Sound music;
 
@@ -77,11 +82,11 @@ private:
        Mf::Camera camera;
        Mf::OctreeP octree;
 
        Mf::Camera camera;
        Mf::OctreeP octree;
 
-       Hud hud;
+       HudP hud;
 };
 
 
 };
 
 
-#endif // _YOINKAPP_HH_
+#endif // _GAMELAYER_HH_
 
 /** vim: set ts=4 sw=4 tw=80: *************************************************/
 
 
 /** vim: set ts=4 sw=4 tw=80: *************************************************/
 
This page took 0.02178 seconds and 4 git commands to generate.