]> git.tdb.fi Git - libs/gl.git/blobdiff - source/clipplane.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / clipplane.cpp
diff --git a/source/clipplane.cpp b/source/clipplane.cpp
deleted file mode 100644 (file)
index e0b425a..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <msp/gl/extensions/msp_legacy_features.h>
-#include <msp/strings/format.h>
-#include "clipplane.h"
-#include "clipunit.h"
-#include "gl.h"
-#include "matrix.h"
-#include "misc.h"
-#include "programdata.h"
-
-namespace Msp {
-namespace GL {
-
-ClipPlane::ClipPlane():
-       eq(0, 0, 0, 1)
-{ }
-
-ClipPlane::ClipPlane(const Vector4 &e):
-       eq(e)
-{ }
-
-ClipPlane::ClipPlane(const Vector3 &p, const Vector3 &d):
-       eq(compose(d, -dot(p, d)))
-{ }
-
-void ClipPlane::update(unsigned index) const
-{
-       double deq[4];
-       for(unsigned i=0; i<4; ++i)
-               deq[i] = eq[i];
-       glClipPlane(GL_CLIP_PLANE0+index, deq);
-}
-
-void ClipPlane::set_equation(const Vector4 &e)
-{
-       eq = e;
-       if(ClipUnit *unit = ClipUnit::find_unit(this))
-               update(unit->get_index());
-}
-
-void ClipPlane::set_plane(const Vector3 &p, const Vector3 &d)
-{
-       Vector3 nd = normalize(d);
-       set_equation(compose(nd, -dot(p, nd)));
-}
-
-void ClipPlane::update_shader_data(ProgramData &shdata, const Matrix &view_inverse, unsigned i) const
-{
-       shdata.uniform(format("clip_planes[%d].equation", i), eq*view_inverse);
-}
-
-void ClipPlane::bind_to(unsigned i) const
-{
-       Require _req(MSP_legacy_features);
-
-       ClipUnit &unit = ClipUnit::get_unit(i);
-       if(unit.set_plane(this))
-       {
-               enable(GL_CLIP_PLANE0+unit.get_index());
-               update(unit.get_index());
-       }
-}
-
-void ClipPlane::unbind_from(unsigned i)
-{
-       ClipUnit &unit = ClipUnit::get_unit(i);
-       if(unit.set_plane(0))
-               disable(GL_CLIP_PLANE0+unit.get_index());
-}
-
-} // namespace GL
-} // namespace Msp