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