MyGUI  3.2.0
MyGUI_VertexData.h
Go to the documentation of this file.
00001 
00006 /*
00007     This file is part of MyGUI.
00008 
00009     MyGUI is free software: you can redistribute it and/or modify
00010     it under the terms of the GNU Lesser General Public License as published by
00011     the Free Software Foundation, either version 3 of the License, or
00012     (at your option) any later version.
00013 
00014     MyGUI is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00021 */
00022 #ifndef __MYGUI_VERTEX_DATA_H__
00023 #define __MYGUI_VERTEX_DATA_H__
00024 
00025 #include "MyGUI_Prerequest.h"
00026 #include "MyGUI_Types.h"
00027 
00028 namespace MyGUI
00029 {
00030 
00031     struct Vertex
00032     {
00033         void set(float _x, float _y, float _z, float _u, float _v, uint32 _colour)
00034         {
00035             x = _x;
00036             y = _y;
00037             z = _z;
00038             u = _u;
00039             v = _v;
00040             colour = _colour;
00041         }
00042 
00043         float x, y, z;
00044         uint32 colour;
00045         float u, v;
00046     };
00047 
00048     struct VertexQuad
00049     {
00050         enum Enum
00051         {
00052             CornerLT = 0,
00053             CornerRT = 1,
00054             CornerLB = 2,
00055             CornerLB2 = 3,
00056             CornerRT2 = 4,
00057             CornerRB = 5,
00058             VertexCount = 6
00059         };
00060 
00061         void set(float _l, float _t, float _r, float _b, float _z, float _u1, float _v1, float _u2, float _v2, uint32 _colour)
00062         {
00063             vertex[CornerLT].set(_l, _t, _z, _u1, _v1, _colour);
00064             vertex[CornerRT].set(_r, _t, _z, _u2, _v1, _colour);
00065             vertex[CornerLB].set(_l, _b, _z, _u1, _v2, _colour);
00066             vertex[CornerRB].set(_r, _b, _z, _u2, _v2, _colour);
00067             vertex[CornerRT2] = vertex[CornerRT];
00068             vertex[CornerLB2] = vertex[CornerLB];
00069         }
00070 
00071         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)
00072         {
00073             vertex[CornerLT].set(_x1, _y1, _z, _u1, _v1, _colour);
00074             vertex[CornerRT].set(_x2, _y2, _z, _u2, _v1, _colour);
00075             vertex[CornerLB].set(_x4, _y4, _z, _u1, _v2, _colour);
00076             vertex[CornerRB].set(_x3, _y3, _z, _u2, _v2, _colour);
00077             vertex[CornerRT2] = vertex[CornerRT];
00078             vertex[CornerLB2] = vertex[CornerLB];
00079         }
00080 
00081         Vertex vertex[6];
00082     };
00083 
00084 } // namespace MyGUI
00085 
00086 #endif // __MYGUI_VERTEX_DATA_H__