]> git.tdb.fi Git - libs/gl.git/blob - source/core/tests.cpp
Redesign depth and stencil test and blend state management
[libs/gl.git] / source / core / tests.cpp
1 #include "tests.h"
2
3 namespace Msp {
4 namespace GL {
5
6 ScissorTest::ScissorTest():
7         left(0),
8         bottom(0),
9         width(1),
10         height(1)
11 { }
12
13 ScissorTest::ScissorTest(int l, int b, unsigned w, unsigned h):
14         left(l),
15         bottom(b),
16         width(w),
17         height(h)
18 { }
19
20 void ScissorTest::bind() const
21 {
22         if(set_current(this))
23         {
24                 glEnable(GL_SCISSOR_TEST);
25                 glScissor(left, bottom, width, height);
26         }
27 }
28
29 void ScissorTest::unbind()
30 {
31         if(set_current(0))
32                 glDisable(GL_SCISSOR_TEST);
33 }
34
35 } // namespace GL
36 } // namespace Msp