119 u32 vertexCount_ = 0;
121 bool dynamic_ =
false;
158 std::vector<Unique<CustomGeometry>> geometries_;
159 std::vector<GeometryHandle> freeList_;
GPU buffer abstractions for vertex and index data.
Core type definitions and utilities for ESEngine.
Custom geometry for user-defined mesh rendering.
CustomGeometry(CustomGeometry &&)=default
CustomGeometry & operator=(const CustomGeometry &)=delete
bool isDynamic() const
Checks if geometry is dynamic.
u32 getVertexStride() const
Byte stride of one vertex (0 before init) — boundary-validation source.
void setIndices(const u16 *indices, u32 indexCount)
Sets indices for indexed rendering.
~CustomGeometry()=default
const IndexBuffer * indexBuffer() const
Gets the index buffer (null when non-indexed).
bool hasIndices() const
Checks if geometry uses indices.
void updateVertices(const f32 *vertices, u32 vertexCount, u32 offset=0)
Updates vertex data (only for dynamic geometry).
void init(GfxDevice &device, const f32 *vertices, u32 vertexCount, const VertexLayout &layout, bool dynamic=false)
Initializes geometry with vertex data and layout.
u32 getVertexCount() const
Gets the vertex count.
void bind(GfxDevice &device) const
Binds the geometry's buffers for the next draw.
u32 getIndexCount() const
Gets the index count.
bool isValid() const
Checks if geometry is initialized.
VertexLayoutHandle layoutHandle() const
The device vertex layout a pipeline drawing this geometry must reference.
CustomGeometry & operator=(CustomGeometry &&)=default
CustomGeometry(const CustomGeometry &)=delete
GeometryManager()=default
static constexpr GeometryHandle INVALID_HANDLE
bool isValid(GeometryHandle handle) const
Checks if handle is valid.
GeometryHandle create()
Creates a new geometry.
CustomGeometry * get(GeometryHandle handle)
Gets a geometry by handle.
~GeometryManager()=default
void release(GeometryHandle handle)
Releases a geometry.
Abstract graphics device interface.
GPU buffer for index data.
Describes the layout of vertex data in a buffer.
std::shared_ptr< T > Shared
Shared ownership smart pointer.
std::uint32_t u32
Unsigned 32-bit integer.
std::uint16_t u16
Unsigned 16-bit integer.
float f32
32-bit floating point