diff options
Diffstat (limited to 'Client/Source/Graphics/CustomVertexLayout.h')
-rw-r--r-- | Client/Source/Graphics/CustomVertexLayout.h | 33 |
1 files changed, 33 insertions, 0 deletions
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 <vector> +#include "OpenGL.h" +#include "GPUDataBuffer.h" +#include "VertexAttribute.h" + +struct CustomVertexLayout +{ + GLuint buffer; // 创建时留空 + std::vector<VertexAttributeDescriptor> 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); + +} |