]> git.tdb.fi Git - libs/gl.git/blob - source/tests.h
Avoid some brain damage from Windows headers
[libs/gl.git] / source / tests.h
1 #ifndef MSP_GL_TESTS_H_
2 #define MSP_GL_TESTS_H_
3
4 #include "bindable.h"
5 #include "gl.h"
6 #include "predicate.h"
7
8 namespace Msp {
9 namespace GL {
10
11 /**
12 Tests incoming fragment depth values against the depth buffer.  If the test
13 fails, the fragment is discarded.
14 */
15 class DepthTest: public Bindable<DepthTest>
16 {
17 private:
18         bool write;
19         Predicate pred;
20
21 public:
22         DepthTest();
23         DepthTest(Predicate, bool = true);
24
25         void bind() const;
26
27         static const DepthTest &lequal();
28         static void unbind();
29 };
30
31
32 /**
33 Tests fragment coordinates against a rectangle.  Any fragments outside the
34 rectangle are discarded.
35 */
36 class ScissorTest: public Bindable<ScissorTest>
37 {
38 private:
39         int left;
40         int bottom;
41         unsigned width;
42         unsigned height;
43
44 public:
45         ScissorTest();
46         ScissorTest(int, int, unsigned, unsigned);
47
48         void bind() const;
49
50         static void unbind();
51 };
52
53 } // namespace GL
54 } // namespace Msp
55
56 #endif