106 explicit operator bool()
const {
return isValid(); }
145 sh.state_ = std::make_shared<State>(handle, std::move(release));
154 bool isValid()
const {
return state_ && state_->handle.isValid(); }
155 explicit operator bool()
const {
return isValid(); }
167 if (handle.
isValid() && release) {
172 State(
const State&) =
delete;
173 State& operator=(
const State&) =
delete;
200 struct SpineSkeletonData;
260 return hash<esengine::u32>{}(handle.id());
Core type definitions and utilities for ESEngine.
The two halves of an image-based light, as the importer baked them.
GPU buffer for index data.
Buffers, the layout that describes them, and the bounds culling reads.
Irradiance at a grid of points — an Environment sampled, not held.
GPU shader program for rendering.
2D texture for GPU rendering
GPU buffer for vertex data, static or dynamic; all GPU work goes through the device.
Type-safe resource handle.
static constexpr u32 INDEX_BITS
static u32 extractIndex(IdType packed)
Extracts index from a raw packed ID.
Handle(IdType id)
Creates a handle from a packed ID (index + generation).
static Handle fromParts(u32 index, u32 generation)
Creates a handle from separate index and generation.
bool isValid() const
Checks if the handle references a valid resource.
bool operator==(const Handle &other) const
Equality comparison.
static constexpr IdType INVALID
bool operator!=(const Handle &other) const
Inequality comparison.
PackedId< 20, 12 > Layout
static constexpr u32 INDEX_MASK
static constexpr u32 GEN_MASK
static constexpr u32 GEN_BITS
Handle()=default
Creates an invalid handle.
static u32 extractGeneration(IdType packed)
Extracts generation from a raw packed ID.
RAII wrapper around Handle that auto-releases on destruction.
Handle< T > get() const
Gets the underlying raw handle (no ownership transfer).
std::function< void(Handle< T >)> ReleaseFunc
bool isValid() const
Checks if valid.
static SharedHandle make(Handle< T > handle, ReleaseFunc release)
Creates a SharedHandle that will auto-release.
void reset()
Manually release (all copies become invalid).
Handle< esengine::Shader > ShaderHandle
Handle to a shader resource.
Handle< esengine::text::BitmapFont > BitmapFontHandle
Handle to a bitmap font resource.
Handle< esengine::Environment > EnvironmentHandle
Handle to a baked environment (irradiance + prefiltered reflection).
SharedHandle< esengine::text::BitmapFont > SharedBitmapFontHandle
RAII handle to a bitmap font resource.
Handle< esengine::IndexBuffer > IndexBufferHandle
Handle to an index buffer resource.
Handle< esengine::VertexBuffer > VertexBufferHandle
Handle to a vertex buffer resource.
Handle< esengine::Texture > TextureHandle
Handle to a texture resource.
Handle< esengine::ProbeVolume > ProbeVolumeHandle
Handle to a grid of baked irradiance.
Handle< esengine::Mesh > MeshHandle
Handle to GPU-resident geometry.
Handle< esengine::spine::SpineSkeletonData > SpineDataHandle
Handle to a Spine skeleton data resource (vestigial — see fwd decl).
SharedHandle< esengine::Texture > SharedTextureHandle
RAII handle to a texture resource.
SharedHandle< esengine::Shader > SharedShaderHandle
RAII handle to a shader resource.
std::shared_ptr< T > Shared
Shared ownership smart pointer.
std::uint32_t u32
Unsigned 32-bit integer.
Index+generation packing into a u32, parameterized by the bit split.
static constexpr std::uint32_t generationOf(std::uint32_t raw)
static constexpr std::uint32_t INDEX_MASK
static constexpr std::uint32_t pack(std::uint32_t index, std::uint32_t generation)
static constexpr std::uint32_t INDEX_BITS
static constexpr std::uint32_t indexOf(std::uint32_t raw)
static constexpr std::uint32_t GEN_BITS
static constexpr std::uint32_t GEN_MASK
size_t operator()(const esengine::resource::Handle< T > &handle) const noexcept