*******************************************************************************/
-#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>
+#include <boost/shared_ptr.hpp>
+
#include <Moof/Camera.hh>
#include <Moof/Dispatcher.hh>
-#include <Moof/Engine.hh>
#include <Moof/Interpolator.hh>
+#include <Moof/Layer.hh>
#include <Moof/Math.hh>
#include <Moof/Scene.hh>
#include <Moof/Sound.hh>
#include "Hud.hh"
-class YoinkApp : public Mf::Engine
+class GameLayer;
+typedef boost::shared_ptr<GameLayer> GameLayerP;
+
+class GameLayer : public Mf::Layer
{
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 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::Camera camera;
Mf::OctreeP octree;
- Hud hud;
+ HudP hud;
};
-#endif // _YOINKAPP_HH_
+#endif // _GAMELAYER_HH_
/** vim: set ts=4 sw=4 tw=80: *************************************************/