X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fshader.cpp;h=a1c576d8b3384c87fe31ff0e677e95224f21e44b;hb=619aae12e01f25e79626a94c973927e5599e99a5;hp=b0cf5a3ec63d3f6ed93c4727b955f5a187232ad3;hpb=6afbace895a7bbcf216ab8e48280ea0303ab5892;p=libs%2Fgl.git diff --git a/source/shader.cpp b/source/shader.cpp index b0cf5a3e..a1c576d8 100644 --- a/source/shader.cpp +++ b/source/shader.cpp @@ -1,6 +1,6 @@ -#include "arb_fragment_shader.h" -#include "arb_shader_objects.h" -#include "arb_vertex_shader.h" +#include +#include +#include #include "error.h" #include "shader.h" @@ -9,12 +9,12 @@ using namespace std; namespace Msp { namespace GL { -Shader::Shader(ShaderType t) +Shader::Shader(GLenum t) { init(t); } -Shader::Shader(ShaderType t, const string &src) +Shader::Shader(GLenum t, const string &src) { init(t); @@ -22,13 +22,13 @@ Shader::Shader(ShaderType t, const string &src) compile(); } -void Shader::init(ShaderType t) +void Shader::init(GLenum t) { compiled = false; - if(t==FRAGMENT_SHADER) + if(t==GL_FRAGMENT_SHADER) static Require _req(ARB_fragment_shader); - else if(t==VERTEX_SHADER) + else if(t==GL_VERTEX_SHADER) static Require _req(ARB_vertex_shader); id = glCreateShader(t); @@ -74,5 +74,23 @@ string Shader::get_info_log() const return log; } + +VertexShader::VertexShader(): + Shader(GL_VERTEX_SHADER) +{ } + +VertexShader::VertexShader(const string &src): + Shader(GL_VERTEX_SHADER, src) +{ } + + +FragmentShader::FragmentShader(): + Shader(GL_FRAGMENT_SHADER) +{ } + +FragmentShader::FragmentShader(const string &src): + Shader(GL_FRAGMENT_SHADER, src) +{ } + } // namespace GL } // namespace Msp