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