MyGUI  3.0.1
MyGUI_VertexData.h
Go to the documentation of this file.
1 
7 /*
8  This file is part of MyGUI.
9 
10  MyGUI is free software: you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MyGUI is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22 */
23 #ifndef __MYGUI_VERTEX_DATA_H__
24 #define __MYGUI_VERTEX_DATA_H__
25 
26 #include "MyGUI_Prerequest.h"
27 #include "MyGUI_Types.h"
28 
29 namespace MyGUI
30 {
31 
32  struct Vertex
33  {
34  void set(float _x, float _y, float _z, float _u, float _v, uint32 _colour)
35  {
36  x = _x;
37  y = _y;
38  z = _z;
39  u = _u;
40  v = _v;
41  colour = _colour;
42  }
43 
44  float x, y, z;
46  float u, v;
47  };
48 
49  struct VertexQuad
50  {
51  enum Enum
52  {
53  CornerLT = 0,
54  CornerRT = 1,
55  CornerLB = 2,
56  CornerLB2 = 3,
57  CornerRT2 = 4,
58  CornerRB = 5,
60  };
61 
62  void set(float _l, float _t, float _r, float _b, float _z, float _u1, float _v1, float _u2, float _v2, uint32 _colour)
63  {
64  vertex[CornerLT].set(_l, _t, _z, _u1, _v1, _colour);
65  vertex[CornerRT].set(_r, _t, _z, _u2, _v1, _colour);
66  vertex[CornerLB].set(_l, _b, _z, _u1, _v2, _colour);
67  vertex[CornerRB].set(_r, _b, _z, _u2, _v2, _colour);
70  }
71 
72  void set(float _x1, float _y1, float _x2, float _y2, float _x3, float _y3, float _x4, float _y4, float _z, float _u1, float _v1, float _u2, float _v2, uint32 _colour)
73  {
74  vertex[CornerLT].set(_x1, _y1, _z, _u1, _v1, _colour);
75  vertex[CornerRT].set(_x2, _y2, _z, _u2, _v1, _colour);
76  vertex[CornerLB].set(_x4, _y4, _z, _u1, _v2, _colour);
77  vertex[CornerRB].set(_x3, _y3, _z, _u2, _v2, _colour);
80  }
81 
83  };
84 
85 } // namespace MyGUI
86 
87 #endif // __MYGUI_VERTEX_DATA_H__