X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fclipping.h;h=f682dc6459e6b0b1efbc9fab213dafa2c57a6b0e;hb=8e553af57b712051f47293c971671f4f6a939be2;hp=e42c28e6394b6c1c519afc26f182957b1f75be20;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/clipping.h b/source/core/clipping.h index e42c28e6..f682dc64 100644 --- a/source/core/clipping.h +++ b/source/core/clipping.h @@ -2,31 +2,34 @@ #define MSP_GL_CLIPPING_H_ #include -#include "bindable.h" +#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; -public: - static unsigned get_n_attach_points(); + AttachedPlane(const ClipPlane *p): plane(p), generation(0) { } + }; - void attach(unsigned, const ClipPlane &); - void detach(unsigned); + std::vector planes; + mutable ProgramData shdata; - void update_shader_data(ProgramData &, const Matrix &) const; +public: + void attach(const ClipPlane &); + void detach(const ClipPlane &); - void bind() const; + unsigned get_n_planes() const { return planes.size(); } - static void unbind(); + const ProgramData &get_shader_data() const; }; } // namespace GL