]> git.tdb.fi Git - libs/gl.git/blobdiff - source/shader.cpp
Restructure ProgramData to support sharing between Programs
[libs/gl.git] / source / shader.cpp
index c7a08bfac5e0b71f5371cf841506b21c463e845f..cdb50c969d59edaf2dfc7edc044579192632eed7 100644 (file)
@@ -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