|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
#include <platform/graphics/vertexBuffer.h>
Public Member Functions | |
| std::shared_ptr< VertexFormat > | format () const |
| virtual void * | nativeBuffer () const |
| int | numVertices () const |
| bool | setData (const std::vector< uint8_t > &data) |
| const std::vector< uint8_t > & | storage () const |
| virtual void | unlock ()=0 |
| VertexBuffer (GraphicsDevice *graphicsDevice, std::shared_ptr< VertexFormat > format, int numVertices, const VertexBufferOptions &options=VertexBufferOptions{}) | |
| virtual | ~VertexBuffer () |
Protected Member Functions | |
| VertexBuffer (GraphicsDevice *device, std::shared_ptr< VertexFormat > format, int numVertices, int numBytes) | |
Protected Attributes | |
| GraphicsDevice * | _device |
| std::vector< uint8_t > | _storage |
A vertex buffer is the mechanism via which the application specifies vertex data to the graphics hardware
Definition at line 30 of file vertexBuffer.h.
| visutwin::canvas::VertexBuffer::VertexBuffer | ( | GraphicsDevice * | graphicsDevice, |
| std::shared_ptr< VertexFormat > | format, | ||
| int | numVertices, | ||
| const VertexBufferOptions & | options = VertexBufferOptions{} ) |
Definition at line 17 of file vertexBuffer.cpp.
References _device, _storage, visutwin::canvas::VertexBufferOptions::data, format(), and numVertices().
Referenced by visutwin::canvas::MetalVertexBuffer::MetalVertexBuffer(), and visutwin::canvas::MetalVertexBuffer::MetalVertexBuffer().
|
virtual |
Definition at line 52 of file vertexBuffer.cpp.
References _device.
|
protected |
Zero-copy constructor: creates a VertexBuffer with no CPU-side _storage. Used when the GPU buffer is provided externally (e.g., compute shader output). The _storage vector remains empty — the GPU buffer is set via the subclass.
Definition at line 44 of file vertexBuffer.cpp.
References _device, visutwin::canvas::BUFFER_STATIC, format(), and numVertices().
|
inline |
Definition at line 38 of file vertexBuffer.h.
Referenced by visutwin::canvas::MetalVertexBuffer::MetalVertexBuffer(), visutwin::canvas::MetalVertexBuffer::MetalVertexBuffer(), VertexBuffer(), and VertexBuffer().
|
inlinevirtual |
Reimplemented in visutwin::canvas::MetalVertexBuffer.
Definition at line 49 of file vertexBuffer.h.
|
inline |
Definition at line 47 of file vertexBuffer.h.
Referenced by visutwin::canvas::MetalVertexBuffer::MetalVertexBuffer(), visutwin::canvas::MetalVertexBuffer::MetalVertexBuffer(), VertexBuffer(), and VertexBuffer().
| bool visutwin::canvas::VertexBuffer::setData | ( | const std::vector< uint8_t > & | data | ) |
Definition at line 69 of file vertexBuffer.cpp.
|
inline |
CPU-side vertex data. Used by BatchManager to read vertex positions/normals for merging.
Definition at line 52 of file vertexBuffer.h.
References _storage.
|
pure virtual |
Implemented in visutwin::canvas::MetalVertexBuffer.
Referenced by setData().
|
protected |
Definition at line 61 of file vertexBuffer.h.
Referenced by visutwin::canvas::MetalVertexBuffer::unlock(), VertexBuffer(), VertexBuffer(), and ~VertexBuffer().
|
protected |
Definition at line 63 of file vertexBuffer.h.
Referenced by visutwin::canvas::MetalVertexBuffer::MetalVertexBuffer(), setData(), storage(), visutwin::canvas::MetalVertexBuffer::unlock(), and VertexBuffer().