NWengine 0.9
|
Class representing a texture asset. More...
#include <Texture.h>
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. | |
Asset * | GetFromCache (void *identifier) override |
Gets the texture from the cache based on the identifier. | |
Asset * | LoadFromFile (const char *path, TextureIdentifierPtr identifier) override |
Loads the texture from a file. | |
Asset * | LoadFromBuffer (void *buffer, void *data) override |
Loads the texture from a buffer. | |
Public Member Functions inherited from Asset | |
virtual Asset * | LoadFromFileOrGetFromCache (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 Asset * | LoadFromBufferOrGetFromCache (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 |
Class representing a texture asset.
void Texture::_GPUGen | ( | uint8 * | data, |
TexChannelInfo | channelInfo ) |
Generates the texture on the GPU.
data | The texture data. |
channelInfo | The channel information of the texture. |
void Texture::Bind | ( | uint32 | slot = 0 | ) |
Binds the texture to a specified texture slot.
slot | The texture slot to bind the texture to. |
Gets the texture from the cache based on the identifier.
identifier | The identifier of the texture. |
Reimplemented from Asset.
Loads the texture from a buffer.
buffer | The buffer containing the texture data. |
data | The additional data for loading the texture. |
Reimplemented from Asset.
|
overridevirtual |
Loads the texture from a file.
path | The path to the file. |
identifier | The identifier of the texture. |
Reimplemented from Asset.
void Texture::SetEdgesBehaviour | ( | TexEdge | edge | ) |
Sets the edge behavior for the texture.
edge | The edge behavior to set. |
void Texture::SetMaxFilter | ( | TexMaxFilter | maxFilter | ) |
Sets the magnification filter for the texture.
maxFilter | The magnification filter to set. |
void Texture::SetMinFilter | ( | TexMinFilter | minFilter | ) |
Sets the minification filter for the texture.
minFilter | The minification filter to set. |
uint32 Texture::_glID = 0 |
The OpenGL ID of the texture. Public for the framebuffer.
bool Texture::_hasMipMap |
Flag indicating whether the texture has mipmaps.