X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FGameLayer.hh;fp=src%2FYoinkApp.hh;h=b2df7ef11f3aa3433612fc17ed0fec8b86400152;hp=950d31983002443dd83abe9c3c70d4a57321f1b8;hb=892da43bf5796e7c5f593a6d0f53bd797a36bd3e;hpb=ca0f7bdfba63140dca0bd20586d31980f3938eb2;ds=sidebyside diff --git a/src/YoinkApp.hh b/src/GameLayer.hh similarity index 82% rename from src/YoinkApp.hh rename to src/GameLayer.hh index 950d319..b2df7ef 100644 --- a/src/YoinkApp.hh +++ b/src/GameLayer.hh @@ -26,21 +26,23 @@ *******************************************************************************/ -#ifndef _YOINKAPP_HH_ -#define _YOINKAPP_HH_ +#ifndef _GAMELAYER_HH_ +#define _GAMELAYER_HH_ /** - * @file YoinkApp.hh + * @file GameLayer.hh * This is the big enchilada. */ #include #include +#include + #include #include -#include #include +#include #include #include #include @@ -49,22 +51,25 @@ #include "Hud.hh" -class YoinkApp : public Mf::Engine +class GameLayer; +typedef boost::shared_ptr 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; @@ -77,11 +82,11 @@ private: Mf::Camera camera; Mf::OctreeP octree; - Hud hud; + HudP hud; }; -#endif // _YOINKAPP_HH_ +#endif // _GAMELAYER_HH_ /** vim: set ts=4 sw=4 tw=80: *************************************************/