]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/tests.h
Rearrange soucre files into subdirectories
[libs/gl.git] / source / core / tests.h
diff --git a/source/core/tests.h b/source/core/tests.h
new file mode 100644 (file)
index 0000000..f7d7295
--- /dev/null
@@ -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<DepthTest>
+{
+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<ScissorTest>
+{
+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