diff options
author | chai <chaifix@163.com> | 2021-11-02 19:44:01 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-02 19:44:01 +0800 |
commit | 72812a7b47f90f9460e54e8149ba9199a7841244 (patch) | |
tree | 9ebdb4b65d7cbbc0a3d7c436a9b45d4eff351b62 /Runtime/Graphics/VertexBuffer.h | |
parent | b7511abf1a1f302b5c7ebf50faaf65b62d7bb6ed (diff) |
! Text mesh done
Diffstat (limited to 'Runtime/Graphics/VertexBuffer.h')
-rw-r--r-- | Runtime/Graphics/VertexBuffer.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Runtime/Graphics/VertexBuffer.h b/Runtime/Graphics/VertexBuffer.h index c651bdb..2d3a9f5 100644 --- a/Runtime/Graphics/VertexBuffer.h +++ b/Runtime/Graphics/VertexBuffer.h @@ -26,16 +26,28 @@ public: VertexBuffer(int vbSize, int ibSize, VertexBufferType type); ~VertexBuffer(); + // 填充数据 + void GetChunk(uint sizePerVert, uint sizePerIndex, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); + // 提交数据 + void FlushChunk(int actualVerts, int actualIndices); + GET(GPU::DataBuffer*, VB, m_VB); + GET(GPU::DataBuffer*, IB, m_IB); - void Draw(); + void Draw(CustomVertexLayout& layout); private: + void FillCustomVertexLayout(CustomVertexLayout& dst); + VertexBufferType m_Type; GPU::DataBuffer* m_VB; GPU::DataBuffer* m_IB; + int m_SizePerVertex; + + int m_CurIndexCount; + EPrimitive m_Primitive; }; |