X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fclipping.h;h=b07195231423ca139a174af18c202c80153f6602;hp=e42c28e6394b6c1c519afc26f182957b1f75be20;hb=2d3113a7dbbe4be2f1d1e8980c1c4e42175163da;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266 diff --git a/source/core/clipping.h b/source/core/clipping.h index e42c28e6..b0719523 100644 --- a/source/core/clipping.h +++ b/source/core/clipping.h @@ -2,27 +2,40 @@ #define MSP_GL_CLIPPING_H_ #include +#include #include "bindable.h" +#include "programdata.h" namespace Msp { namespace GL { class ClipPlane; class Matrix; -class ProgramData; class Clipping: public Bindable { private: - std::vector planes; + struct AttachedPlane + { + const ClipPlane *plane; + mutable unsigned generation; + + AttachedPlane(const ClipPlane *p): plane(p), generation(0) { } + }; + + std::vector 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;