22 #ifndef INCLUDED_VERTEXBUFFER 23 #define INCLUDED_VERTEXBUFFER 94 const char* name,
const size_t vertexSize,
97 const char* name,
const size_t vertexSize,
99 const size_t maximumBufferSize);
117 const bool dynamic)
const;
141 const size_t vertexSize,
const size_t numberOfVertices,
158 std::unique_ptr<Renderer::Backend::IBuffer>
m_Buffer;
163 #endif // INCLUDED_VERTEXBUFFER size_t m_Index
Definition: VertexBuffer.h:68
std::vector< VBChunk * > m_FreeList
List of free chunks in this buffer.
Definition: VertexBuffer.h:152
void PrepareForRendering(VBChunk *chunk)
Make the vertex data available for the next usage.
Definition: VertexBuffer.cpp:320
bool m_Needed
Definition: VertexBuffer.h:81
friend class CVertexBuffer
Definition: VertexBuffer.h:86
Type
Definition: IBuffer.h:34
VBChunk()
Definition: VertexBuffer.h:87
Definition: VertexBufferManager.h:34
VBChunk * Allocate(const size_t vertexSize, const size_t numberOfVertices, const Renderer::Backend::IBuffer::Type type, const bool dynamic, void *backingStore)
Try to allocate a buffer of given number of vertices (each of given size), and with the given type - ...
Definition: VertexBuffer.cpp:103
size_t GetBytesAllocated() const
Definition: VertexBuffer.cpp:297
bool CompatibleVertexType(const size_t vertexSize, const Renderer::Backend::IBuffer::Type type, const bool dynamic) const
Returns true if this vertex buffer is compatible with the specified vertex type and intended usage...
Definition: VertexBuffer.cpp:91
Definition: VertexBuffer.h:63
static bool UseStreaming(const bool dynamic)
Given the usage flags of a buffer that has been (or will be) allocated:
Definition: VertexBuffer.cpp:315
CVertexBuffer: encapsulation of backend buffers, also supplying some additional functionality for sha...
Definition: VertexBuffer.h:56
size_t GetVertexSize() const
Definition: VertexBuffer.h:110
void UploadIfNeeded(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Definition: VertexBuffer.cpp:228
std::vector< VBChunk * > m_AllocList
List of allocated chunks.
Definition: VertexBuffer.h:154
size_t m_FreeVertices
Available free vertices - total of all free vertices in the free list.
Definition: VertexBuffer.h:156
NONCOPYABLE(CVertexBuffer)
size_t GetBytesReserved() const
Definition: VertexBuffer.cpp:292
~VBChunk()
Definition: VertexBuffer.h:88
void UpdateChunkVertices(VBChunk *chunk, void *data)
Update vertex data for given chunk. Transfers the provided data to the actual OpenGL vertex buffer...
Definition: VertexBuffer.cpp:208
void Release(VBChunk *chunk)
Return given chunk to this buffer.
Definition: VertexBuffer.cpp:166
std::unique_ptr< Renderer::Backend::IBuffer > m_Buffer
Definition: VertexBuffer.h:158
size_t m_Count
Definition: VertexBuffer.h:70
size_t m_MaxVertices
Number of vertices of above size in this buffer.
Definition: VertexBuffer.h:150
Renderer::Backend::IBuffer * GetBuffer()
Definition: VertexBuffer.h:133
CVertexBuffer * m_Owner
Definition: VertexBuffer.h:66
size_t m_VertexSize
Vertex size of this vertex buffer.
Definition: VertexBuffer.h:148
void DumpStatus() const
Definition: VertexBuffer.cpp:302
void * m_BackingStore
Definition: VertexBuffer.h:72
bool m_Dirty
Definition: VertexBuffer.h:77
Definition: IDeviceCommandContext.h:40
bool m_HasNeededChunks
Definition: VertexBuffer.h:160
~CVertexBuffer()
Definition: VertexBuffer.cpp:80