7 typedef struct Texture {
11 const char *textureName;
13 std::weak_ptr<Zen::Image> image;
15 Texture(
const char *textureName, std::weak_ptr<Zen::Image> image) {
16 this->textureName = textureName;
18 this->width = image.lock()->width;
19 this->height = image.lock()->height;
21 glGenTextures(1, &this->
id);
22 glBindTexture(GL_TEXTURE_2D, this->
id);
23 glTexImage2D(GL_TEXTURE_2D,
33 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
34 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
35 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY, 1.0f);
37 glBindTexture(GL_TEXTURE_2D, 0);