|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
GPU buffer for index data. More...
#include <Buffer.hpp>
Public Member Functions | |
| IndexBuffer ()=default | |
| ~IndexBuffer () | |
| IndexBuffer (const IndexBuffer &)=delete | |
| IndexBuffer & | operator= (const IndexBuffer &)=delete |
| IndexBuffer (IndexBuffer &&other) noexcept | |
| IndexBuffer & | operator= (IndexBuffer &&other) noexcept |
| u32 | getCount () const |
| Gets the number of indices. | |
| BufferHandle | handle () const |
| Gets the device buffer handle. | |
| bool | is16Bit () const |
| Returns true if using 16-bit indices. | |
Static Public Member Functions | |
| static Unique< IndexBuffer > | create (GfxDevice &device, GfxContent content, std::span< const u32 > indices) |
| Creates an index buffer from a span of 32-bit indices. | |
| static Unique< IndexBuffer > | create (GfxDevice &device, GfxContent content, std::span< const u16 > indices) |
| Creates an index buffer from a span of 16-bit indices. | |
| static Unique< IndexBuffer > | create (GfxDevice &device, GfxContent content, const std::vector< u32 > &indices) |
| Creates an index buffer from a vector of 32-bit indices. | |
| static Unique< IndexBuffer > | create (GfxDevice &device, GfxContent content, const std::vector< u16 > &indices) |
| Creates an index buffer from a vector of 16-bit indices. | |
| static Unique< IndexBuffer > | create (GfxDevice &device, GfxContent content, const u32 *indices, u32 count) |
| Creates an index buffer with 32-bit indices from pointer. | |
| static Unique< IndexBuffer > | create (GfxDevice &device, GfxContent content, const u16 *indices, u32 count) |
| Creates an index buffer with 16-bit indices from pointer. | |
GPU buffer for index data.
Wraps a GfxDevice element buffer object. Supports both 16-bit and 32-bit indices.
Definition at line 337 of file Buffer.hpp.
|
default |
Referenced by IndexBuffer(), IndexBuffer(), operator=(), and operator=().
| esengine::IndexBuffer::~IndexBuffer | ( | ) |
Definition at line 111 of file Buffer.cpp.
References esengine::Invalid.
|
delete |
References IndexBuffer().
|
noexcept |
Definition at line 117 of file Buffer.cpp.
References IndexBuffer(), and esengine::Invalid.
|
inlinestatic |
Creates an index buffer from a vector of 16-bit indices.
Definition at line 368 of file Buffer.hpp.
References create().
|
inlinestatic |
Creates an index buffer from a vector of 32-bit indices.
Definition at line 363 of file Buffer.hpp.
References create().
|
static |
Creates an index buffer with 16-bit indices from pointer.
Use 16-bit indices for better performance when vertex count is under 65536.
Definition at line 148 of file Buffer.cpp.
References esengine::GfxDevice::createBuffer(), esengine::Index, and esengine::makeUnique().
|
static |
Creates an index buffer with 32-bit indices from pointer.
Definition at line 138 of file Buffer.cpp.
References esengine::GfxDevice::createBuffer(), esengine::Index, and esengine::makeUnique().
|
inlinestatic |
Creates an index buffer from a span of 16-bit indices.
Definition at line 358 of file Buffer.hpp.
References create().
|
inlinestatic |
Creates an index buffer from a span of 32-bit indices.
Definition at line 353 of file Buffer.hpp.
References create().
Referenced by create(), create(), create(), create(), esengine::resource::ResourceManager::createIndexBuffer(), esengine::resource::ResourceManager::createIndexBuffer(), esengine::CustomGeometry::setIndices(), and esengine::CustomGeometry::setIndices().
|
inline |
Gets the number of indices.
Definition at line 387 of file Buffer.hpp.
|
inline |
Gets the device buffer handle.
Definition at line 390 of file Buffer.hpp.
|
inline |
Returns true if using 16-bit indices.
Definition at line 393 of file Buffer.hpp.
|
delete |
References IndexBuffer().
|
noexcept |
Definition at line 123 of file Buffer.cpp.
References IndexBuffer(), and esengine::Invalid.