diff options
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; }; |