]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/clipping.h
Store implementation limits in a central struct
[libs/gl.git] / source / core / clipping.h
index e42c28e6394b6c1c519afc26f182957b1f75be20..b07195231423ca139a174af18c202c80153f6602 100644 (file)
@@ -2,27 +2,40 @@
 #define MSP_GL_CLIPPING_H_
 
 #include <vector>
+#include <msp/core/attributes.h>
 #include "bindable.h"
+#include "programdata.h"
 
 namespace Msp {
 namespace GL {
 
 class ClipPlane;
 class Matrix;
-class ProgramData;
 
 class Clipping: public Bindable<Clipping>
 {
 private:
-       std::vector<const ClipPlane *> planes;
+       struct AttachedPlane
+       {
+               const ClipPlane *plane;
+               mutable unsigned generation;
+
+               AttachedPlane(const ClipPlane *p): plane(p), generation(0) { }
+       };
+
+       std::vector<AttachedPlane> planes;
+       mutable ProgramData shdata;
 
 public:
-       static unsigned get_n_attach_points();
+       DEPRECATED static unsigned get_n_attach_points();
+
+       void attach(const ClipPlane &);
+       void detach(const ClipPlane &);
 
-       void attach(unsigned, const ClipPlane &);
-       void detach(unsigned);
+       DEPRECATED void attach(unsigned, const ClipPlane &p) { attach(p); }
+       DEPRECATED void detach(unsigned);
 
-       void update_shader_data(ProgramData &, const Matrix &) const;
+       const ProgramData &get_shader_data() const;
 
        void bind() const;