]> git.tdb.fi Git - libs/gl.git/blob - source/renderable.h
78879a3d8030fb15fcd41136c16ec7c831541972
[libs/gl.git] / source / renderable.h
1 #ifndef MSP_GL_RENDERABLE_H_
2 #define MSP_GL_RENDERABLE_H_
3
4 #include <string>
5 #include "tag.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class Renderer;
11
12 /**
13 Base class for renderable objects.  All Renderables must support rendering with
14 a Renderer, and may optionally provide support for standalone rendering.
15 */
16 class Renderable
17 {
18 protected:
19         Renderable() { }
20 public:
21         virtual ~Renderable() { }
22
23         /** Returns a key used for grouping Renderables in an InstanceScene. */
24         virtual long get_instance_key() const { return 0; }
25
26         virtual void render(const Tag & = Tag()) const;
27         virtual void render(Renderer &, const Tag & = Tag()) const = 0;
28 };
29
30 } // namespace Msp
31 } // namespace GL
32
33 #endif