My Project
Loading...
Searching...
No Matches
TextureAsset Class Reference

Asset representing a texture that can be used in the DirectX rendering pipeline. Handles CPU/GPU resources, including shader resource view and underlying texture resource. More...

#include <TextureAsset.hpp>

Inheritance diagram for TextureAsset:
Asset

Public Member Functions

void Load () override
 Loads the texture from the file associated with this asset.
void Unload () override
 Releases CPU and GPU resources associated with this texture.
void CreateBuffers (ID3D11Device *device) override
 Creates GPU resources for the texture (SRV and underlying resource).
void Bind (ID3D11DeviceContext *context) const override
 Binds the texture to the graphics pipeline.
bool IsReady () const
 Checks if the texture is ready to be used (SRV created and valid).
ID3D11ShaderResourceView * GetSRV () const
 Returns the Shader Resource View of the texture.
UINT GetWidth () const
 Returns the width of the texture in pixels.
UINT GetHeight () const
 Returns the height of the texture in pixels.
Public Member Functions inherited from Asset
virtual ~Asset ()=default
 Virtual destructor.

Additional Inherited Members

Public Attributes inherited from Asset
AssetID id
 Unique identifier of the asset.
std::string path
 File path of the source asset.

Detailed Description

Asset representing a texture that can be used in the DirectX rendering pipeline. Handles CPU/GPU resources, including shader resource view and underlying texture resource.

Member Function Documentation

◆ Bind()

void TextureAsset::Bind ( ID3D11DeviceContext * context) const
overridevirtual

Binds the texture to the graphics pipeline.

Parameters
contextDevice context used for rendering

Reimplemented from Asset.

◆ CreateBuffers()

void TextureAsset::CreateBuffers ( ID3D11Device * device)
overridevirtual

Creates GPU resources for the texture (SRV and underlying resource).

Parameters
deviceD3D11 device used for creating GPU resources

Reimplemented from Asset.

◆ GetHeight()

UINT TextureAsset::GetHeight ( ) const

Returns the height of the texture in pixels.

Returns
Texture height

◆ GetSRV()

ID3D11ShaderResourceView * TextureAsset::GetSRV ( ) const

Returns the Shader Resource View of the texture.

Returns
ID3D11ShaderResourceView pointer

◆ GetWidth()

UINT TextureAsset::GetWidth ( ) const

Returns the width of the texture in pixels.

Returns
Texture width

◆ IsReady()

bool TextureAsset::IsReady ( ) const

Checks if the texture is ready to be used (SRV created and valid).

Returns
True if ready

◆ Load()

void TextureAsset::Load ( )
overridevirtual

Loads the texture from the file associated with this asset.

Implements Asset.

◆ Unload()

void TextureAsset::Unload ( )
overridevirtual

Releases CPU and GPU resources associated with this texture.

Implements Asset.


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