NWengine 0.9
Loading...
Searching...
No Matches
Texture Class Reference

Class representing a texture asset. More...

#include <Texture.h>

Inheritance diagram for Texture:
Asset

Public Member Functions

void Clean () override
 Cleans up the texture.
 
void Bind (uint32 slot=0)
 Binds the texture to a specified texture slot.
 
void _GPUGen (uint8 *data, TexChannelInfo channelInfo)
 Generates the texture on the GPU.
 
void GenMipMap ()
 Generates mipmaps for the texture.
 
void SetMinFilter (TexMinFilter minFilter)
 Sets the minification filter for the texture.
 
void SetMaxFilter (TexMaxFilter maxFilter)
 Sets the magnification filter for the texture.
 
void SetEdgesBehaviour (TexEdge edge)
 Sets the edge behavior for the texture.
 
AssetGetFromCache (void *identifier) override
 Gets the texture from the cache based on the identifier.
 
AssetLoadFromFile (const char *path, TextureIdentifierPtr identifier) override
 Loads the texture from a file.
 
AssetLoadFromBuffer (void *buffer, void *data) override
 Loads the texture from a buffer.
 
- Public Member Functions inherited from Asset
virtual AssetLoadFromFileOrGetFromCache (void *identifier, const char *path, void *data)
 Load the asset from file or get it from the cache based on the identifier and file path.
 
virtual AssetLoadFromBufferOrGetFromCache (void *identifier, void *buffer, void *data)
 Load the asset from a buffer or get it from the cache based on the identifier.
 

Public Attributes

uint32 _glID = 0
 
Vector2< int_size
 
bool _hasMipMap
 
- Public Attributes inherited from Asset
int _usageCounter = 0
 

Detailed Description

Class representing a texture asset.

Member Function Documentation

◆ _GPUGen()

void Texture::_GPUGen ( uint8 * data,
TexChannelInfo channelInfo )

Generates the texture on the GPU.

Parameters
dataThe texture data.
channelInfoThe channel information of the texture.

◆ Bind()

void Texture::Bind ( uint32 slot = 0)

Binds the texture to a specified texture slot.

Parameters
slotThe texture slot to bind the texture to.

◆ Clean()

void Texture::Clean ( )
overridevirtual

Cleans up the texture.

Reimplemented from Asset.

◆ GetFromCache()

Asset * Texture::GetFromCache ( void * identifier)
overridevirtual

Gets the texture from the cache based on the identifier.

Parameters
identifierThe identifier of the texture.
Returns
The loaded texture from the cache.

Reimplemented from Asset.

◆ LoadFromBuffer()

Asset * Texture::LoadFromBuffer ( void * buffer,
void * data )
overridevirtual

Loads the texture from a buffer.

Parameters
bufferThe buffer containing the texture data.
dataThe additional data for loading the texture.
Returns
The loaded texture.

Reimplemented from Asset.

◆ LoadFromFile()

Asset * Texture::LoadFromFile ( const char * path,
TextureIdentifierPtr identifier )
overridevirtual

Loads the texture from a file.

Parameters
pathThe path to the file.
identifierThe identifier of the texture.
Returns
The loaded texture.

Reimplemented from Asset.

◆ SetEdgesBehaviour()

void Texture::SetEdgesBehaviour ( TexEdge edge)

Sets the edge behavior for the texture.

Parameters
edgeThe edge behavior to set.

◆ SetMaxFilter()

void Texture::SetMaxFilter ( TexMaxFilter maxFilter)

Sets the magnification filter for the texture.

Parameters
maxFilterThe magnification filter to set.

◆ SetMinFilter()

void Texture::SetMinFilter ( TexMinFilter minFilter)

Sets the minification filter for the texture.

Parameters
minFilterThe minification filter to set.

Member Data Documentation

◆ _glID

uint32 Texture::_glID = 0

The OpenGL ID of the texture. Public for the framebuffer.

◆ _hasMipMap

bool Texture::_hasMipMap

Flag indicating whether the texture has mipmaps.

◆ _size

Vector2<int> Texture::_size

The size of the texture.


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