]> git.tdb.fi Git - libs/gl.git/blob - source/objectinstance.h
Add Uniform* classes to store uniform data of Programs
[libs/gl.git] / source / objectinstance.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_OBJETCINSTANCE_H_
9 #define MSP_GL_OBJETCINSTANCE_H_
10
11 namespace Msp {
12 namespace GL {
13
14 class Object;
15 class ProgramData;
16
17 /**
18 Represents a single instance of an Object.  An application can derive another
19 class from this and overload the hook functions to specify location and other
20 instance-specific parameters for the rendered objects.
21 */
22 class ObjectInstance
23 {
24 protected:
25         const Object &object;
26
27 public:
28         ObjectInstance(const Object &);
29         void render() const;
30
31         /**
32         Hook function, called from Object just before rendering the mesh.
33         */
34         virtual void setup_render() const { }
35
36         /**
37         Hook function, called from Object right after rendering the mesh.
38         */
39         virtual void finish_render() const { }
40
41         virtual unsigned get_detail_level() const { return 0; }
42 };
43
44 } // namespace GL
45 } // namespaec Msp
46
47 #endif