X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fshader.cpp;h=cdb50c969d59edaf2dfc7edc044579192632eed7;hb=e4638ccfdcdb58f81740fe707ec93b1be3208d2c;hp=c7a08bfac5e0b71f5371cf841506b21c463e845f;hpb=953f041e904e97c4435e0229b8d88eabe31e5c3d;p=libs%2Fgl.git diff --git a/source/shader.cpp b/source/shader.cpp index c7a08bfa..cdb50c96 100644 --- a/source/shader.cpp +++ b/source/shader.cpp @@ -1,12 +1,5 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include "arb_shader_objects.h" -#include "except.h" +#include "error.h" #include "extension.h" #include "shader.h" @@ -66,16 +59,18 @@ void Shader::compile() int value = 0; glGetObjectParameterivARB(id, GL_OBJECT_COMPILE_STATUS_ARB, &value); if(!(compiled = value)) - throw CompileError(get_info_log()); + throw compile_error(get_info_log()); } string Shader::get_info_log() const { GLsizei len = 0; glGetObjectParameterivARB(id, GL_OBJECT_INFO_LOG_LENGTH_ARB, &len); - char log[len+1]; - glGetInfoLogARB(id, len+1, &len, log); - return string(log, len); + char *buf = new char[len+1]; + glGetInfoLogARB(id, len+1, &len, buf); + string log(buf, len); + delete[] buf; + return log; } } // namespace GL