Texture.h 652 B

12345678910111213141516171819202122232425262728293031323334353637
  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. {
  9. public:
  10. Texture(const char* path);
  11. ~Texture();
  12. Texture(const Texture& other) = delete;
  13. Texture(Texture&& other) = delete;
  14. Texture& operator=(const Texture& other) = delete;
  15. Texture& operator=(Texture&& other) = delete;
  16. void bind(unsigned int index) const;
  17. private:
  18. void load(const char* path);
  19. bool load(const char* path, FILE* file);
  20. void initGL();
  21. u32 width;
  22. u32 height;
  23. u32* data;
  24. GLuint texture;
  25. };
  26. #endif