Texture.h 805 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef DEF_TEXTURE
  2. #define DEF_TEXTURE
  3. // Include
  4. #ifdef WIN32
  5. #include <glew.h>
  6. #elif __APPLE__
  7. #define GL3_PROTOTYPES 1
  8. #include <OpenGL/gl3.h>
  9. #include <SDL2_image/SDL_image.h>
  10. #else
  11. #define GL3_PROTOTYPES 1
  12. #include <GLES3/gl3.h>
  13. #include <SDL2/SDL_image.h>
  14. #endif
  15. #include <SDL2/SDL.h>
  16. #include <iostream>
  17. #include <string>
  18. // Classe Textures
  19. class Texture
  20. {
  21. public:
  22. Texture();
  23. Texture(Texture const &textureACopier);
  24. Texture(std::string fichierImage);
  25. ~Texture();
  26. Texture& operator=(Texture const &textureACopier);
  27. bool charger();
  28. SDL_Surface* inverserPixels(SDL_Surface *imageSource) const;
  29. GLuint getID() const;
  30. void setFichierImage(const std::string &fichierImage);
  31. private:
  32. GLuint m_id;
  33. std::string m_fichierImage;
  34. };
  35. #endif