Texture.h 532 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(const char* path);
  10. virtual ~Texture();
  11. void bind();
  12. bool isLoaded();
  13. private:
  14. bool load(const char* path);
  15. bool load(const char* path, FILE* file);
  16. void initGL();
  17. bool loaded = 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