Texture.h 521 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef TEXTURE_H
  2. #define TEXTURE_H
  3. #include <GL/glew.h>
  4. #include <GLFW/glfw3.h>
  5. #include <iostream>
  6. using namespace std;
  7. class Texture
  8. {
  9. public:
  10. Texture(const char* path);
  11. virtual ~Texture();
  12. void bind();
  13. bool isLoaded();
  14. private:
  15. bool load(const char* path);
  16. bool load(const char* path, FILE* file);
  17. void initGL();
  18. bool loaded = false;
  19. unsigned int width = 0;
  20. unsigned int height = 0;
  21. unsigned int* data = nullptr;
  22. GLuint texture = 0;
  23. };
  24. #endif