]> git.tdb.fi Git - libs/gl.git/blob - source/core/depthtest.cpp
Redesign depth and stencil test and blend state management
[libs/gl.git] / source / core / depthtest.cpp
1 #include "depthtest.h"
2
3 using namespace std;
4
5 namespace Msp {
6 namespace GL {
7
8 DepthTest::DepthTest():
9         enabled(false),
10         compare(LESS),
11         write(true)
12 { }
13
14 DepthTest::DepthTest(Predicate c, bool w):
15         enabled(true),
16         compare(c),
17         write(w)
18 { }
19
20
21 DepthTest::Loader::Loader(DepthTest &dt):
22         ObjectLoader<DepthTest>(dt)
23 {
24         add("compare", &Loader::compare);
25         add("write", &DepthTest::write);
26 }
27
28 void DepthTest::Loader::compare(Predicate c)
29 {
30         obj.enabled = true;
31         obj.compare = c;
32 }
33
34 } // namespace GL
35 } // namespace Msp