]> git.tdb.fi Git - libs/gl.git/blob - source/builders/geometrybuilder.h
Add files which were forgotten earlier
[libs/gl.git] / source / builders / geometrybuilder.h
1 #ifndef MSP_GL_GEOMETRYBUILDER_H_
2 #define MSP_GL_GEOMETRYBUILDER_H_
3
4 #include <msp/core/attributes.h>
5
6 namespace Msp {
7 namespace GL {
8
9 class Mesh;
10 class PrimitiveBuilder;
11
12 class GeometryBuilder
13 {
14 public:
15         enum TextureFit
16         {
17                 STRETCH,
18                 CROP,
19                 WRAP
20         };
21
22 protected:
23         bool generate_tan = false;
24         TextureFit tex_fit = STRETCH;
25
26         GeometryBuilder() = default;
27
28 public:
29         DEPRECATED GeometryBuilder &tbn(bool t = true) { return tangents(t); }
30         GeometryBuilder &tangents(bool = true);
31         GeometryBuilder &texture_fit(TextureFit);
32 protected:
33         void adjust_texture_scale(float &, float &, float, float) const;
34
35 public:
36         virtual void build(PrimitiveBuilder &) const = 0;
37         void build(Mesh &) const;
38 };
39
40 } // namespace GL
41 } // namespace Msp
42
43 #endif