X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftests.h;fp=source%2Fcore%2Ftests.h;h=f7d729504a37f34b477a635675197f4166c29791;hb=7aaec9a70b8d7733429bec043f8e33e02956f266;hp=0000000000000000000000000000000000000000;hpb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;p=libs%2Fgl.git diff --git a/source/core/tests.h b/source/core/tests.h new file mode 100644 index 00000000..f7d72950 --- /dev/null +++ b/source/core/tests.h @@ -0,0 +1,56 @@ +#ifndef MSP_GL_TESTS_H_ +#define MSP_GL_TESTS_H_ + +#include "bindable.h" +#include "gl.h" +#include "predicate.h" + +namespace Msp { +namespace GL { + +/** +Tests incoming fragment depth values against the depth buffer. If the test +fails, the fragment is discarded. +*/ +class DepthTest: public Bindable +{ +private: + bool write; + Predicate pred; + +public: + DepthTest(); + DepthTest(Predicate, bool = true); + + void bind() const; + + static const DepthTest &lequal(); + static void unbind(); +}; + + +/** +Tests fragment coordinates against a rectangle. Any fragments outside the +rectangle are discarded. +*/ +class ScissorTest: public Bindable +{ +private: + int left; + int bottom; + unsigned width; + unsigned height; + +public: + ScissorTest(); + ScissorTest(int, int, unsigned, unsigned); + + void bind() const; + + static void unbind(); +}; + +} // namespace GL +} // namespace Msp + +#endif