X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fclipping.h;h=5600a38ba9d70f9ef4a96c89b315a22ea485f1f1;hb=2b2676392aff2eb6b38c3e463cc67f4d67a4ef8b;hp=319a8d98ff765a9cfb4e1c7b3fd57ba825b60b75;hpb=a77629d781eeb789870470c5ebdbd4b691e1b138;p=libs%2Fgl.git diff --git a/source/core/clipping.h b/source/core/clipping.h index 319a8d98..5600a38b 100644 --- a/source/core/clipping.h +++ b/source/core/clipping.h @@ -4,29 +4,40 @@ #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 &); + unsigned get_n_planes() const { return planes.size(); } + 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;