X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fobject.h;h=fff1e4cf281d770adf207fada79e156ca016b6e6;hp=9c1ea7f7fbbf9533afab934b8d20d4df24263230;hb=e759062876ee7fc81d1c2f40818d5bf97898d53d;hpb=c6c4fc39952e372eba1f44f2bc504428140f3d0e diff --git a/source/object.h b/source/object.h index 9c1ea7f7..fff1e4cf 100644 --- a/source/object.h +++ b/source/object.h @@ -70,8 +70,6 @@ public: const Technique *get_technique() const { return technique; } - virtual bool has_pass(const Tag &) const; - /** Renders the object. A tag can be provided to render a non-default pass. */ @@ -93,6 +91,9 @@ public: template void render(Iter begin, Iter end, const Tag &tag=Tag()) const { + if(!can_render(tag)) + return; + const ObjectPass *pass=get_pass(tag); setup_render(pass); for(Iter i=begin; i!=end; ++i) @@ -100,6 +101,7 @@ public: finish_render(pass); } private: + bool can_render(const Tag &) const; const ObjectPass *get_pass(const Tag &) const; void setup_render(const ObjectPass *) const; void finish_render(const ObjectPass *) const;