]> git.tdb.fi Git - libs/gl.git/blobdiff - source/uniformblock.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / uniformblock.cpp
diff --git a/source/uniformblock.cpp b/source/uniformblock.cpp
deleted file mode 100644 (file)
index 350f57a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <stdexcept>
-#include "buffer.h"
-#include "color.h"
-#include "error.h"
-#include "matrix.h"
-#include "uniform.h"
-#include "uniformblock.h"
-#include "vector.h"
-
-using namespace std;
-
-namespace Msp {
-namespace GL {
-
-UniformBlock::UniformBlock():
-       buf_range(0)
-{ }
-
-UniformBlock::UniformBlock(unsigned s):
-       size(s),
-       data(size),
-       buf_range(0)
-{ }
-
-void UniformBlock::attach(int index, const Uniform &uni)
-{
-       uniforms[index] = &uni;
-}
-
-void UniformBlock::attach(const Program::UniformInfo &info, const Uniform &uni)
-{
-       uniforms[info.location] = &uni;
-       if(buffer)
-       {
-               uni.store(info, &data[info.location]);
-               dirty = true;
-       }
-}
-
-void UniformBlock::apply(int index) const
-{
-       if((index>=0) != (buffer!=0))
-               throw invalid_operation("UniformBlock::apply");
-
-       if(buffer)
-       {
-               if(dirty)
-               {
-                       update_buffer_data();
-                       if(!buf_range)
-                               buf_range = new BufferRange(*buffer, buffer_offset, size);
-               }
-               buf_range->bind_to(UNIFORM_BUFFER, index);
-       }
-       else
-       {
-               for(map<int, const Uniform *>::const_iterator i=uniforms.begin(); i!=uniforms.end(); ++i)
-                       i->second->apply(i->first);
-       }
-}
-
-} // namespace GL
-} // namespace Msp