]> git.tdb.fi Git - libs/gl.git/blob - source/geometrybuilder.h
Add classes for building some geometric shapes
[libs/gl.git] / source / geometrybuilder.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2011  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_GEOMETRYBUILDER_H_
9 #define MSP_GL_GEOMETRYBUILDER_H_
10
11 namespace Msp {
12 namespace GL {
13
14 class Mesh;
15 class PrimitiveBuilder;
16
17 class GeometryBuilder
18 {
19 public:
20         enum TextureFit
21         {
22                 STRETCH,
23                 CUT,
24                 WRAP
25         };
26
27 protected:
28         int tangent_attr;
29         int binormal_attr;
30         TextureFit tex_fit;
31
32         GeometryBuilder();
33
34 public:
35         GeometryBuilder &tangent(unsigned);
36         GeometryBuilder &binormal(unsigned);
37         GeometryBuilder &texture_fit(TextureFit);
38
39         virtual void build(PrimitiveBuilder &) const = 0;
40         void build(Mesh &) const;
41 };
42
43 } // namespace GL
44 } // namespace Msp
45
46 #endif