Added XY_Color VertexLayout
Former-commit-id: 0f53126584b61738b25b1d86cec819d6166ad678
This commit is contained in:
parent
3139e80902
commit
b5dbe6f03f
|
|
@ -274,6 +274,7 @@ enum nzVertexLayout
|
||||||
{
|
{
|
||||||
// Déclarations destinées au rendu
|
// Déclarations destinées au rendu
|
||||||
nzVertexLayout_XY,
|
nzVertexLayout_XY,
|
||||||
|
nzVertexLayout_XY_Color,
|
||||||
nzVertexLayout_XY_UV,
|
nzVertexLayout_XY_UV,
|
||||||
nzVertexLayout_XYZ,
|
nzVertexLayout_XYZ,
|
||||||
nzVertexLayout_XYZ_Color,
|
nzVertexLayout_XYZ_Color,
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,11 @@ struct NzVertexStruct_XY
|
||||||
NzVector2f position;
|
NzVector2f position;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct NzVertexStruct_XY_Color : NzVertexStruct_XY
|
||||||
|
{
|
||||||
|
NzColor color;
|
||||||
|
};
|
||||||
|
|
||||||
struct NzVertexStruct_XY_UV : NzVertexStruct_XY
|
struct NzVertexStruct_XY_UV : NzVertexStruct_XY
|
||||||
{
|
{
|
||||||
NzVector2f uv;
|
NzVector2f uv;
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,13 @@ bool NzVertexDeclaration::Initialize()
|
||||||
|
|
||||||
NazaraAssert(declaration->GetStride() == sizeof(NzVertexStruct_XY), "Invalid stride for declaration nzVertexLayout_XY");
|
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
|
// nzVertexLayout_XY_UV : NzVertexStruct_XY_UV
|
||||||
declaration = &s_declarations[nzVertexLayout_XY_UV];
|
declaration = &s_declarations[nzVertexLayout_XY_UV];
|
||||||
declaration->EnableComponent(nzVertexComponent_Position, nzComponentType_Float2, NzOffsetOf(NzVertexStruct_XY_UV, position));
|
declaration->EnableComponent(nzVertexComponent_Position, nzComponentType_Float2, NzOffsetOf(NzVertexStruct_XY_UV, position));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue