Added XY_Color VertexLayout

Former-commit-id: 0f53126584b61738b25b1d86cec819d6166ad678
This commit is contained in:
Lynix 2015-01-16 12:52:10 +01:00
parent 3139e80902
commit b5dbe6f03f
3 changed files with 13 additions and 0 deletions

View File

@ -274,6 +274,7 @@ enum nzVertexLayout
{
// Déclarations destinées au rendu
nzVertexLayout_XY,
nzVertexLayout_XY_Color,
nzVertexLayout_XY_UV,
nzVertexLayout_XYZ,
nzVertexLayout_XYZ_Color,

View File

@ -18,6 +18,11 @@ struct NzVertexStruct_XY
NzVector2f position;
};
struct NzVertexStruct_XY_Color : NzVertexStruct_XY
{
NzColor color;
};
struct NzVertexStruct_XY_UV : NzVertexStruct_XY
{
NzVector2f uv;

View File

@ -192,6 +192,13 @@ bool NzVertexDeclaration::Initialize()
NazaraAssert(declaration->GetStride() == sizeof(NzVertexStruct_XY), "Invalid stride for declaration nzVertexLayout_XY");
// nzVertexLayout_XY_Color : NzVertexStruct_XY_Color
declaration = &s_declarations[nzVertexLayout_XY_Color];
declaration->EnableComponent(nzVertexComponent_Position, nzComponentType_Float2, NzOffsetOf(NzVertexStruct_XY_Color, position));
declaration->EnableComponent(nzVertexComponent_Color, nzComponentType_Color, NzOffsetOf(NzVertexStruct_XY_Color, color));
NazaraAssert(declaration->GetStride() == sizeof(NzVertexStruct_XY_Color), "Invalid stride for declaration nzVertexLayout_XY_Color");
// nzVertexLayout_XY_UV : NzVertexStruct_XY_UV
declaration = &s_declarations[nzVertexLayout_XY_UV];
declaration->EnableComponent(nzVertexComponent_Position, nzComponentType_Float2, NzOffsetOf(NzVertexStruct_XY_UV, position));