Texture manager. Handles texture creation, storage, and deletion.
More...
#include <texManager.h>
|
|
| TextureManager (const TextureManager &)=delete |
| |
|
TextureManager & | operator= (const TextureManager &)=delete |
| |
| TextureHandle | createTextureByImage (const char *filename, bool flipped) |
| |
| CubeMapHandle | createCubeMapByImage (const std::vector< CubemapFaces > cubemapFaces, std::string cubeMapName) |
| |
| GLuint | createTextureInGpu (std::string name, int xOffset, int yOffset, GLenum format=GL_RGBA, GLenum type=GL_UNSIGNED_BYTE, int level=0) |
| |
| GLuint | createTextureInGpu (TexturePtr const &, int xOffset=0, int yOffset=0, GLenum format=GL_RGBA, GLenum type=GL_UNSIGNED_BYTE, int level=0) |
| |
| void | createCubeMapInGpu (CubeMapPtr const &) |
| |
| void | removeTextureInGpu (std::string name, bool isCubeMap) |
| |
| void | removeTextureInGpu (TexturePtr const &) |
| |
| void | freeTextureInCpu (const TextureHandle &handle) |
| |
| void | freeTextureInCpu (const std::string &name) |
| |
| void | freeTextureInCpu (const TexturePtr &tpr) |
| |
| void | freeCubeMapInCpu (const std::string &name) |
| |
| void | freeCubeMapInCpu (const CubeMapHandle &handle) |
| |
| void | freeCubeMapInCpu (const CubeMapPtr &cpr) |
| |
|
void | freeAllDataInCpu () |
| | Free all texture memory stored on the CPU.
|
| |
| TexturePtr | getTexturePtr (TextureHandle h) |
| |
| TexturePtr | getTexturePtrByName (std::string name) |
| |
| CubeMapPtr | getCubeMapPtr (CubeMapHandle h) |
| |
| CubeMapPtr | getCubeMapPtrByName (std::string name) |
| |
| bool | isloaded (std::string path) |
| |
| TextureHandle | getTexturePtrByPath (std::string path) |
| |
Texture manager. Handles texture creation, storage, and deletion.
◆ createCubeMapByImage()
| CubeMapHandle TextureManager::createCubeMapByImage |
( |
const std::vector< CubemapFaces > | cubemapFaces, |
|
|
std::string | cubeMapName ) |
Create a cubemap, given 6 images for its faces
- Parameters
-
| cubemapFaces | The faces for the cubemap |
| cubeMapName | The name to identify the cubemap with |
- Returns
- Handle to the newly created cubemap
◆ createCubeMapInGpu()
| void TextureManager::createCubeMapInGpu |
( |
CubeMapPtr const & | cubeMap | ) |
|
Create cubemap texture in GPU using CPU data Texture identified by its pointer
- Parameters
-
◆ createTextureByImage()
| TextureHandle TextureManager::createTextureByImage |
( |
const char * | filename, |
|
|
bool | flipped ) |
Load texture from disk to memory
- Parameters
-
| filename | The path to the texture on disk |
| flipped | True if the texture should be vertically flipped |
◆ createTextureInGpu() [1/2]
Create texture in GPU using CPU data Texture fetched from a map using its name as identifier
- Parameters
-
| name | Name to identify the texture with |
| xOffset | Offset along the x direction to use when setting data in the GPU buffer |
| yOffset | Offset along the y direction to use when setting data in the GPU buffer |
| format | OpenGL format for the GPU texture |
| type | OpenGL type for the GPU texture |
| level | The level in the mip hierarchy to initilise with the texture data |
- Returns
- The OpenGL handle to the texture buffer
◆ createTextureInGpu() [2/2]
Create texture in GPU using CPU data Texture identified by its pointer
- Parameters
-
| tex | Texture pointer |
| xOffset | Offset along the x direction to use when setting data in the GPU buffer |
| yOffset | Offset along the y direction to use when setting data in the GPU buffer |
| format | OpenGL format for the GPU texture |
| type | OpenGL type for the GPU texture |
| level | The level in the mip hierarchy to initilise with the texture data |
- Returns
- The OpenGL handle to the texture buffer
◆ freeCubeMapInCpu() [1/3]
| void TextureManager::freeCubeMapInCpu |
( |
const CubeMapHandle & | handle | ) |
|
Free cube map memory on the CPU. Texture identified by handle
- Parameters
-
| handle | Handle to the texture |
◆ freeCubeMapInCpu() [2/3]
| void TextureManager::freeCubeMapInCpu |
( |
const CubeMapPtr & | cpr | ) |
|
Free cube map data memory on the CPU. Texture identified by pointer
- Parameters
-
◆ freeCubeMapInCpu() [3/3]
| void TextureManager::freeCubeMapInCpu |
( |
const std::string & | name | ) |
|
Free cube map memory on the CPU. Texture identified by name
- Parameters
-
◆ freeTextureInCpu() [1/3]
| void TextureManager::freeTextureInCpu |
( |
const std::string & | name | ) |
|
Free the image data memory on the CPU. Texture identified by name
- Parameters
-
◆ freeTextureInCpu() [2/3]
| void TextureManager::freeTextureInCpu |
( |
const TextureHandle & | handle | ) |
|
Free the image data memory on the CPU. Texture identified by handle
- Parameters
-
| handle | Handle to the texture |
◆ freeTextureInCpu() [3/3]
| void TextureManager::freeTextureInCpu |
( |
const TexturePtr & | tpr | ) |
|
Free the image data memory on the CPU. Texture identified by pointer
- Parameters
-
◆ getCubeMapPtr()
| CubeMapPtr TextureManager::getCubeMapPtr |
( |
CubeMapHandle | h | ) |
|
Get cube map pointer, given its handle.
- Parameters
-
| h | Handle to the cube map texture |
- Returns
- Pointer to the cube map texture
◆ getCubeMapPtrByName()
| CubeMapPtr TextureManager::getCubeMapPtrByName |
( |
std::string | name | ) |
|
Get cube map pointer, given its name.
- Parameters
-
| name | Name of the cube map texture |
- Returns
- Pointer to the cube map texture
◆ getTexturePtr()
| TexturePtr TextureManager::getTexturePtr |
( |
TextureHandle | h | ) |
|
Get texture pointer, given its handle.
- Parameters
-
- Returns
- Pointer to the texture
◆ getTexturePtrByName()
| TexturePtr TextureManager::getTexturePtrByName |
( |
std::string | name | ) |
|
Get texture pointer, given its name.
- Parameters
-
- Returns
- Pointer to the texture
◆ getTexturePtrByPath()
| TextureHandle Aire::TextureManager::getTexturePtrByPath |
( |
std::string | path | ) |
|
Get texture handle, given its path on disk.
- Parameters
-
| path | Path of the texture on disk |
- Returns
- Handle to the texture
◆ isloaded()
| bool Aire::TextureManager::isloaded |
( |
std::string | path | ) |
|
Check if the texture has been loaded from disk
- Parameters
-
| path | The path to the texture on disk |
- Returns
- True if the texture has been loaded and False otherwise
◆ removeTextureInGpu() [1/2]
| void TextureManager::removeTextureInGpu |
( |
std::string | name, |
|
|
bool | isCubeMap ) |
Remove a texture from GPU. Texture identified by name.
- Parameters
-
| name | Name to identify the texture to be removed |
| isCubeMap | True if the texture to remove is a cubemap |
◆ removeTextureInGpu() [2/2]
| void TextureManager::removeTextureInGpu |
( |
TexturePtr const & | tex | ) |
|
Remove a texture from GPU. Texture identified by pointer.
- Parameters
-
The documentation for this class was generated from the following files:
- source/res-management/texManager.h
- source/res-management/texManager.cpp