]> git.tdb.fi Git - libs/gl.git/commitdiff
Make the viewer capable of viewing scenes
authorMikko Rasa <tdb@tdb.fi>
Sun, 17 Aug 2014 14:44:10 +0000 (17:44 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 17 Aug 2014 14:44:10 +0000 (17:44 +0300)
tools/viewer.cpp

index 3e12321f014857d0763dd0a7c496b3479de76712..d2a384f4e0b2afc112afd7fe3ea62ac3da676237 100644 (file)
@@ -18,6 +18,7 @@
 #include <msp/gl/object.h>
 #include <msp/gl/renderer.h>
 #include <msp/gl/resources.h>
+#include <msp/gl/simplescene.h>
 #include <msp/gl/technique.h>
 #include <msp/gl/tests.h>
 #include <msp/input/mouse.h>
@@ -144,9 +145,12 @@ Viewer::Viewer(int argc, char **argv):
                resources.add("__.object", object);
        }
        else if(ext==".object")
+               renderable = load<GL::Object>(renderable_name);
+       else if(ext==".scene")
        {
-               object = load<GL::Object>(renderable_name);
-               renderable = object;
+               GL::SimpleScene *scene = new GL::SimpleScene;
+               DataFile::load(*scene, renderable_name, resources);
+               renderable = scene;
        }
        else
                throw usage_error("Unknown renderable type");