]> git.tdb.fi Git - libs/gl.git/blob - source/grid.h
Convert VertexArray into a Bufferable
[libs/gl.git] / source / grid.h
1 #ifndef MSP_GL_GRID_H_
2 #define MSP_GL_GRID_H_
3
4 #include "geometrybuilder.h"
5 #include "vector.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class GridBuilder: public GeometryBuilder
11 {
12 private:
13         Vector3 origin;
14         Vector3 side1;
15         Vector3 side2;
16         Vector3 norm;
17         Vector3 binorm;
18         unsigned u_div;
19         unsigned v_div;
20
21 public:
22         GridBuilder(float, float, unsigned = 4, unsigned = 4);
23         GridBuilder(const Vector3 &, const Vector3 &, unsigned = 4, unsigned = 4);
24         GridBuilder(const Vector3 &, const Vector3 &, const Vector3 &, unsigned = 4, unsigned = 4);
25 private:
26         void init(bool);
27
28 public:
29         using GeometryBuilder::build;
30         virtual void build(PrimitiveBuilder &) const;
31 };
32
33 } // namespace GL
34 } // namespace Msp
35
36 #endif