Texture Manager class provides APIs to load, retrieve, check, and release textures within the engine.
More...
#include <TextureManager/CTextureManager.h>
|
|
| CTextureManager () |
| | Constructor.
|
|
virtual | ~CTextureManager () |
| | Destructor. Releases all resources.
|
| void | setCurrentPackage (const char *name) |
| | Set the current texture package name.
|
| const char * | getCurrentPackage () |
| | Get the current texture package name.
|
|
void | removeAllTexture () |
| | Remove all loaded textures.
|
| void | removeTexture (const char *namePackage) |
| | Remove all textures in a specific package.
|
| void | removeTexture (ITexture *tex) |
| | Remove a specific texture resource.
|
| const char * | getTexturePath (ITexture *tex) |
| | Get the file path of a texture.
|
| bool | existTexture (const char *path) |
| | Check if a texture exists by path.
|
| bool | resolveTexturePath (const char *path, std::string &result) |
| | Finds the actual, existing file path for a texture, resolving the correct file extension.
|
| bool | isTextureLoaded (const char *path) |
| | Check if a texture is already loaded.
|
| ITexture * | getTexture (const char *path) |
| | Load and get a texture by path.
|
| ITexture * | getTexture (const char *filename, const std::vector< std::string > &folders) |
| | Load and get a texture from a set of folders.
|
| ITexture * | getTextureFromRealPath (const char *path) |
| | Get texture using the real file path.
|
| ITexture * | getCubeTexture (const char *pathX1, const char *pathX2, const char *pathY1, const char *pathY2, const char *pathZ1, const char *pathZ2) |
| | Load a cube map texture from 6 image paths.
|
| ITexture * | getTextureArray (std::vector< std::string > &listTexture) |
| | Load a texture array from a list of texture paths.
|
| ITexture * | getNullNormalMap () |
| | Get the default null normal map texture.
|
| ITexture * | getNullTexture () |
| | Get the default null texture.
|
| ITexture * | createTransformTexture2D (const char *name, core::matrix4 *transforms, int w, int h) |
| | Create a 2D texture from a list of transformation matrices.
|
| ITexture * | createVectorTexture2D (const char *name, core::vector3df *vectors, int w, int h) |
| | Create a 2D texture from a list of vector3df values.
|
|
| static const char * | getGlobalName () |
| | Get the global package name.
|
| static std::vector< std::string > | getTextureExts () |
| | Get supported texture file extensions.
|
| static bool | isTextureExt (const char *ext) |
| | Check if a file extension is a supported texture format.
|
|
|
std::string | m_currentPackage |
| | Current package used for loading textures.
|
|
std::vector< STexturePackage * > | m_textureList |
| | List of loaded texture packages.
|
|
std::vector< std::string > | m_listCommonTexture |
| | List of common textures.
|
|
ITexture * | m_nullNormalMap |
| | Default null normal map texture.
|
|
ITexture * | m_nullTexture |
| | Default null texture.
|
Texture Manager class provides APIs to load, retrieve, check, and release textures within the engine.
Example usage:
ITexture *texture = CTextureManager::getInstance()->getTexture(
"BuiltIn/Textures/Skylicht.png");
Interface of a Video Driver dependent Texture.
Definition ITexture.h:119
◆ createTransformTexture2D()
| ITexture * Skylicht::CTextureManager::createTransformTexture2D |
( |
const char * | name, |
|
|
core::matrix4 * | transforms, |
|
|
int | w, |
|
|
int | h ) |
Create a 2D texture from a list of transformation matrices.
- Parameters
-
| name | Texture name. |
| transforms | Array of transformation matrices. |
| w | Width of matrix array. |
| h | Height of matrix array. |
- Returns
- Pointer to created texture.
◆ createVectorTexture2D()
| ITexture * Skylicht::CTextureManager::createVectorTexture2D |
( |
const char * | name, |
|
|
core::vector3df * | vectors, |
|
|
int | w, |
|
|
int | h ) |
Create a 2D texture from a list of vector3df values.
- Parameters
-
| name | Texture name. |
| vectors | Array of vector3df values. |
| w | Width of vector array. |
| h | Height of vector array. |
- Returns
- Pointer to created texture.
◆ existTexture()
| bool Skylicht::CTextureManager::existTexture |
( |
const char * | path | ) |
|
Check if a texture exists by path.
- Parameters
-
- Returns
- True if exists, false otherwise.
◆ getCubeTexture()
| ITexture * Skylicht::CTextureManager::getCubeTexture |
( |
const char * | pathX1, |
|
|
const char * | pathX2, |
|
|
const char * | pathY1, |
|
|
const char * | pathY2, |
|
|
const char * | pathZ1, |
|
|
const char * | pathZ2 ) |
Load a cube map texture from 6 image paths.
- Parameters
-
| pathX1 | Path for +X face. |
| pathX2 | Path for -X face. |
| pathY1 | Path for +Y face. |
| pathY2 | Path for -Y face. |
| pathZ1 | Path for +Z face. |
| pathZ2 | Path for -Z face. |
- Returns
- Pointer to cube map texture.
◆ getCurrentPackage()
| const char * Skylicht::CTextureManager::getCurrentPackage |
( |
| ) |
|
|
inline |
Get the current texture package name.
- Returns
- Current package name string.
◆ getGlobalName()
| const char * Skylicht::CTextureManager::getGlobalName |
( |
| ) |
|
|
static |
Get the global package name.
- Returns
- Global package name as a string.
◆ getNullNormalMap()
| ITexture * Skylicht::CTextureManager::getNullNormalMap |
( |
| ) |
|
|
inline |
Get the default null normal map texture.
- Returns
- Pointer to null normal map.
◆ getNullTexture()
| ITexture * Skylicht::CTextureManager::getNullTexture |
( |
| ) |
|
|
inline |
Get the default null texture.
- Returns
- Pointer to null texture.
◆ getTexture() [1/2]
| ITexture * Skylicht::CTextureManager::getTexture |
( |
const char * | filename, |
|
|
const std::vector< std::string > & | folders ) |
Load and get a texture from a set of folders.
- Parameters
-
| filename | Texture filename. |
| folders | List of folders to search for the texture. |
- Returns
- Pointer to loaded texture.
◆ getTexture() [2/2]
| ITexture * Skylicht::CTextureManager::getTexture |
( |
const char * | path | ) |
|
Load and get a texture by path.
- Parameters
-
- Returns
- Pointer to loaded texture.
◆ getTextureArray()
| ITexture * Skylicht::CTextureManager::getTextureArray |
( |
std::vector< std::string > & | listTexture | ) |
|
Load a texture array from a list of texture paths.
- Parameters
-
| listTexture | List of texture file paths. |
- Returns
- Pointer to texture array resource.
◆ getTextureExts()
| std::vector< std::string > Skylicht::CTextureManager::getTextureExts |
( |
| ) |
|
|
static |
Get supported texture file extensions.
- Returns
- Vector of supported extensions (e.g. png, jpg, bmp...).
◆ getTextureFromRealPath()
| ITexture * Skylicht::CTextureManager::getTextureFromRealPath |
( |
const char * | path | ) |
|
Get texture using the real file path.
- Parameters
-
- Returns
- Pointer to loaded texture.
◆ getTexturePath()
| const char * Skylicht::CTextureManager::getTexturePath |
( |
ITexture * | tex | ) |
|
Get the file path of a texture.
- Parameters
-
- Returns
- File path string of the texture.
◆ isTextureExt()
| bool Skylicht::CTextureManager::isTextureExt |
( |
const char * | ext | ) |
|
|
static |
Check if a file extension is a supported texture format.
- Parameters
-
| ext | File extension to check. |
- Returns
- True if supported, false otherwise.
◆ isTextureLoaded()
| bool Skylicht::CTextureManager::isTextureLoaded |
( |
const char * | path | ) |
|
Check if a texture is already loaded.
- Parameters
-
- Returns
- True if loaded, false otherwise.
◆ registerTexture()
| void Skylicht::CTextureManager::registerTexture |
( |
ITexture * | tex, |
|
|
const char * | path ) |
|
protected |
Register a texture with the manager.
- Parameters
-
| tex | Pointer to texture. |
| path | File path of the texture. |
◆ removeTexture() [1/2]
| void Skylicht::CTextureManager::removeTexture |
( |
const char * | namePackage | ) |
|
Remove all textures in a specific package.
- Parameters
-
| namePackage | Name of the texture package. |
◆ removeTexture() [2/2]
| void Skylicht::CTextureManager::removeTexture |
( |
ITexture * | tex | ) |
|
Remove a specific texture resource.
- Parameters
-
| tex | Pointer to the texture to remove. |
◆ resolveTexturePath()
| bool Skylicht::CTextureManager::resolveTexturePath |
( |
const char * | path, |
|
|
std::string & | result ) |
Finds the actual, existing file path for a texture, resolving the correct file extension.
- Parameters
-
| path | Logical path to search for. |
| result | Output string for the real path found. |
- Returns
- True if found, false otherwise.
◆ setCurrentPackage()
| void Skylicht::CTextureManager::setCurrentPackage |
( |
const char * | name | ) |
|
|
inline |
Set the current texture package name.
- Parameters
-
The documentation for this class was generated from the following file: