ifndef __TEXTURE_H__ define __TEXTURE_H__ include string include vecto

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef __TEXTURE_H__
#define __TEXTURE_H__
#include <string>
#include <vector>
#include <map>
#include <GL/glew.h>
#include "lodepng/lodepng.h"
class Texture {
private:
unsigned width, height;
int layer ;
std::string uniformName;
std::string path;
GLuint texture;
static std::map<std::string, std::pair<unsigned, GLuint>> textureCache;
public:
Texture(std::string path, int layer , std::string uniformName="");
~Texture();
void bindTexture();
void unbindTexture();
int getLayer();
void setLayer(int layer);
void setUniformName(std::string uniformName);
std::string getUniformName();
};
#endif