]> git.tdb.fi Git - libs/gl.git/blobdiff - source/shader.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / shader.cpp
diff --git a/source/shader.cpp b/source/shader.cpp
deleted file mode 100644 (file)
index c7a08bf..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* $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 "extension.h"
-#include "shader.h"
-
-using namespace std;
-
-namespace Msp {
-namespace GL {
-
-Shader::Shader(ShaderType t)
-{
-       init(t);
-}
-
-Shader::Shader(ShaderType t, const string &src)
-{
-       init(t);
-
-       source(src);
-       compile();
-}
-
-void Shader::init(ShaderType t)
-{
-       compiled = false;
-
-       if(t==FRAGMENT_SHADER)
-               static RequireExtension _ext("GL_ARB_fragment_shader");
-       else if(t==VERTEX_SHADER)
-               static RequireExtension _ext("GL_ARB_vertex_shader");
-
-       id = glCreateShaderObjectARB(t);
-}
-
-Shader::~Shader()
-{
-       glDeleteObjectARB(id);
-}
-
-void Shader::source(unsigned count, const char **str, const int *len)
-{
-       glShaderSourceARB(id, count, str, len);
-}
-
-void Shader::source(const string &str)
-{
-       source(str.data(), str.size());
-}
-
-void Shader::source(const char *str, int len)
-{
-       source(1, &str, &len);
-}
-
-void Shader::compile()
-{
-       glCompileShaderARB(id);
-       int value = 0;
-       glGetObjectParameterivARB(id, GL_OBJECT_COMPILE_STATUS_ARB, &value);
-       if(!(compiled = value))
-               throw CompileError(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);
-}
-
-} // namespace GL
-} // namespace Msp