-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtexture.h
More file actions
36 lines (22 loc) · 813 Bytes
/
Copy pathtexture.h
File metadata and controls
36 lines (22 loc) · 813 Bytes
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
#ifndef TEXTURE_H
#define TEXTURE_H
#include <string>
#include <glad/glad.h>
struct Texture {
struct Properties {
int width;
int height;
int colour_format;
Properties() { this->width = 0; this->height = 0; this->colour_format = GL_RGBA; }
~Properties() = default;
} properties;
unsigned char* data;
GLuint ID;
GLuint* uniformID;
const char* uniform_name;
Texture() : data(nullptr), ID(NULL), uniformID(NULL), uniform_name(nullptr) { uniformID = new GLuint[4]; }
~Texture() { data = nullptr; uniform_name = nullptr; delete data; delete uniform_name; delete[] uniformID; }
};
void createTexture(Texture* texture, const char* filepath, const char* uniform_name);
void loadTexture(Texture* texture, const GLuint* programs, GLuint location_binding);
#endif // !TEXTURE_CONTAINER_H