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);
38 void alpha_func(Predicate func, float ref)
40 glAlphaFunc(func, ref);
44 DepthTest::DepthTest():
49 DepthTest::DepthTest(Predicate p, bool w):
54 void DepthTest::bind() const
58 glEnable(GL_DEPTH_TEST);
64 const DepthTest &DepthTest::lequal()
66 static DepthTest test(LEQUAL);
70 void DepthTest::unbind()
73 glDisable(GL_DEPTH_TEST);
76 void depth_func(Predicate func)
82 ScissorTest::ScissorTest():
89 ScissorTest::ScissorTest(int l, int b, unsigned w, unsigned h):
96 void ScissorTest::bind() const
100 glEnable(GL_SCISSOR_TEST);
101 glScissor(left, bottom, width, height);
105 void ScissorTest::unbind()
108 glDisable(GL_SCISSOR_TEST);
111 void scissor(int left, int bottom, unsigned width, unsigned height)
113 glScissor(left, bottom, width, height);