MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

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;
44 uint32 colour;
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,
58 VertexCount = 6
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);
67 vertex[CornerRT2] = vertex[CornerRT];
68 vertex[CornerLB2] = vertex[CornerLB];
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);
77 vertex[CornerRT2] = vertex[CornerRT];
78 vertex[CornerLB2] = vertex[CornerLB];
79 }
80
81 Vertex vertex[6];
82 };
83
84 } // namespace MyGUI
85
86 #endif // __MYGUI_VERTEX_DATA_H__
MyGUI::Vertex::y
float y
Definition: MyGUI_VertexData.h:43
MyGUI::VertexQuad::CornerLB2
Definition: MyGUI_VertexData.h:55
MyGUI::uint32
unsigned int uint32
Definition: MyGUI_Types.h:63
MyGUI_Prerequest.h
MyGUI::VertexQuad
Definition: MyGUI_VertexData.h:48
MyGUI::VertexQuad::CornerLB
Definition: MyGUI_VertexData.h:54
MyGUI::VertexQuad::set
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)
Definition: MyGUI_VertexData.h:71
MyGUI::Vertex::colour
uint32 colour
Definition: MyGUI_VertexData.h:44
MyGUI::Vertex::u
float u
Definition: MyGUI_VertexData.h:45
MyGUI::Vertex::x
float x
Definition: MyGUI_VertexData.h:43
MyGUI::VertexQuad::set
void set(float _l, float _t, float _r, float _b, float _z, float _u1, float _v1, float _u2, float _v2, uint32 _colour)
Definition: MyGUI_VertexData.h:61
MyGUI::VertexQuad::Enum
Enum
Definition: MyGUI_VertexData.h:50
MyGUI_Types.h
MyGUI::VertexQuad::VertexCount
Definition: MyGUI_VertexData.h:58
MyGUI::VertexQuad::CornerRT2
Definition: MyGUI_VertexData.h:56
MyGUI::VertexQuad::CornerRB
Definition: MyGUI_VertexData.h:57
MyGUI::Vertex::set
void set(float _x, float _y, float _z, float _u, float _v, uint32 _colour)
Definition: MyGUI_VertexData.h:33
MyGUI::VertexQuad::vertex
Vertex vertex[6]
Definition: MyGUI_VertexData.h:81
MyGUI::Vertex::v
float v
Definition: MyGUI_VertexData.h:45
MyGUI::Vertex
Definition: MyGUI_VertexData.h:31
MyGUI::VertexQuad::CornerRT
Definition: MyGUI_VertexData.h:53
MyGUI::VertexQuad::CornerLT
Definition: MyGUI_VertexData.h:52
MyGUI::Vertex::z
float z
Definition: MyGUI_VertexData.h:43