1 #ifndef MSP_GL_RENDERABLE_H_
2 #define MSP_GL_RENDERABLE_H_
14 Base class for renderable objects. All Renderables must support rendering with
15 a Renderer, and may optionally provide support for standalone rendering.
17 The render methods take a Tag to identify a render pass. It is most commonly
18 used together with Techniques and Pipelines to implement multipass rendering.
25 virtual ~Renderable() { }
27 /** Returns a key used for grouping Renderables in an InstanceScene. The
28 returned value is treated as opaque. */
29 virtual long get_instance_key() const { return 0; }
31 /** Returns the model matrix of the Renderable. Null is returned if no such
33 virtual const Matrix *get_matrix() const { return 0; }
35 /** Renders the renderable without a renderer. This can be convenient in
36 some simple cases, but most renderables don't need to implement this
38 virtual void render(const Tag & = Tag()) const;
40 /** Renders the renderable. Implementors should take care to return the
41 renderer to the state it was in, for example by using Renderer::Push. */
42 virtual void render(Renderer &, const Tag & = Tag()) const = 0;