X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fclipping.h;h=d74763ab7c697f9cade4e94ab4b15bdb518e0a10;hp=319a8d98ff765a9cfb4e1c7b3fd57ba825b60b75;hb=a275d25eccad43716c5dcf91f8bc4af2a53c0445;hpb=a77629d781eeb789870470c5ebdbd4b691e1b138 diff --git a/source/core/clipping.h b/source/core/clipping.h index 319a8d98..d74763ab 100644 --- a/source/core/clipping.h +++ b/source/core/clipping.h @@ -4,18 +4,27 @@ #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(); @@ -26,7 +35,7 @@ public: 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;