summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/CustomVertexLayout.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Graphics/CustomVertexLayout.h')
-rw-r--r--Runtime/Graphics/CustomVertexLayout.h10
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);
}
-