]> git.tdb.fi Git - libs/gl.git/blob - source/grid.h
Add a method to get the offset of a single component of a VertexFormat
[libs/gl.git] / source / grid.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_GRID_H_
9 #define MSP_GL_GRID_H_
10
11 #include "geometrybuilder.h"
12 #include "vector.h"
13
14 namespace Msp {
15 namespace GL {
16
17 class GridBuilder: public GeometryBuilder
18 {
19 private:
20         Vector3 origin;
21         Vector3 side1;
22         Vector3 side2;
23         Vector3 norm;
24         Vector3 binorm;
25         unsigned u_div;
26         unsigned v_div;
27         float u_origin;
28         float y_origin;
29
30 public:
31         GridBuilder(float, float, unsigned = 4, unsigned = 4);
32         GridBuilder(const Vector3 &, const Vector3 &, unsigned = 4, unsigned = 4);
33         GridBuilder(const Vector3 &, const Vector3 &, const Vector3 &, unsigned = 4, unsigned = 4);
34 private:
35         void init(bool);
36
37 public:
38         virtual void build(PrimitiveBuilder &) const;
39 };
40
41 } // namespace GL
42 } // namespace Msp
43
44 #endif