]> git.tdb.fi Git - libs/gl.git/blobdiff - source/shader.h
Don't expose the shader type enum
[libs/gl.git] / source / shader.h
index c1fd6b2294a47c57c38b62ce9aa41241c19bc9c6..63af9b3ab74862c10fb417b68bdaa18786c8e9b9 100644 (file)
@@ -7,25 +7,19 @@
 namespace Msp {
 namespace GL {
 
-enum ShaderType
-{
-       FRAGMENT_SHADER = GL_FRAGMENT_SHADER_ARB,
-       VERTEX_SHADER   = GL_VERTEX_SHADER_ARB
-};
-
 class Shader
 {
 private:
        unsigned id;
        bool compiled;
 
-public:
-       Shader(ShaderType t);
-       Shader(ShaderType t, const std::string &);
+protected:
+       Shader(GLenum t);
+       Shader(GLenum t, const std::string &);
 private:
-       void init(ShaderType);
+       void init(GLenum);
 public:
-       ~Shader();
+       virtual ~Shader();
 
        void source(unsigned count, const char **str, const int *len);
        void source(const std::string &str);
@@ -36,6 +30,22 @@ public:
        std::string get_info_log() const;
 };
 
+
+class VertexShader: public Shader
+{
+public:
+       VertexShader();
+       VertexShader(const std::string &);
+};
+
+
+class FragmentShader: public Shader
+{
+public:
+       FragmentShader();
+       FragmentShader(const std::string &);
+};
+
 } // namespace GL
 } // namespace Msp