|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Custom geometry for user-defined mesh rendering. More...
#include <CustomGeometry.hpp>
Public Member Functions | |
| CustomGeometry ()=default | |
| ~CustomGeometry ()=default | |
| CustomGeometry (const CustomGeometry &)=delete | |
| CustomGeometry & | operator= (const CustomGeometry &)=delete |
| CustomGeometry (CustomGeometry &&)=default | |
| CustomGeometry & | operator= (CustomGeometry &&)=default |
| void | init (GfxDevice &device, const f32 *vertices, u32 vertexCount, const VertexLayout &layout, bool dynamic=false) |
| Initializes geometry with vertex data and layout. | |
| void | setIndices (const u16 *indices, u32 indexCount) |
| Sets indices for indexed rendering. | |
| void | setIndices (const u32 *indices, u32 indexCount) |
| Sets indices for indexed rendering (32-bit). | |
| void | updateVertices (const f32 *vertices, u32 vertexCount, u32 offset=0) |
| Updates vertex data (only for dynamic geometry). | |
| void | bind (GfxDevice &device) const |
| Binds the geometry's buffers for the next draw. | |
| VertexLayoutHandle | layoutHandle () const |
| The device vertex layout a pipeline drawing this geometry must reference. | |
| const IndexBuffer * | indexBuffer () const |
| Gets the index buffer (null when non-indexed). | |
| u32 | getIndexCount () const |
| Gets the index count. | |
| u32 | getVertexCount () const |
| Gets the vertex count. | |
| u32 | getVertexStride () const |
| Byte stride of one vertex (0 before init) — boundary-validation source. | |
| bool | hasIndices () const |
| Checks if geometry uses indices. | |
| bool | isDynamic () const |
| Checks if geometry is dynamic. | |
| bool | isValid () const |
| Checks if geometry is initialized. | |
Custom geometry for user-defined mesh rendering.
Manages vertex buffer and index buffer with support for dynamic updates. Used for custom shapes, particles, trails, and other procedural geometry.
Definition at line 30 of file CustomGeometry.hpp.
|
default |
Referenced by CustomGeometry(), CustomGeometry(), operator=(), and operator=().
|
default |
|
delete |
References CustomGeometry().
|
default |
References CustomGeometry().
| void esengine::CustomGeometry::bind | ( | GfxDevice & | device | ) | const |
Binds the geometry's buffers for the next draw.
Definition at line 105 of file CustomGeometry.cpp.
References esengine::Invalid, isValid(), esengine::GfxDevice::setIndexBuffer(), and esengine::GfxDevice::setVertexBuffer().
Referenced by esengine::drawGeometry().
| u32 esengine::CustomGeometry::getIndexCount | ( | ) | const |
Gets the index count.
Definition at line 111 of file CustomGeometry.cpp.
Referenced by esengine::drawGeometry().
|
inline |
Gets the vertex count.
Definition at line 94 of file CustomGeometry.hpp.
Referenced by esengine::drawGeometry().
|
inline |
Byte stride of one vertex (0 before init) — boundary-validation source.
Definition at line 97 of file CustomGeometry.hpp.
| bool esengine::CustomGeometry::hasIndices | ( | ) | const |
Checks if geometry uses indices.
Definition at line 118 of file CustomGeometry.cpp.
Referenced by esengine::drawGeometry().
|
inline |
Gets the index buffer (null when non-indexed).
Definition at line 84 of file CustomGeometry.hpp.
Referenced by esengine::drawGeometry().
| void esengine::CustomGeometry::init | ( | GfxDevice & | device, |
| const f32 * | vertices, | ||
| u32 | vertexCount, | ||
| const VertexLayout & | layout, | ||
| bool | dynamic = false ) |
Initializes geometry with vertex data and layout.
| vertices | Pointer to vertex data |
| vertexCount | Number of floats in vertex data |
| layout | Vertex attribute layout |
| dynamic | If true, allows vertex updates |
Definition at line 40 of file CustomGeometry.cpp.
References esengine::VertexLayoutDesc::attributeCount, esengine::VertexLayoutDesc::attributes, esengine::GfxVertexAttribute::bufferSlot, esengine::GfxVertexAttribute::components, esengine::VertexBuffer::create(), esengine::VertexBuffer::createRaw(), esengine::GfxDevice::createVertexLayout(), ES_LOG_ERROR, esengine::VertexLayout::getAttributes(), esengine::VertexLayout::getStride(), esengine::GfxVertexAttribute::location, esengine::MAX_VERTEX_ATTRIBUTES, esengine::GfxVertexAttribute::normalized, esengine::GfxVertexAttribute::offset, esengine::GfxContent::retained(), esengine::shaderDataTypeComponentCount(), esengine::VertexLayoutDesc::strides, esengine::GfxVertexAttribute::type, and esengine::UByte4N.
|
inline |
Checks if geometry is dynamic.
Definition at line 107 of file CustomGeometry.hpp.
|
inline |
Checks if geometry is initialized.
Definition at line 112 of file CustomGeometry.hpp.
References esengine::Invalid.
Referenced by bind(), setIndices(), and setIndices().
|
inline |
The device vertex layout a pipeline drawing this geometry must reference.
Definition at line 79 of file CustomGeometry.hpp.
Referenced by esengine::applyMeshPipeline().
|
delete |
References CustomGeometry().
|
default |
References CustomGeometry().
Sets indices for indexed rendering.
| indices | Pointer to index data |
| indexCount | Number of indices |
Definition at line 80 of file CustomGeometry.cpp.
References esengine::IndexBuffer::create(), isValid(), and esengine::GfxContent::retained().
Sets indices for indexed rendering (32-bit).
| indices | Pointer to index data |
| indexCount | Number of indices |
Definition at line 85 of file CustomGeometry.cpp.
References esengine::IndexBuffer::create(), isValid(), and esengine::GfxContent::retained().
| void esengine::CustomGeometry::updateVertices | ( | const f32 * | vertices, |
| u32 | vertexCount, | ||
| u32 | offset = 0 ) |
Updates vertex data (only for dynamic geometry).
| vertices | Pointer to new vertex data |
| vertexCount | Number of floats |
| offset | Offset in floats from start |
Definition at line 90 of file CustomGeometry.cpp.
References ES_LOG_WARN.