MyGUI  3.2.1
MyGUI_VertexData.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_VERTEX_DATA_H__
00008 #define __MYGUI_VERTEX_DATA_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Types.h"
00012 
00013 namespace MyGUI
00014 {
00015 
00016     struct Vertex
00017     {
00018         void set(float _x, float _y, float _z, float _u, float _v, uint32 _colour)
00019         {
00020             x = _x;
00021             y = _y;
00022             z = _z;
00023             u = _u;
00024             v = _v;
00025             colour = _colour;
00026         }
00027 
00028         float x, y, z;
00029         uint32 colour;
00030         float u, v;
00031     };
00032 
00033     struct VertexQuad
00034     {
00035         enum Enum
00036         {
00037             CornerLT = 0,
00038             CornerRT = 1,
00039             CornerLB = 2,
00040             CornerLB2 = 3,
00041             CornerRT2 = 4,
00042             CornerRB = 5,
00043             VertexCount = 6
00044         };
00045 
00046         void set(float _l, float _t, float _r, float _b, float _z, float _u1, float _v1, float _u2, float _v2, uint32 _colour)
00047         {
00048             vertex[CornerLT].set(_l, _t, _z, _u1, _v1, _colour);
00049             vertex[CornerRT].set(_r, _t, _z, _u2, _v1, _colour);
00050             vertex[CornerLB].set(_l, _b, _z, _u1, _v2, _colour);
00051             vertex[CornerRB].set(_r, _b, _z, _u2, _v2, _colour);
00052             vertex[CornerRT2] = vertex[CornerRT];
00053             vertex[CornerLB2] = vertex[CornerLB];
00054         }
00055 
00056         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)
00057         {
00058             vertex[CornerLT].set(_x1, _y1, _z, _u1, _v1, _colour);
00059             vertex[CornerRT].set(_x2, _y2, _z, _u2, _v1, _colour);
00060             vertex[CornerLB].set(_x4, _y4, _z, _u1, _v2, _colour);
00061             vertex[CornerRB].set(_x3, _y3, _z, _u2, _v2, _colour);
00062             vertex[CornerRT2] = vertex[CornerRT];
00063             vertex[CornerLB2] = vertex[CornerLB];
00064         }
00065 
00066         Vertex vertex[6];
00067     };
00068 
00069 } // namespace MyGUI
00070 
00071 #endif // __MYGUI_VERTEX_DATA_H__