]> git.tdb.fi Git - libs/gl.git/blob - source/clip.cpp
96f5bd413bd1bc203decc2e35a35140122e88e7a
[libs/gl.git] / source / clip.cpp
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2008  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include "clip.h"
9 #include "gl.h"
10
11 namespace Msp {
12 namespace GL {
13
14 ClipPlane::ClipPlane(double a, double b, double c, double d)
15 {
16         eq[0] = a;
17         eq[1] = b;
18         eq[2] = c;
19         eq[3] = d;
20 }
21
22 void ClipPlane::apply_to(unsigned n)
23 {
24         glClipPlane(GL_CLIP_PLANE0+n, eq);
25         glEnable(GL_CLIP_PLANE0+n);
26 }
27
28 void ClipPlane::disable(unsigned n)
29 {
30         glDisable(GL_CLIP_PLANE0+n);
31 }
32
33 } // namespace GL
34 } // namespace Msp