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/CustomVertexLayout.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Runtime/Graphics/CustomVertexLayout.h') 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 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); } - -- cgit v1.1-26-g67d0