X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fobject.h;h=42541eaf28004807d1e088f32f1281c1788b7800;hp=0039dffd42500f8daadaaff85c1071df279d9564;hb=b8b06a0ff96763ba7e188d9fcacbd8c0e3dcd515;hpb=a8c4b199788c87f0a22b8c8df1509905b6fb488b diff --git a/source/object.h b/source/object.h index 0039dffd..42541eaf 100644 --- a/source/object.h +++ b/source/object.h @@ -92,12 +92,24 @@ public: Each instance's hook functions will be called before and after drawing the mesh. */ - void render(const std::list &, const Tag &tag=Tag()) const; + template + void render(Iter begin, Iter end, const Tag &tag=Tag()) const + { render(get_pass(tag), begin, end); } private: void setup_render(const ObjectPass &) const; void finish_render(const ObjectPass &) const; void render(const ObjectPass &, const ObjectInstance *) const; - void render(const ObjectPass &, const std::list &) const; + + template + void render(const ObjectPass &pass, Iter begin, Iter end) const + { + setup_render(pass); + for(Iter i=begin; i!=end; ++i) + render_instance(pass, **i); + finish_render(pass); + } + + void render_instance(const ObjectPass &, const ObjectInstance &) const; }; } // namespace GL