Texture.h 531 B

123456789101112131415161718192021222324252627282930313233
  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. private:
  15. bool load(const char* path, FILE* file);
  16. void initGL();
  17. bool isLoaded = false;
  18. unsigned int width = 0;
  19. unsigned int height = 0;
  20. unsigned int* data = nullptr;
  21. static GLuint boundTexture;
  22. GLuint texture = 0;
  23. };
  24. #endif