]> git.tdb.fi Git - libs/gl.git/blob - source/core/clipping.h
Add support for integer vertex attributes
[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 "programdata.h"
7
8 namespace Msp {
9 namespace GL {
10
11 class ClipPlane;
12
13 class Clipping
14 {
15 private:
16         struct AttachedPlane
17         {
18                 const ClipPlane *plane;
19                 mutable unsigned generation;
20
21                 AttachedPlane(const ClipPlane *p): plane(p), generation(0) { }
22         };
23
24         std::vector<AttachedPlane> planes;
25         mutable ProgramData shdata;
26
27 public:
28         DEPRECATED static unsigned get_n_attach_points();
29
30         void attach(const ClipPlane &);
31         void detach(const ClipPlane &);
32
33         unsigned get_n_planes() const { return planes.size(); }
34
35         DEPRECATED void attach(unsigned, const ClipPlane &p) { attach(p); }
36         DEPRECATED void detach(unsigned);
37
38         const ProgramData &get_shader_data() const;
39 };
40
41 } // namespace GL
42 } // namespace Msp
43
44 #endif