Hymn to Beauty
C++ 3D Engine
TextureAsset Class Reference

A texture used in a hymn. More...

#include <TextureAsset.hpp>

Public Member Functions

 TextureAsset (Video::LowLevelRenderer *lowLevelRenderer)
 Create new texture asset. More...
 
 TextureAsset (Video::LowLevelRenderer *lowLevelRenderer, const char *source, int sourceLength)
 Create new texture asset from a PNG image. More...
 
 TextureAsset (Video::LowLevelRenderer *lowLevelRenderer, const glm::uvec2 &size, const glm::vec4 &color)
 Create new uniform texture asset with a specified color value. More...
 
 ~TextureAsset ()
 Destructor. More...
 
void Save () const
 Save the texture asset. More...
 
void Load (const std::string &name)
 Load texture asset from disk. More...
 
Video::Texture2DGetTexture () const
 Get the texture. More...
 

Public Attributes

std::string name
 The name of the texture. More...
 
std::string path
 The folder containing the texture files. More...
 

Detailed Description

A texture used in a hymn.

Constructor & Destructor Documentation

◆ TextureAsset() [1/3]

TextureAsset::TextureAsset ( Video::LowLevelRenderer lowLevelRenderer)
explicit

Create new texture asset.

Parameters
lowLevelRendererThe low-level renderer to use.

◆ TextureAsset() [2/3]

TextureAsset::TextureAsset ( Video::LowLevelRenderer lowLevelRenderer,
const char *  source,
int  sourceLength 
)

Create new texture asset from a PNG image.

Parameters
lowLevelRendererThe low-level renderer to use.
sourceSource string containing the image file.
sourceLengthLength of the source string.

◆ TextureAsset() [3/3]

TextureAsset::TextureAsset ( Video::LowLevelRenderer lowLevelRenderer,
const glm::uvec2 &  size,
const glm::vec4 &  color 
)

Create new uniform texture asset with a specified color value.

Parameters
lowLevelRendererThe low-level renderer to use.
sizeThe size of the texture in pixels.
colorThe color value.

◆ ~TextureAsset()

TextureAsset::~TextureAsset ( )

Destructor.

Member Function Documentation

◆ GetTexture()

Texture2D * TextureAsset::GetTexture ( ) const

Get the texture.

Returns
The texture.

◆ Load()

void TextureAsset::Load ( const std::string &  name)

Load texture asset from disk.

Parameters
nameThe name of the texture asset.

◆ Save()

void TextureAsset::Save ( ) const

Save the texture asset.

Member Data Documentation

◆ name

std::string TextureAsset::name

The name of the texture.

◆ path

std::string TextureAsset::path

The folder containing the texture files.


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