]> git.tdb.fi Git - libs/gl.git/blob - source/core/clipping.h
Change Clipping to use index-less attaching
[libs/gl.git] / source / core / clipping.h
1 #ifndef MSP_GL_CLIPPING_H_
2 #define MSP_GL_CLIPPING_H_
3
4 #include <vector>
5 #include <msp/core/attributes.h>
6 #include "bindable.h"
7
8 namespace Msp {
9 namespace GL {
10
11 class ClipPlane;
12 class Matrix;
13 class ProgramData;
14
15 class Clipping: public Bindable<Clipping>
16 {
17 private:
18         std::vector<const ClipPlane *> planes;
19
20 public:
21         static unsigned get_n_attach_points();
22
23         void attach(const ClipPlane &);
24         void detach(const ClipPlane &);
25
26         DEPRECATED void attach(unsigned, const ClipPlane &p) { attach(p); }
27         DEPRECATED void detach(unsigned);
28
29         void update_shader_data(ProgramData &, const Matrix &) const;
30
31         void bind() const;
32
33         static void unbind();
34 };
35
36 } // namespace GL
37 } // namespace Msp
38
39 #endif