diff options
author | chai <chaifix@163.com> | 2021-10-31 14:27:26 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-31 14:27:26 +0800 |
commit | 601442f94fc0dcfdc5a117c5f87d90b156d53045 (patch) | |
tree | b006bcd6a28a965a900c64f4716007fcb45eee98 /Runtime/Graphics/CustomVertexLayout.h | |
parent | 26f05c6e3dcac9995345fb5a2b031be7e3ea79e9 (diff) |
+static initiator
Diffstat (limited to 'Runtime/Graphics/CustomVertexLayout.h')
-rw-r--r-- | Runtime/Graphics/CustomVertexLayout.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Runtime/Graphics/CustomVertexLayout.h b/Runtime/Graphics/CustomVertexLayout.h index 86dcf90..d72c71d 100644 --- a/Runtime/Graphics/CustomVertexLayout.h +++ b/Runtime/Graphics/CustomVertexLayout.h @@ -11,6 +11,15 @@ struct CustomVertexLayout { GLuint buffer; // 创建时留空 std::vector<VertexAttributeDescriptor> attributes; + + // 重置pointer(startOffset)为0 + void ResetPointer() + { + for (int i = 0; i < attributes.size(); ++i) + { + attributes[i].pointer = 0; + } + } }; namespace VertexLayout @@ -19,4 +28,3 @@ namespace VertexLayout extern void SetupCustomVertexLayout(CustomVertexLayout& layout); } - |