From 601442f94fc0dcfdc5a117c5f87d90b156d53045 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 31 Oct 2021 14:27:26 +0800 Subject: +static initiator --- Runtime/Graphics/VertexAttribute.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Runtime/Graphics/VertexAttribute.h') diff --git a/Runtime/Graphics/VertexAttribute.h b/Runtime/Graphics/VertexAttribute.h index 4e50a1a..2757c70 100644 --- a/Runtime/Graphics/VertexAttribute.h +++ b/Runtime/Graphics/VertexAttribute.h @@ -21,6 +21,15 @@ enum VertexAttrFormat struct VertexAttributeDescriptor { + //union { + const void* pointer; // 内存地址,刚创建时留空 + int startOffset; // 显存中相对VBO的偏移值 + //}; + uint componentNum; // 向量维度1,2,3,4 + uint componentFormat; // 每个分量的类型 + uint16 stride; // 间隔 + bool normalize; // 是否归一化,只用于CustomVertexLayout + // for default vertex layout VertexAttributeDescriptor() {} // for custom vertex layout @@ -33,14 +42,6 @@ struct VertexAttributeDescriptor normalize = normalized; } - union { - const void* pointer; // 内存地址或显存中相对VBO的偏移值 - int startOffset; - }; - uint componentNum; // 向量维度1,2,3,4 - uint componentFormat; // 每个分量的类型 - uint16 stride; // 间隔 - bool normalize; // 是否归一化,只用于CustomVertexLayout }; namespace VertexAttribute -- cgit v1.1-26-g67d0