]> git.tdb.fi Git - libs/gl.git/blobdiff - source/clipunit.h
Restore user clip planes in a form compatible with modern OpenGL
[libs/gl.git] / source / clipunit.h
diff --git a/source/clipunit.h b/source/clipunit.h
new file mode 100644 (file)
index 0000000..b4af967
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef MSP_GL_CLIPUNIT_H_
+#define MSP_GL_CLIPUNIT_H_
+
+#include <vector>
+
+namespace Msp {
+namespace GL {
+
+class ClipPlane;
+
+class ClipUnit
+{
+private:
+       unsigned index;
+       const ClipPlane *plane;
+
+       static std::vector<ClipUnit> units;
+
+       ClipUnit();
+
+public:
+       unsigned get_index() const { return index; }
+       bool set_plane(const ClipPlane *);
+       const ClipPlane *get_plane() const { return plane; } 
+
+       static unsigned get_n_units();
+       static ClipUnit &get_unit(unsigned);
+       static ClipUnit *find_unit(const ClipPlane *);
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif