My Project
Loading...
Searching...
No Matches
Asset Class Referenceabstract

Base class for all assets in the engine. Defines the interface for loading, unloading, creating GPU resources, and binding the asset to the graphics pipeline. More...

#include <Asset.hpp>

Inheritance diagram for Asset:
MeshAsset TextureAsset

Public Member Functions

virtual void Load ()=0
 Loads the asset data into CPU memory. Must be implemented by derived asset classes.
virtual void Unload ()=0
 Frees CPU and GPU resources if applicable. Must be implemented by derived asset classes.
virtual void CreateBuffers (ID3D11Device *device)
 Creates GPU resources for the asset (e.g., vertex/index buffers, textures). Can be overridden if the asset needs GPU-side resources.
virtual void Bind (ID3D11DeviceContext *context) const
 Binds the asset to the graphics pipeline if applicable (for example, textures or meshes).
virtual ~Asset ()=default
 Virtual destructor.

Public Attributes

AssetID id
 Unique identifier of the asset.
std::string path
 File path of the source asset.

Detailed Description

Base class for all assets in the engine. Defines the interface for loading, unloading, creating GPU resources, and binding the asset to the graphics pipeline.

Constructor & Destructor Documentation

◆ ~Asset()

virtual Asset::~Asset ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ Bind()

virtual void Asset::Bind ( ID3D11DeviceContext * context) const
inlinevirtual

Binds the asset to the graphics pipeline if applicable (for example, textures or meshes).

Parameters
contextDevice context used for rendering

Reimplemented in MeshAsset, and TextureAsset.

◆ CreateBuffers()

virtual void Asset::CreateBuffers ( ID3D11Device * device)
inlinevirtual

Creates GPU resources for the asset (e.g., vertex/index buffers, textures). Can be overridden if the asset needs GPU-side resources.

Parameters
deviceD3D11 device used to create GPU resources

Reimplemented in MeshAsset, and TextureAsset.

◆ Load()

virtual void Asset::Load ( )
pure virtual

Loads the asset data into CPU memory. Must be implemented by derived asset classes.

Implemented in MeshAsset, and TextureAsset.

◆ Unload()

virtual void Asset::Unload ( )
pure virtual

Frees CPU and GPU resources if applicable. Must be implemented by derived asset classes.

Implemented in MeshAsset, and TextureAsset.

Member Data Documentation

◆ id

AssetID Asset::id

Unique identifier of the asset.

◆ path

std::string Asset::path

File path of the source asset.


The documentation for this class was generated from the following file: