|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
#include <VertexLayout.hpp>
Static Public Member Functions | |
| static const VertexLayoutDesc * | Get (VertexFormatHandle handle) |
| static VertexFormatHandle | Register (const VertexLayoutDesc &desc) |
| static void | Shutdown () |
| Clears the registry; call only during application teardown. | |
Global registry of custom vertex layouts. Register returns a stable handle.
This is how a game teaches the renderer about its own geometry. Call Register() once per layout during startup, keep the returned VertexFormatHandle, and pass it to MeshBatch::CreateMesh(). The handle travels on the resulting MeshHandle, and the backend uses it to pick the pipeline for every pass the format participates in.
Handles are stable for the lifetime of the process and start at 1; handle 0 is reserved for the engine's built-in vertex layout. Register() does not validate the descriptor. A zero stride or an empty attribute list is caught later, at pipeline creation.
Register once and reuse the handle. Registering the same descriptor repeatedly creates a new handle and a new set of pipelines each time. Shutdown() is for application teardown only, and pointers returned by Get() stay valid until it runs.
Definition at line 139 of file VertexLayout.hpp.
|
static |
Returns nullptr for handle 0 or an unknown handle. The returned pointer stays valid until Shutdown(), which is intended for application teardown only.
Definition at line 19 of file VertexLayout.cpp.
|
static |
Definition at line 13 of file VertexLayout.cpp.
|
static |
Clears the registry; call only during application teardown.
Definition at line 27 of file VertexLayout.cpp.