+ mesh = &resources.get<GL::Mesh>(renderable_name);
+
+ object = new GL::Object;
+ GL::Technique *tech = new GL::Technique;
+ tech->add_pass(0);
+ object->set_mesh(mesh);
+ object->set_technique(tech);
+ renderable = object;
+
+ resources.add("__.tech", tech);
+ resources.add("__.object", object);
+ }
+ else if(ext==".object")
+ renderable = load<GL::Object>(renderable_name);
+ else if(ext==".scene")
+ {
+ GL::SimpleScene *scene = new GL::SimpleScene;
+ DataFile::load(*scene, renderable_name, resources);
+ renderable = scene;
+ }
+ else
+ throw usage_error("Unknown renderable type");
+
+ if(!animation_name.empty())
+ {
+ if(!object)
+ throw usage_error("Must have an object to animate");
+
+ GL::Animation *anim = load<GL::Animation>(animation_name);
+ anim_player = new GL::AnimationPlayer;
+ anim_object = new GL::AnimatedObject(*object);
+ anim_player->play(*anim_object, *anim);
+ renderable = anim_object;