]> git.tdb.fi Git - libs/gl.git/blobdiff - source/windingtest.cpp
Add a flag to RenderPass to render the back faces of a mesh
[libs/gl.git] / source / windingtest.cpp
index de9e0a2530562a33deb9e84a61e5d691dafa8bd8..acbc20fc5ba127688c89c95caa0d5207a7c66f24 100644 (file)
@@ -44,13 +44,23 @@ void WindingTest::unbind()
                glDisable(GL_CULL_FACE);
 }
 
-WindingTest &WindingTest::clockwise()
+const WindingTest &WindingTest::get_reverse() const
+{
+       if(!test)
+               return *this;
+       else if(winding==CLOCKWISE)
+               return counterclockwise();
+       else
+               return clockwise();
+}
+
+const WindingTest &WindingTest::clockwise()
 {
        static WindingTest test(CLOCKWISE);
        return test;
 }
 
-WindingTest &WindingTest::counterclockwise()
+const WindingTest &WindingTest::counterclockwise()
 {
        static WindingTest test(COUNTERCLOCKWISE);
        return test;