From: Mikko Rasa Date: Sun, 26 Aug 2012 21:38:08 +0000 (+0300) Subject: Pass the Renderer to ObjectInstance::get_level_of_detail X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e45ade69a77f7ba91b47bebad604ae29b5705b21;p=libs%2Fgl.git Pass the Renderer to ObjectInstance::get_level_of_detail As I recall, the camera was put in renderer to allow view-dependent rendering without the need to pass data outside the rendering pipeline. This is one of the cases where it is needed. --- diff --git a/source/object.cpp b/source/object.cpp index f23f6658..06062fc0 100644 --- a/source/object.cpp +++ b/source/object.cpp @@ -96,7 +96,7 @@ void Object::render(Renderer &renderer, const ObjectInstance &inst, const Tag &t renderer.set_texturing(pass->get_texturing()); inst.setup_render(renderer, tag); - unsigned lod = min(inst.get_level_of_detail(), meshes.size()-1); + unsigned lod = min(inst.get_level_of_detail(renderer), meshes.size()-1); meshes[lod]->draw(renderer); inst.finish_render(renderer, tag); } diff --git a/source/objectinstance.h b/source/objectinstance.h index 3dc5da6a..6094517b 100644 --- a/source/objectinstance.h +++ b/source/objectinstance.h @@ -41,7 +41,7 @@ public: anything. */ virtual void finish_render(Renderer &, const Tag &) const { } - virtual unsigned get_level_of_detail() const { return 0; } + virtual unsigned get_level_of_detail(const Renderer &) const { return 0; } }; } // namespace GL