#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);
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)