X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fclipping.h;h=6496aed0ed866c778fa1d93dbbc2a6edb23eeb8a;hb=b466adff89db080c304ac3178ce1f4fef844cb28;hp=e42c28e6394b6c1c519afc26f182957b1f75be20;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/clipping.h b/source/core/clipping.h index e42c28e6..6496aed0 100644 --- a/source/core/clipping.h +++ b/source/core/clipping.h @@ -2,31 +2,40 @@ #define MSP_GL_CLIPPING_H_ #include -#include "bindable.h" +#include +#include "programdata.h" namespace Msp { namespace GL { class ClipPlane; -class Matrix; -class ProgramData; -class Clipping: public Bindable +class Clipping { 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(unsigned, const ClipPlane &); - void detach(unsigned); + void attach(const ClipPlane &); + void detach(const ClipPlane &); - void update_shader_data(ProgramData &, const Matrix &) const; + unsigned get_n_planes() const { return planes.size(); } - void bind() const; + DEPRECATED void attach(unsigned, const ClipPlane &p) { attach(p); } + DEPRECATED void detach(unsigned); - static void unbind(); + const ProgramData &get_shader_data() const; }; } // namespace GL