Texture.h 620 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef TEXTURE_H
  2. #define TEXTURE_H
  3. #include <GL/glew.h>
  4. #include <GLFW/glfw3.h>
  5. #include <iostream>
  6. #include "common/utils/Types.h"
  7. class Texture final {
  8. public:
  9. Texture(const char* path);
  10. ~Texture();
  11. Texture(const Texture& other) = delete;
  12. Texture(Texture&& other) = delete;
  13. Texture& operator=(const Texture& other) = delete;
  14. Texture& operator=(Texture&& other) = delete;
  15. void bind(uint index) const;
  16. private:
  17. void load(const char* path);
  18. bool load(const char* path, FILE* file);
  19. void initGL();
  20. u32 width;
  21. u32 height;
  22. u32* data;
  23. GLuint texture;
  24. };
  25. #endif