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

Base class for asset wrappers. The data is stored in the private member variable 'data' in form of entt components. More...

#include <Asset.h>

Inheritance diagram for Asset::AssetBase:

Public Member Functions

 AssetBase (bool initializeDefaultEntity=false)
 Creates a base asset and optionally allocates its default ECS entity.
virtual ~AssetBase ()
 Releases base asset resources.
CpuLoadingState getLoadingState ()
 Gets the loading state of this asset.
void requestLoad ()
 If this asset is in the UNLOADED state it will get added to the assets to load.
virtual void unload ()
 Base function for unloading the ecs data.
entt::entity getEntity () const
 Getter for data.

Protected Member Functions

virtual void updateLoadingState ()
 Updates loadingState from derived asset data.

Protected Attributes

CpuLoadingState loadingState = UNLOADED
 Current CPU loading state.
entt::registry & mainRegistry
 Registry that owns this asset's ECS data.
entt::entity data
 Entity containing the asset's component data.

Detailed Description

Base class for asset wrappers. The data is stored in the private member variable 'data' in form of entt components.

Definition at line 296 of file Asset.h.

Constructor & Destructor Documentation

◆ AssetBase()

Asset::AssetBase::AssetBase ( bool initializeDefaultEntity = false)
inlineexplicit

Creates a base asset and optionally allocates its default ECS entity.

Parameters
initializeDefaultEntityTrue to start loading and create an entity immediately.

Definition at line 303 of file Asset.h.

References data, Asset::LOADING, loadingState, mainRegistry, and Asset::UNLOADED.

◆ ~AssetBase()

virtual Asset::AssetBase::~AssetBase ( )
virtual

Releases base asset resources.

Member Function Documentation

◆ getEntity()

entt::entity Asset::AssetBase::getEntity ( ) const

Getter for data.

Returns
data

◆ getLoadingState()

CpuLoadingState Asset::AssetBase::getLoadingState ( )
nodiscard

Gets the loading state of this asset.

Returns
Returns the state of loading of this asset

◆ requestLoad()

void Asset::AssetBase::requestLoad ( )

If this asset is in the UNLOADED state it will get added to the assets to load.

◆ unload()

virtual void Asset::AssetBase::unload ( )
virtual

Base function for unloading the ecs data.

Reimplemented in Engine::Assets::Audio, Engine::Assets::Material, Engine::Assets::Mesh, and Engine::Assets::Texture.

◆ updateLoadingState()

virtual void Asset::AssetBase::updateLoadingState ( )
inlineprotectedvirtual

Updates loadingState from derived asset data.

Reimplemented in Engine::Assets::Audio, Engine::Assets::Material, Engine::Assets::Mesh, and Engine::Assets::Texture.

Definition at line 341 of file Asset.h.

Member Data Documentation

◆ data

entt::entity Asset::AssetBase::data
protected

Entity containing the asset's component data.

Definition at line 347 of file Asset.h.

Referenced by AssetBase(), and Engine::Assets::Material::getData().

◆ loadingState

CpuLoadingState Asset::AssetBase::loadingState = UNLOADED
protected

Current CPU loading state.

Definition at line 344 of file Asset.h.

Referenced by AssetBase().

◆ mainRegistry

entt::registry& Asset::AssetBase::mainRegistry
protected

Registry that owns this asset's ECS data.

Definition at line 346 of file Asset.h.

Referenced by AssetBase(), and Engine::Assets::Material::getData().


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