X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fclipping.h;h=d74763ab7c697f9cade4e94ab4b15bdb518e0a10;hb=a275d25eccad43716c5dcf91f8bc4af2a53c0445;hp=e42c28e6394b6c1c519afc26f182957b1f75be20;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/clipping.h b/source/core/clipping.h index e42c28e6..d74763ab 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(); - void attach(unsigned, const ClipPlane &); - void detach(unsigned); + void attach(const ClipPlane &); + void detach(const ClipPlane &); + + 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;