-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2011 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
+#include <msp/strings/format.h>
#include "windingtest.h"
namespace Msp {
else if(conv.get()=="COUNTERCLOCKWISE")
winding = COUNTERCLOCKWISE;
else
- throw InvalidParameterValue("Invalid FaceWinding");
+ throw lexical_error(format("conversion of '%s' to FaceWinding", conv.get()));
}
WindingTest::WindingTest():
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;