1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #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
|