X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fshader.cpp;h=d1938ba702fd0c629133e7e588ffebc816fa6d92;hb=8dd40d3723cb2309ffcca5e041898a767cd7cdea;hp=17bf3fad3196ad08b735669bda32f72bf2212a92;hpb=e3561c5c4d0b2caf00a0e50ce85c11a9fb62aa72;p=libs%2Fgl.git diff --git a/source/shader.cpp b/source/shader.cpp index 17bf3fad..d1938ba7 100644 --- a/source/shader.cpp +++ b/source/shader.cpp @@ -1,7 +1,8 @@ #include +#include #include #include -#include +#include #include "error.h" #include "misc.h" #include "shader.h" @@ -26,6 +27,7 @@ Shader::Shader(GLenum t, const string &src) void Shader::init(GLenum t) { + static Require _req_base(ARB_shader_objects); compiled = false; if(t==GL_FRAGMENT_SHADER) @@ -33,7 +35,7 @@ void Shader::init(GLenum t) else if(t==GL_VERTEX_SHADER) static Require _req(ARB_vertex_shader); else if(t==GL_GEOMETRY_SHADER) - static Require _req(EXT_geometry_shader4); + static Require _req(ARB_geometry_shader4); id = glCreateShader(t); } @@ -64,6 +66,12 @@ void Shader::compile() compiled = get_shader_i(id, GL_COMPILE_STATUS); if(!compiled) throw compile_error(get_info_log()); + +#ifdef DEBUG + string info_log = get_info_log(); + if(!info_log.empty()) + IO::print("Shader compile info log:\n%s", info_log); +#endif } string Shader::get_info_log() const