]> git.tdb.fi Git - libs/gl.git/blob - source/renderable.h
Generalize instancing to all Renderables
[libs/gl.git] / source / renderable.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007, 2011  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_RENDERABLE_H_
9 #define MSP_GL_RENDERABLE_H_
10
11 #include <string>
12 #include "tag.h"
13
14 namespace Msp {
15 namespace GL {
16
17 class Renderer;
18
19 class Renderable
20 {
21 protected:
22         Renderable() { }
23 public:
24         virtual ~Renderable() { }
25
26         /** Returns a key used for grouping Renderables in an InstanceScene. */
27         virtual long get_instance_key() const { return 0; }
28
29         virtual void render(const Tag & = Tag()) const;
30         virtual void render(Renderer &, const Tag & = Tag()) const;
31 };
32
33 } // namespace Msp
34 } // namespace GL
35
36 #endif