diff options
author | chai <chaifix@163.com> | 2021-10-28 01:52:12 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-28 01:52:12 +0800 |
commit | 80dca084b568e4e77d2a4031ce8625cdabc660ab (patch) | |
tree | d8c0172aeddca648ec89cbbbda72a938f3ef7433 /Runtime/Graphics/VertexBuffer.h | |
parent | 1b6f71b2777bdc74d63f988346a8cfee766718b0 (diff) |
+ custom vertex buffer
Diffstat (limited to 'Runtime/Graphics/VertexBuffer.h')
-rw-r--r-- | Runtime/Graphics/VertexBuffer.h | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/Runtime/Graphics/VertexBuffer.h b/Runtime/Graphics/VertexBuffer.h index 05aa16c..382ca39 100644 --- a/Runtime/Graphics/VertexBuffer.h +++ b/Runtime/Graphics/VertexBuffer.h @@ -10,13 +10,7 @@ #include "GPUDataBuffer.h" #include "DefaultVertexLayout.h" #include "CustomVertexLayout.h" - -enum EPrimitive -{ - Primitive_Triangle = 1, - Primitive_Line = 2, - Primitive_Point = 3, -}; +#include "Primitive.h" class VertexBuffer { @@ -40,42 +34,4 @@ private: }; -class SharedVertexBuffer -{ -public: - SharedVertexBuffer(); - ~SharedVertexBuffer(); - - void GetChunk(uint attrs, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); - void ReleaseChunk(int actualVerts, int actualIndices); - - void DrawChunk(); - -private: - - void FillVertexDataInfo(DefaultVertexLayout& dst); - - void Clean(); - - // if vertex databuffer size beyond this value, use pinned memory mapping, instead of glBufferData. - enum { DataBufferThreshold = 1024 }; - - // shared vbo and ibo - GPU::DataBuffer *m_CurVB; - GPU::DataBuffer *m_CurIB; - - // restore vbo and ibo data if not using pinned memory mapping - std::vector<byte> m_CurVBData; - std::vector<uint16> m_CurIBData; - - EPrimitive m_CurPrimitive; - - uint m_CurAttrMask; - uint m_CurStride; - - uint m_CurVertexCount; - uint m_CurIndexCount; - -}; - #endif
\ No newline at end of file |