moGL
travis-test-3
Modern OpenGL wrapper, thin C++14 header-only layer on top of the OpenGL 4.5+ core spec
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 #ifndef MOGL_SHADER_INCLUDED 00012 #define MOGL_SHADER_INCLUDED 00013 00014 #include <string> 00015 00016 #include <mogl/object/handle.hpp> 00017 00018 namespace mogl 00019 { 00020 class Shader : public Handle<GLuint> 00021 { 00022 public: 00023 Shader(GLenum type); 00024 ~Shader(); 00025 00026 Shader(const Shader& other) = delete; 00027 Shader& operator=(const Shader& other) = delete; 00028 00029 public: 00030 bool compile(const std::string& source); 00031 bool compile(std::istream& sourceFile); 00032 const std::string getSource() const; 00033 GLenum getType() const; 00034 const std::string getLog() const; 00035 void get(GLenum property, GLint* value) const; // Direct call to glGetShaderiv() 00036 GLint get(GLenum property) const; 00037 bool isCompiled() const; 00038 bool isHandleValid() const override final; 00039 00040 private: 00041 const GLenum _type; 00042 }; 00043 } 00044 00045 #include "shader.inl" 00046 00047 #endif // MOGL_SHADER_INCLUDED