SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
texturemanager.h
Go to the documentation of this file.
1/*****************************************************************************************
2 * SGCT *
3 * Simple Graphics Cluster Toolkit *
4 * *
5 * Copyright (c) 2012-2026 *
6 * For conditions of distribution and use, see copyright notice in LICENSE.md *
7 ****************************************************************************************/
8
9#ifndef __SGCT__TEXTUREMANAGER__H__
10#define __SGCT__TEXTUREMANAGER__H__
11
12#include <sgct/sgctexports.h>
13
14#include <filesystem>
15#include <vector>
16
17namespace sgct {
18
19class Image;
20
25class SGCT_EXPORT TextureManager {
26public:
28 static void destroy();
29
41 unsigned int loadTexture(const std::filesystem::path& filename,
42 bool interpolate = true, float anisotropicFilterSize = 1.f, int mipmapLevels = 8);
43
55 unsigned int loadTexture(const Image& img, bool interpolate = true,
56 float anisotropicFilterSize = 1.f, int mipmapLevels = 8);
57
64 void removeTexture(unsigned int textureId);
65
66private:
68 static TextureManager* _instance;
69 std::vector<unsigned int> _textures;
70};
71
72} // namespace sgct
73
74#endif // __SGCT__TEXTUREMANAGER__H__
Definition image.h:19
The TextureManager loads and handles textures.
Definition texturemanager.h:25
static void destroy()
static TextureManager & instance()
void removeTexture(unsigned int textureId)
Removes a previously generated OpenGL texture.
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.
Definition actions.h:16