12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef TEXTURE_H
- #define TEXTURE_H
- #include <GL/glew.h>
- #include <GLFW/glfw3.h>
- #include <iostream>
- #include "common/utils/Types.h"
- class Texture final
- {
- public:
- Texture(const char* path);
- ~Texture();
-
- Texture(const Texture& other) = delete;
- Texture(Texture&& other) = delete;
- Texture& operator=(const Texture& other) = delete;
- Texture& operator=(Texture&& other) = delete;
-
- void bind(unsigned int index) const;
-
- private:
- void load(const char* path);
- bool load(const char* path, FILE* file);
- void initGL();
-
- u32 width;
- u32 height;
- u32* data;
-
- GLuint texture = 0;
- };
- #endif
|