From 78417f6cdedfcf60c8ca437190975644e942e01f Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 1 Nov 2021 10:43:51 +0800 Subject: *rename SharedVertexBuffer -> DynamicVertexBuffer --- Runtime/Graphics/SharedVertexBuffer.h | 54 ----------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 Runtime/Graphics/SharedVertexBuffer.h (limited to 'Runtime/Graphics/SharedVertexBuffer.h') diff --git a/Runtime/Graphics/SharedVertexBuffer.h b/Runtime/Graphics/SharedVertexBuffer.h deleted file mode 100644 index cc89752..0000000 --- a/Runtime/Graphics/SharedVertexBuffer.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once -#include - -#include "../Utilities/UtilMacros.h" -#include "../Shaders/ShaderChannel.h" - -#include "OpenGL.h" -#include "GPUDataBuffer.h" -#include "DefaultVertexLayout.h" -#include "CustomVertexLayout.h" -#include "Primitive.h" - -class SharedVertexBuffer -{ -public: - SharedVertexBuffer(); - ~SharedVertexBuffer(); - - // default layout - void GetChunk(uint attrs, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); - void DrawChunk(); - - // custom layout - void GetChunk(uint sizePerVert, uint sizePerIndex, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); - void DrawChunk(CustomVertexLayout& layout); - - // common - void ReleaseChunk(int actualVerts, int actualIndices); - -private: - - void FillCustomVertexLayout(CustomVertexLayout& dst); - void FillDefaultVertexLayout(DefaultVertexLayout& dst); - - void Clean(); - - // 如果数据大小超过这个限制,用内存数据,而不是glBufferData - enum { DataBufferThreshold = 1024 }; - - GPU::DataBuffer *m_CurVB; - GPU::DataBuffer *m_CurIB; - - std::vector m_CurVBData; - std::vector m_CurIBData; - - EPrimitive m_CurPrimitive; - - uint m_CurAttrMask; // default layout - uint m_CurStride; // default layout - - uint m_CurVertexCount; - uint m_CurIndexCount; - -}; -- cgit v1.1-26-g67d0