X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdemo.h;h=b4adb371f1c1d65ce2a152a0121cd07d08b4d901;hb=HEAD;hp=77eb671601fc52f79386b341acf06777d7e1c07a;hpb=2a957e891f86cc692ddbb80f71b1478ea03d5a4f;p=libs%2Fdemoscene.git diff --git a/source/demo.h b/source/demo.h index 77eb671..b4adb37 100644 --- a/source/demo.h +++ b/source/demo.h @@ -8,18 +8,43 @@ #include #include #include +#include #include +#include "action.h" #include "sequencer.h" +namespace Msp { +namespace DemoScene { + +class Stage; + class Demo { +private: + class AnimationAction: public Action + { + private: + Msp::GL::AnimationPlayer &player; + + public: + AnimationAction(Msp::GL::AnimationPlayer &); + + virtual void validate() const { } + + virtual void tick(float, float); + }; + public: + typedef std::map ThingMap; + sigc::signal signal_finished; protected: Sequencer sequencer; Msp::DataFile::Collection &resources; Msp::GL::WindowView view; + Msp::GL::AnimationPlayer anim_player; + AnimationAction anim_action; Msp::AL::Source *music_source; Msp::AL::Streamer *streamer; Msp::IO::Seekable *music_io; @@ -28,12 +53,18 @@ protected: Msp::Time::TimeStamp last_tick; Msp::Time::TimeStamp next_frame; - std::map things; + ThingMap things; Demo(Msp::Graphics::Window &, Msp::Graphics::GLContext &, Msp::DataFile::Collection &); public: virtual ~Demo(); + Msp::DataFile::Collection &get_resources() const { return resources; } + Msp::GL::AnimationPlayer &get_animation_player() { return anim_player; } + +protected: + void add_stage(const std::string &, Stage &); +public: template T &get_thing(const std::string &); @@ -51,4 +82,7 @@ T &Demo::get_thing(const std::string &name) return *get_item(things, name).value(); } +} // namespace DemoScene +} // namespace Msp + #endif