X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fwindingtest.cpp;h=0b8218adbf2773971b589c89cccefa134d403788;hb=refs%2Fheads%2Fmaster;hp=401d68035af46703e8496b6eaff9e452026b8ae2;hpb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8;p=libs%2Fgl.git diff --git a/source/windingtest.cpp b/source/windingtest.cpp deleted file mode 100644 index 401d6803..00000000 --- a/source/windingtest.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "windingtest.h" - -namespace Msp { -namespace GL { - -void operator>>(const LexicalConverter &conv, FaceWinding &winding) -{ - if(conv.get()=="CLOCKWISE") - winding = CLOCKWISE; - else if(conv.get()=="COUNTERCLOCKWISE") - winding = COUNTERCLOCKWISE; - else - throw InvalidParameterValue("Invalid FaceWinding"); -} - -WindingTest::WindingTest(): - test(false), - winding(COUNTERCLOCKWISE) -{ } - -WindingTest::WindingTest(FaceWinding w): - test(true), - winding(w) -{ } - -void WindingTest::bind() const -{ - if(set_current(this)) - { - if(test) - { - glEnable(GL_CULL_FACE); - glFrontFace(winding); - } - else - glDisable(GL_CULL_FACE); - } -} - -void WindingTest::unbind() -{ - if(set_current(0)) - glDisable(GL_CULL_FACE); -} - -WindingTest &WindingTest::clockwise() -{ - static WindingTest test(CLOCKWISE); - return test; -} - -WindingTest &WindingTest::counterclockwise() -{ - static WindingTest test(COUNTERCLOCKWISE); - return test; -} - -} // namespace GL -} // namespace Msp