]> git.tdb.fi Git - libs/gl.git/blobdiff - source/object.cpp
Rework Bind and enable it to restore the old binding
[libs/gl.git] / source / object.cpp
index 938e83f911211cd75b2e50302b6ad00d67345005..5ae04feb03027dd078a99335d651adce924bfa2c 100644 (file)
@@ -44,7 +44,7 @@ void Object::render(const Tag &tag) const
        if(!pass)
                return;
 
-       Bind bind(*pass);
+       Bind bind(pass);
        meshes[0]->draw();
 }
 
@@ -54,14 +54,14 @@ void Object::render(const ObjectInstance &inst, const Tag &tag) const
        if(!pass)
                return;
 
-       Bind bind(*pass);
+       Bind bind(pass);
        render_instance(inst, tag);
        meshes[0]->draw();
 }
 
 const RenderPass *Object::get_pass(const Tag &tag) const
 {
-       if(!technique->has_pass(tag))
+       if(!technique || !technique->has_pass(tag))
                return 0;
        return &technique->get_pass(tag);
 }