12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef DEF_SHADER
- #define DEF_SHADER
- ///Jovian a ajouté Shader::bool chargerNouveauShader(std::string vertexSource, std::string fragmentSource);
- // Include Windows
- #ifdef WIN32
- #include <GL/glew.h>
- // Include Mac ou UNIX/Linux
- #else
- #define GL3_PROTOTYPES 1
- #include <GLES3/gl3.h>
- #endif
- // Includes communs
- #include <iostream>
- #include <string>
- #include <fstream>
- // Classe Shader
- class Shader
- {
- public:
- Shader();
- Shader(Shader const &shaderACopier);
- Shader(std::string vertexSource, std::string fragmentSource);
- ~Shader();
- Shader& operator=(Shader const &shaderACopier);
- bool charger();
- bool chargerNouveauShader(std::string vertexSource, std::string fragmentSource);
- bool compilerShader(GLuint &shader, GLenum type, std::string const &fichierSource);
- GLuint getProgramID() const;
- private:
- GLuint m_vertexID;
- GLuint m_fragmentID;
- GLuint m_programID;
- std::string m_vertexSource;
- std::string m_fragmentSource;
- };
- #endif
|