1 #include <msp/strings/format.h>
2 #include "windingtest.h"
7 void operator>>(const LexicalConverter &conv, FaceWinding &winding)
9 if(conv.get()=="CLOCKWISE")
11 else if(conv.get()=="COUNTERCLOCKWISE")
12 winding = COUNTERCLOCKWISE;
14 throw lexical_error(format("conversion of '%s' to FaceWinding", conv.get()));
17 WindingTest::WindingTest():
18 winding(COUNTERCLOCKWISE)
21 WindingTest::WindingTest(FaceWinding w):
25 void WindingTest::bind() const
29 glEnable(GL_CULL_FACE);
34 void WindingTest::unbind()
37 glDisable(GL_CULL_FACE);
40 const WindingTest &WindingTest::get_reverse() const
42 if(winding==CLOCKWISE)
43 return counterclockwise();
48 const WindingTest &WindingTest::clockwise()
50 static WindingTest test(CLOCKWISE);
54 const WindingTest &WindingTest::counterclockwise()
56 static WindingTest test(COUNTERCLOCKWISE);