Texture.h 550 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef TEXTURE_H
  2. #define TEXTURE_H
  3. #include <GL/glew.h>
  4. #include <GLFW/glfw3.h>
  5. #include <iostream>
  6. class Texture
  7. {
  8. public:
  9. Texture();
  10. Texture(const Texture& orig);
  11. virtual ~Texture();
  12. bool load(const char* path);
  13. void bind();
  14. bool isLoaded();
  15. private:
  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. static GLuint boundTexture;
  23. GLuint texture = 0;
  24. };
  25. #endif