123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef DEF_SHADER
- #define DEF_SHADER
- // Include Windows
- #ifdef WIN32
- #include <GL/glew.h>
- // Include Mac
- #elif __APPLE__
- #define GL3_PROTOTYPES 1
- #include <OpenGL/gl3.h>
- // Include 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 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
|