ComputerGraphik TU WIEN
texture.hpp
Go to the documentation of this file.
1 #ifndef TEXTURE_HPP
2 #define TEXTURE_HPP
3 
4 #include <string>
5 #include <vector>
6 
7 #include <GL/glew.h>
8 
10 class Texture {
11 public:
12  Texture(const std::string& filename, bool readalpha = false);
13  ~Texture();
14 
15  GLuint getHandle() const { return handle; }
16 
17  static void loadBMP(const std::string& filename, std::vector<unsigned char>& data, size_t& width, size_t& height, size_t& bitPerPixel, bool readalpha = false);
18 
19 private:
20  GLuint handle;
21 };
22 
23 #endif //TEXTURE_HPP
Texture(const std::string &filename, bool readalpha=false)
Definition: texture.cpp:7
~Texture()
Definition: texture.cpp:29
GLuint getHandle() const
Definition: texture.hpp:15
GLuint handle
Definition: texture.hpp:20
static void loadBMP(const std::string &filename, std::vector< unsigned char > &data, size_t &width, size_t &height, size_t &bitPerPixel, bool readalpha=false)
Definition: texture.cpp:34
Encapsulates a texture in the GPU.
Definition: texture.hpp:10