1 #ifndef MSP_GL_OBJETCINSTANCE_H_
2 #define MSP_GL_OBJETCINSTANCE_H_
5 #include "renderable.h"
14 Represents a single instance of an Object. An application can derive another
15 class from this and overload the hook functions to specify location and other
16 instance-specific parameters for the rendered objects.
18 class ObjectInstance: public Renderable
24 ObjectInstance(const Object &);
26 const Object &get_object() const { return object; }
27 virtual long get_instance_key() const { return reinterpret_cast<long>(&object); }
29 virtual void render(const Tag &tag = Tag()) const;
30 virtual void render(Renderer &, const Tag & = Tag()) const;
32 /** Hook function, called from Object just before rendering the mesh.
33 Renderer state will have been pushed before this is called. */
34 virtual void setup_render(Renderer &, const Tag &) const { }
36 /** Hook function, called from Object right after rendering the mesh. Since
37 Object takes care of pushing Renderer state, this rarely needs to do
39 virtual void finish_render(Renderer &, const Tag &) const { }
41 virtual unsigned get_level_of_detail() const { return 0; }