43 static unsigned int load(
const std::string &path,
bool flip =
true);
53 static void bind_id(GLenum target,
unsigned int id,
54 GLint wrapping = GL_REPEAT,
55 GLint filtering_min = GL_NEAREST,
56 GLint filtering_mag = GL_NEAREST,
57 GLboolean has_mipmap = GL_TRUE,
58 GLint mipmap_min = GL_LINEAR_MIPMAP_LINEAR,
59 GLint mipmap_mag = GL_LINEAR);
72 texture(
const std::string &path,
74 const std::string &type =
"texture_diffuse");
78 this->path = other.path;
79 this->type = other.type;
86 this->type = other.type;
87 this->path = other.path;
94 unsigned int get_id()
const;
96 void bind(GLenum target,
97 GLint wrapping = GL_REPEAT,
98 GLint filtering_min = GL_NEAREST,
99 GLint filtering_mag = GL_NEAREST,
100 GLboolean has_mpmap = GL_TRUE,
101 GLint mipmap_min = GL_LINEAR_MIPMAP_LINEAR,
102 GLint mipmap_mag = GL_LINEAR);
106 static void set_texture_wrapping(GLint wrapping);
107 static void set_texture_filtering(GLint filtering_min, GLint filtering_mag);
108 static void set_mipmap(GLboolean has_mipmap, GLint mipmap_min,
110 static void read_image(
const char *path,
bool flip);
static void active_texture(GLenum texture)
Activate a texture unit.
texture()
Empty constructor, does nothing.
static unsigned int load(const std::string &path, bool flip=true)
Load a texture from a file.
static void bind_id(GLenum target, unsigned int id, GLint wrapping=GL_REPEAT, GLint filtering_min=GL_NEAREST, GLint filtering_mag=GL_NEAREST, GLboolean has_mipmap=GL_TRUE, GLint mipmap_min=GL_LINEAR_MIPMAP_LINEAR, GLint mipmap_mag=GL_LINEAR)
Bind a texture.