]> git.tdb.fi Git - libs/gl.git/blob - source/geometrybuilder.h
Use the lexical_cast framework instead of istreams
[libs/gl.git] / source / geometrybuilder.h
1 #ifndef MSP_GL_GEOMETRYBUILDER_H_
2 #define MSP_GL_GEOMETRYBUILDER_H_
3
4 namespace Msp {
5 namespace GL {
6
7 class Mesh;
8 class PrimitiveBuilder;
9
10 class GeometryBuilder
11 {
12 public:
13         enum TextureFit
14         {
15                 STRETCH,
16                 CROP,
17                 WRAP
18         };
19
20 protected:
21         int tangent_attr;
22         int binormal_attr;
23         TextureFit tex_fit;
24
25         GeometryBuilder();
26
27 public:
28         GeometryBuilder &tangent(unsigned);
29         GeometryBuilder &binormal(unsigned);
30         GeometryBuilder &texture_fit(TextureFit);
31 protected:
32         void adjust_texture_scale(float &, float &, float, float) const;
33
34 public:
35         virtual void build(PrimitiveBuilder &) const = 0;
36         void build(Mesh &) const;
37 };
38
39 } // namespace GL
40 } // namespace Msp
41
42 #endif