]> git.tdb.fi Git - libs/gl.git/blob - source/windingtest.h
Drop Id tags and copyright notices from files
[libs/gl.git] / source / windingtest.h
1 #ifndef WINDINGTEST_H_
2 #define WINDINGTEST_H_
3
4 #include <msp/strings/lexicalcast.h>
5 #include "bindable.h"
6 #include "gl.h"
7
8 namespace Msp {
9 namespace GL {
10
11 enum FaceWinding
12 {
13         CLOCKWISE = GL_CW,
14         COUNTERCLOCKWISE = GL_CCW
15 };
16
17 void operator>>(const LexicalConverter &, FaceWinding &);
18
19 /**
20 Tests the winding of polygons.  If the order of vertices on screen does not
21 match the winding, the polygon is not rendered.
22 */
23 class WindingTest: public Bindable<WindingTest>
24 {
25 private:
26         bool test;
27         FaceWinding winding;
28
29 public:
30         WindingTest();
31         WindingTest(FaceWinding);
32
33         void bind() const;
34
35         static void unbind();
36
37         static WindingTest &clockwise();
38         static WindingTest &counterclockwise();
39 };
40
41 } // namespace GL
42 } // namespace Msp
43
44 #endif