3 This file is part of libmspgl
4 Copyright © 2007, 2010 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
13 AlphaTest::AlphaTest():
18 AlphaTest::AlphaTest(Predicate p, float r):
23 void AlphaTest::bind() const
27 glEnable(GL_ALPHA_TEST);
28 glAlphaFunc(pred, ref);
32 void AlphaTest::unbind()
35 glDisable(GL_ALPHA_TEST);
39 DepthTest::DepthTest():
44 DepthTest::DepthTest(Predicate p, bool w):
49 void DepthTest::bind() const
53 glEnable(GL_DEPTH_TEST);
59 const DepthTest &DepthTest::lequal()
61 static DepthTest test(LEQUAL);
65 void DepthTest::unbind()
69 glDisable(GL_DEPTH_TEST);
70 // Allow glClear(GL_DEPTH_BUFFER_BIT) to work
76 ScissorTest::ScissorTest():
83 ScissorTest::ScissorTest(int l, int b, unsigned w, unsigned h):
90 void ScissorTest::bind() const
94 glEnable(GL_SCISSOR_TEST);
95 glScissor(left, bottom, width, height);
99 void ScissorTest::unbind()
102 glDisable(GL_SCISSOR_TEST);