]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/demo.cpp
Add a helper function for registering a stage with the demo
[libs/demoscene.git] / source / demo.cpp
index 08a92b4f0d6bd925709de855a30cec20201adcf2..4cd66bd2a036d803988c18d6f195adb3bd376b60 100644 (file)
@@ -1,5 +1,6 @@
 #include <msp/time/utils.h>
 #include "demo.h"
+#include "stage.h"
 
 using namespace std;
 using namespace Msp;
@@ -27,6 +28,12 @@ Demo::~Demo()
        delete music_source;
 }
 
+void Demo::add_stage(const std::string &name, Stage &stage)
+{
+       things[name] = &stage;
+       things[name+".camera"] = static_cast<GL::Placeable *>(&stage.get_camera());
+}
+
 void Demo::set_fixed_framerate(float fps)
 {
        frame_interval = Time::sec/fps;