The TextureManager loads and handles textures.
More...
#include <sgct/texturemanager.h>
|
| unsigned int | loadTexture (const std::filesystem::path &filename, bool interpolate=true, float anisotropicFilterSize=1.f, int mipmapLevels=8) |
| | Loads a texture to the TextureManager.
|
| unsigned int | loadTexture (const Image &img, bool interpolate=true, float anisotropicFilterSize=1.f, int mipmapLevels=8) |
| | Loads a texture to the TextureManager.
|
| void | removeTexture (unsigned int textureId) |
| | Removes a previously generated OpenGL texture.
|
The TextureManager loads and handles textures.
It is a singleton and can be accessed anywhere using its static instance. Currently only PNG textures are supported.
◆ destroy()
| void sgct::TextureManager::destroy |
( |
| ) |
|
|
static |
◆ instance()
◆ loadTexture() [1/2]
| unsigned int sgct::TextureManager::loadTexture |
( |
const Image & | img, |
|
|
bool | interpolate = true, |
|
|
float | anisotropicFilterSize = 1.f, |
|
|
int | mipmapLevels = 8 ) |
Loads a texture to the TextureManager.
- Parameters
-
| img | The image with the texture data |
| interpolate | Set to true for using interpolation (bi-linear filtering) |
| anisotropicFilterSize | The filter size that is used for the anisotropic filtering. If this value is 1.f, only bilinear filtering is used |
| mipmapLevels | The number of mipmap levels that will be generated, setting this value to 1 or less disables mipmaps |
- Returns
- The OpenGL name for the texture that was loaded
◆ loadTexture() [2/2]
| unsigned int sgct::TextureManager::loadTexture |
( |
const std::filesystem::path & | filename, |
|
|
bool | interpolate = true, |
|
|
float | anisotropicFilterSize = 1.f, |
|
|
int | mipmapLevels = 8 ) |
Loads a texture to the TextureManager.
- Parameters
-
| filename | The path to the texture |
| interpolate | Set to true for using interpolation (bi-linear filtering) |
| anisotropicFilterSize | The filter size that is used for the anisotropic filtering. If this value is 1.f, only bilinear filtering is used |
| mipmapLevels | The number of mipmap levels that will be generated, setting this value to 1 or less disables mipmaps |
- Returns
- The OpenGL name for the texture that was loaded
◆ removeTexture()
| void sgct::TextureManager::removeTexture |
( |
unsigned int | textureId | ) |
|
Removes a previously generated OpenGL texture.
- Parameters
-
| textureId | The id of the texture that should be deleted, this has to be an id that was returned from a previous call to loadTexture |
The documentation for this class was generated from the following file: