Shader.h 998 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef DEF_SHADER
  2. #define DEF_SHADER
  3. ///Jovian a ajouté Shader::bool chargerNouveauShader(std::string vertexSource, std::string fragmentSource);
  4. // Include Windows
  5. #ifdef WIN32
  6. #include <GL/glew.h>
  7. // Include Mac ou UNIX/Linux
  8. #else
  9. #define GL3_PROTOTYPES 1
  10. #include <GL/gl.h>
  11. #endif
  12. // Includes communs
  13. #include <iostream>
  14. #include <string>
  15. #include <fstream>
  16. // Classe Shader
  17. class Shader
  18. {
  19. public:
  20. Shader();
  21. Shader(Shader const &shaderACopier);
  22. Shader(std::string vertexSource, std::string fragmentSource);
  23. ~Shader();
  24. Shader& operator=(Shader const &shaderACopier);
  25. bool charger();
  26. bool chargerNouveauShader(std::string vertexSource, std::string fragmentSource);
  27. bool compilerShader(GLuint &shader, GLenum type, std::string const &fichierSource);
  28. GLuint getProgramID() const;
  29. private:
  30. GLuint m_vertexID;
  31. GLuint m_fragmentID;
  32. GLuint m_programID;
  33. std::string m_vertexSource;
  34. std::string m_fragmentSource;
  35. };
  36. #endif