]> git.tdb.fi Git - libs/gl.git/blobdiff - source/object.cpp
Remove various old deprecated things
[libs/gl.git] / source / object.cpp
index a27553a6236e029c27cfe547304b00e84371f5e5..25daf13ec5dd02fba0bdc17ed9fa6511ab360ebd 100644 (file)
@@ -17,6 +17,8 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
+Matrix Object::identity_matrix;
+
 Object::Object():
        lods(1),
        lod0_watched(false)
@@ -30,11 +32,13 @@ Object::Object(const Mesh *m, const Technique *t):
        set_technique(t);
 }
 
+// TODO should have copy-c'tor to set watch on lod0 mesh if necessary
+
 Object::~Object()
 {
        if(lods[0].mesh && lod0_watched)
                if(ResourceManager *rm = lods[0].mesh->get_manager())
-                       rm->unwatch_resource(*lods[0].mesh, *this);
+                       rm->unobserve_resource(*lods[0].mesh, *this);
 }
 
 Object::LevelOfDetail &Object::get_lod(unsigned i, const char *caller)
@@ -55,7 +59,7 @@ void Object::set_mesh(unsigned i, const Mesh *m)
        RefPtr<const Mesh> &ptr = get_lod(i, "Object::set_mesh").mesh;
        if(i==0 && ptr && lod0_watched)
                if(ResourceManager *rm = ptr->get_manager())
-                       rm->unwatch_resource(*ptr, *this);
+                       rm->unobserve_resource(*ptr, *this);
        ptr = m;
        ptr.keep();
        lod0_watched = false;
@@ -63,7 +67,7 @@ void Object::set_mesh(unsigned i, const Mesh *m)
        if(i==0 && m)
                if(ResourceManager *rm = m->get_manager())
                {
-                       rm->watch_resource(*m, *this);
+                       rm->observe_resource(*m, *this);
                        lod0_watched = true;
                }
 
@@ -130,21 +134,6 @@ const Technique *Object::get_technique(unsigned i) const
        return lods[i].technique.get();
 }
 
-void Object::render(const Tag &tag) const
-{
-       const RenderPass *pass = get_pass(tag, 0);
-       if(!pass)
-               return;
-
-       Bind bind_shader(pass->get_shader_program());
-       if(pass->get_shader_data())
-               pass->get_shader_data()->apply();
-       Bind bind_material(pass->get_material());
-       Bind bind_texturing(pass->get_texturing());
-
-       lods.front().mesh->draw();
-}
-
 void Object::render(Renderer &renderer, const Tag &tag) const
 {
        const RenderPass *pass = get_pass(tag, 0);