3#include <Infinity/Types/Core/Data.hpp>
4#include <Infinity/Types/Core/Value.hpp>
5#include <Infinity/Types/Containers/Array.hpp>
6#include <Infinity/Types/Core/Span.hpp>
174 std::unique_ptr<Core::Base>
clone()
const override;
211 uint32_t
at(
size_t index)
const;
273 void pushQuad(uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3);
283 void pushQuad(uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3);
371 size_t _indexCount = 0;
Dynamic contiguous container for homogeneous elements in the Infinity type system.
Definition Array.hpp:77
Base class for complex data types with memory wrapping and property support.
Definition Data.hpp:49
Container for mesh index data defining vertex connectivity and topology.
Definition IndexBuffer.hpp:89
IndexBuffer(const size_t size, IndexType type=IndexType::UInt16, Topology topology=Topology::Triangles)
Constructs an index buffer with pre-allocated capacity.
void clear()
Removes all indices from the buffer.
Topology
Primitive topology defining how indices form geometry.
Definition IndexBuffer.hpp:104
Core::span< const uint16_t > asUInt16Buffer() const
Gets a const span view of the data as 16-bit indices.
void pushQuad(uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3)
Appends indices for a quad (as two triangles).
IndexBuffer(const Containers::Array< uint32_t > &indices, Topology topology=Topology::Triangles)
Constructs an index buffer from a 32-bit index array.
void pushTriangle(uint32_t v0, uint32_t v1, uint32_t v2)
Appends three 32-bit indices forming a triangle.
IndexBuffer(const Containers::Array< uint16_t > &indices, Topology topology=Topology::Triangles)
Constructs an index buffer from a 16-bit index array.
Core::span< uint16_t > asUInt16Buffer()
Gets a mutable span view of the data as 16-bit indices.
virtual ~IndexBuffer()
Destructor.
void pushIndices(const Containers::Array< uint32_t > &indices)
Appends multiple 32-bit indices from an array.
void pushLine(uint32_t v0, uint32_t v1)
Appends two 32-bit indices forming a line segment.
Core::span< uint32_t > asUInt32Buffer()
Gets a mutable span view of the data as 32-bit indices.
void pushLine(uint16_t v0, uint16_t v1)
Appends two 16-bit indices forming a line segment.
void pushIndices(const Containers::Array< uint16_t > &indices)
Appends multiple 16-bit indices from an array.
std::unique_ptr< Core::Base > clone() const override
Core::span< const uint32_t > asUInt32Buffer() const
Gets a const span view of the data as 32-bit indices.
uint32_t operator[](size_t index) const
Accesses an index value (unchecked).
const Infinity::Types::TypeID & typeId() const override
Gets the TypeID for IndexBuffer.
IndexBuffer()
Default constructor.
void setIndex(size_t index, uint32_t value)
Sets the value of an existing index.
void pushTriangle(uint16_t v0, uint16_t v1, uint16_t v2)
Appends three 16-bit indices forming a triangle.
Containers::Array< uint8_t > data
Raw index data storage.
Definition IndexBuffer.hpp:135
void pushIndex(uint32_t index)
Appends a single 32-bit index.
void pushQuad(uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3)
Appends indices for a quad (as two triangles).
uint32_t at(size_t index) const
Accesses an index value (checked).
void reserve(size_t capacity)
Pre-allocates storage for a specified number of indices.
void pushIndex(uint16_t index)
Appends a single 16-bit index.
IndexType
Index data format determining maximum vertex count.
Definition IndexBuffer.hpp:95
size_t count() const
Gets the number of indices in the buffer.
Definition IndexBuffer.hpp:9
Runtime type identifier for the Infinity type system.
Definition TypeID.hpp:71