]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/clipping.cpp
Wrap Limits into a DeviceInfo struct
[libs/gl.git] / source / core / clipping.cpp
index e7ad643bdbbd0dadcb908f78f63cf2f0c237528a..30d1f7c2db7dfeff09701f422baf9af2cc02526e 100644 (file)
@@ -3,23 +3,17 @@
 #include "clipplane.h"
 #include "deviceinfo.h"
 #include "error.h"
-#include "matrix.h"
 
 using namespace std;
 
 namespace Msp {
 namespace GL {
 
-unsigned Clipping::get_n_attach_points()
-{
-       return Limits::get_global().max_clip_planes;
-}
-
 void Clipping::attach(const ClipPlane &p)
 {
        if(find_member(planes, &p, &AttachedPlane::plane)!=planes.end())
                return;
-       if(planes.size()>=Limits::get_global().max_clip_planes)
+       if(planes.size()>=DeviceInfo::get_global().limits.max_clip_planes)
                throw invalid_operation("Clipping::attach");
 
        planes.push_back(&p);
@@ -27,17 +21,11 @@ void Clipping::attach(const ClipPlane &p)
 
 void Clipping::detach(const ClipPlane &p)
 {
-       vector<AttachedPlane>::iterator i = find_member(planes, &p, &AttachedPlane::plane);
+       auto i = find_member(planes, &p, &AttachedPlane::plane);
        if(i!=planes.end())
                planes.erase(i);
 }
 
-void Clipping::detach(unsigned i)
-{
-       if(i<planes.size())
-               detach(*planes[i].plane);
-}
-
 const ProgramData &Clipping::get_shader_data() const
 {
        for(unsigned i=0; i<planes.size(); ++i)