From 60cbbdec07ab7a5636eac5b3c024ae44e937f4d4 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 13 Dec 2021 00:07:19 +0800 Subject: +init --- Client/Source/Graphics/CustomVertexLayout.h | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Client/Source/Graphics/CustomVertexLayout.h (limited to 'Client/Source/Graphics/CustomVertexLayout.h') diff --git a/Client/Source/Graphics/CustomVertexLayout.h b/Client/Source/Graphics/CustomVertexLayout.h new file mode 100644 index 0000000..3b54039 --- /dev/null +++ b/Client/Source/Graphics/CustomVertexLayout.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "OpenGL.h" +#include "GPUDataBuffer.h" +#include "VertexAttribute.h" + +struct CustomVertexLayout +{ + GLuint buffer; // 创建时留空 + std::vector attributes; + + CustomVertexLayout() + { + int n = buffer; + } + + // 重置pointer(startOffset)为0 + void RestorePointer() + { + for (int i = 0; i < attributes.size(); ++i) + { + attributes[i].pointer = 0; + } + } +}; + +namespace VertexLayout +{ + + extern void SetupCustomVertexLayout(CustomVertexLayout& layout); + +} -- cgit v1.1-26-g67d0