GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TextureLoader.hpp
Go to the documentation of this file.
1 #ifndef RADIX_TEXTURELOADER_HPP
2 #define RADIX_TEXTURELOADER_HPP
3 
4 #include <map>
5 #include <string>
6 
8 
9 namespace radix {
10 
12 public:
13  static Texture getEmptyTexture(const std::string &name,
14  const char *pixel = "\xFF\xFF\xFF");
15  static Texture getEmptyDiffuse();
16  static Texture getEmptyNormal();
17  static Texture getEmptySpecular();
18  static Texture getTexture(const std::string &path);
19 
20  static std::map<std::string, Texture>& getTextureCache() {
21  return textureCache;
22  }
23 private:
24  static Texture uploadTexture(const unsigned char *data, int width, int height);
25  static std::map<std::string, Texture> textureCache;
26 };
27 
28 } /* namespace radix */
29 
30 #endif /* RADIX_TEXTURELOADER_HPP */
Definition: GameController.hpp:7
Definition: TextureLoader.hpp:11
Definition: Texture.hpp:6
static Texture getEmptyTexture(const std::string &name, const char *pixel="\xFF\xFF\xFF")
Definition: TextureLoader.cpp:12
static Texture getEmptyNormal()
Definition: TextureLoader.cpp:29
static Texture uploadTexture(const unsigned char *data, int width, int height)
Definition: TextureLoader.cpp:57
static Texture getEmptySpecular()
Definition: TextureLoader.cpp:33
static Texture getEmptyDiffuse()
Definition: TextureLoader.cpp:25
static std::map< std::string, Texture > textureCache
Definition: TextureLoader.hpp:25
static Texture getTexture(const std::string &path)
Definition: TextureLoader.cpp:37
static std::map< std::string, Texture > & getTextureCache()
Definition: TextureLoader.hpp:20