V-ART
texture.h
Go to the documentation of this file.
1 
5 #ifndef VART_TEXTURE_H
6 #define VART_TEXTURE_H
7 
8 #include <string>
9 
10 #ifdef WIN32
11 #include <windows.h>
12 #endif
13 
14 #ifdef VART_OGL
15 #include <GL/gl.h>
16 #endif
17 
18 #ifdef IL_LIB
19 #include <IL/il.h>
20 #endif
21 
22 namespace VART {
48  class Texture {
49  public:
50 
55  Texture();
56 
58  Texture(const std::string& fileName);
59 
61  Texture(const Texture& texture);
62 
64  Texture& operator=(const Texture& texture);
65 
69 
73 
77  bool LoadFromFile(const std::string& fileName);
78 
85  bool HasTextureLoad() const;
86 
92  bool HasData() const { return hasTexture; };
93 
97  virtual ~Texture();
98 
103  bool DrawOGL() const;
104 
105  private:
108  static void WhiteTexture();
109 
111  static unsigned int whiteTextureId;
112 
114  static bool hasWhiteTexture;
115 
117  bool hasTexture;
118 
120  unsigned int textureId;
121 
122 // /// \brief Reference count to a texture
123 // unsigned int refCount;
124 
131  static bool notInitalized;
132 
136  static void Initialize();
137 
138  }; // end class declaration
139 } // end namespace
140 
141 #endif
bool HasData() const
Indicates if a texture object contains data.
Definition: texture.h:92
bool DrawOGL() const
Sets the texture to draw with the next object.
Definition: texture.cpp:134
2D image to use as texture.
Definition: texture.h:48
Texture & operator=(const Texture &texture)
Copies texture data.
Definition: texture.cpp:43
Texture()
Creates an unitialized texture.
Definition: texture.cpp:17
virtual ~Texture()
Destructor class.
Definition: texture.cpp:123
bool HasTextureLoad() const
Indicates if a texture has been loaded previously.
Definition: texture.cpp:38
bool LoadFromFile(const std::string &fileName)
Loads a texture from a file.
Definition: texture.cpp:50