Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Assets::TextureHandle Class Reference

Type-erased texture handle for runtime storage. More...

#include <TextureHandle.h>

Public Member Functions

 TextureHandle ()=default
 Creates an invalid texture handle.
 TextureHandle (uint32_t id, TextureType type)
 Creates a texture handle from a registry ID and semantic type.
bool isValid () const
 Check if this handle points to a valid registry entry.
uint32_t getId () const
 Get the registry ID for this handle.
TextureType getType () const
 Get the texture type for this handle.
bool operator== (const TextureHandle &other) const
 Compares registry ID and texture type.
bool operator!= (const TextureHandle &other) const
 Returns true when registry ID or texture type differs.

Static Public Attributes

static constexpr uint32_t INVALID_ID = 0xFFFFFFFF
 Sentinel ID for an invalid handle.

Private Attributes

uint32_t id_ = INVALID_ID
TextureType type_ = TextureType::Unknown

Detailed Description

Type-erased texture handle for runtime storage.

This is the base handle class that can be stored in containers and used for runtime polymorphism. It contains both the registry ID and the texture type.

Definition at line 14 of file TextureHandle.h.

Constructor & Destructor Documentation

◆ TextureHandle() [1/2]

Engine::Assets::TextureHandle::TextureHandle ( )
default

Creates an invalid texture handle.

Referenced by operator!=(), and operator==().

Here is the caller graph for this function:

◆ TextureHandle() [2/2]

Engine::Assets::TextureHandle::TextureHandle ( uint32_t id,
TextureType type )
inline

Creates a texture handle from a registry ID and semantic type.

Parameters
idRegistry entry ID.
typeSemantic texture type.

Definition at line 28 of file TextureHandle.h.

References id_, and type_.

Member Function Documentation

◆ getId()

uint32_t Engine::Assets::TextureHandle::getId ( ) const
inlinenodiscard

Get the registry ID for this handle.

Definition at line 38 of file TextureHandle.h.

References id_.

◆ getType()

TextureType Engine::Assets::TextureHandle::getType ( ) const
inlinenodiscard

Get the texture type for this handle.

Definition at line 43 of file TextureHandle.h.

References type_.

Referenced by Engine::Assets::TypedTextureHandle< Type >::TypedTextureHandle().

Here is the caller graph for this function:

◆ isValid()

bool Engine::Assets::TextureHandle::isValid ( ) const
inlinenodiscard

Check if this handle points to a valid registry entry.

Definition at line 33 of file TextureHandle.h.

References id_, and INVALID_ID.

Referenced by Engine::Assets::TypedTextureHandle< Type >::TypedTextureHandle().

Here is the caller graph for this function:

◆ operator!=()

bool Engine::Assets::TextureHandle::operator!= ( const TextureHandle & other) const
inline

Returns true when registry ID or texture type differs.

Definition at line 55 of file TextureHandle.h.

References TextureHandle().

Here is the call graph for this function:

◆ operator==()

bool Engine::Assets::TextureHandle::operator== ( const TextureHandle & other) const
inline

Compares registry ID and texture type.

Definition at line 48 of file TextureHandle.h.

References id_, TextureHandle(), and type_.

Here is the call graph for this function:

Member Data Documentation

◆ id_

uint32_t Engine::Assets::TextureHandle::id_ = INVALID_ID
private

Definition at line 60 of file TextureHandle.h.

Referenced by getId(), isValid(), operator==(), and TextureHandle().

◆ INVALID_ID

uint32_t Engine::Assets::TextureHandle::INVALID_ID = 0xFFFFFFFF
staticconstexpr

Sentinel ID for an invalid handle.

Definition at line 16 of file TextureHandle.h.

Referenced by isValid().

◆ type_

TextureType Engine::Assets::TextureHandle::type_ = TextureType::Unknown
private

Definition at line 61 of file TextureHandle.h.

Referenced by getType(), operator==(), and TextureHandle().


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Texture/TextureHandle.h