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