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