#ifndef MSP_DEMOSCENE_DEMO_H_
#define MSP_DEMOSCENE_DEMO_H_
+#include <map>
+#include <string>
#include <sigc++/signal.h>
#include <msp/al/sounddecoder.h>
#include <msp/al/source.h>
Msp::Time::TimeStamp last_tick;
Msp::Time::TimeStamp next_frame;
+ std::map<std::string, Msp::Variant> things;
+
Demo(Msp::Graphics::Window &, Msp::Graphics::GLContext &, Msp::DataFile::Collection &);
public:
virtual ~Demo();
+ template<typename T>
+ T &get_thing(const std::string &);
+
void set_fixed_framerate(float);
const Msp::Time::TimeStamp &get_next_frame_time() const { return next_frame; }
void enable_music();
void seek(const Msp::Time::TimeDelta &);
};
+template<typename T>
+T &Demo::get_thing(const std::string &name)
+{
+ return *get_item(things, name).value<T *>();
+}
#endif