3 This file is part of libmspgl
4 Copyright © 2007, 2010 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_TESTS_H_
9 #define MSP_GL_TESTS_H_
13 #include "predicate.h"
20 SCISSOR_TEST = GL_SCISSOR_TEST,
21 ALPHA_TEST = GL_ALPHA_TEST,
22 DEPTH_TEST = GL_DEPTH_TEST
26 Tests incoming fragment alpha values against a reference. If the test fails,
27 the fragment is discarded.
29 class AlphaTest: public Bindable<AlphaTest>
37 AlphaTest(Predicate, float);
44 void alpha_func(Predicate func, float ref);
48 Tests incoming fragment depth values against the depth buffer. If the test
49 fails, the fragment is discarded.
51 class DepthTest: public Bindable<DepthTest>
59 DepthTest(Predicate, bool = true);
63 static const DepthTest &lequal();
67 void depth_func(Predicate func);
71 Tests fragment coordinates against a rectangle. Any fragments outside the
72 rectangle are discarded.
74 class ScissorTest: public Bindable<ScissorTest>
84 ScissorTest(int, int, unsigned, unsigned);
91 void scissor(int left, int bottom, unsigned width, unsigned height);