X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fprimitivetype.cpp;fp=source%2Fcore%2Fprimitivetype.cpp;h=81375843c9f649609e4ef2c7e60873eca3534dfa;hb=7aaec9a70b8d7733429bec043f8e33e02956f266;hp=0000000000000000000000000000000000000000;hpb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;p=libs%2Fgl.git diff --git a/source/core/primitivetype.cpp b/source/core/primitivetype.cpp new file mode 100644 index 00000000..81375843 --- /dev/null +++ b/source/core/primitivetype.cpp @@ -0,0 +1,28 @@ +#include +#include "primitivetype.h" + +namespace Msp { +namespace GL { + +void operator>>(const LexicalConverter &conv, PrimitiveType &pt) +{ + if(conv.get()=="POINTS") + pt = POINTS; + else if(conv.get()=="LINES") + pt = LINES; + else if(conv.get()=="LINE_LOOP") + pt = LINE_LOOP; + else if(conv.get()=="LINE_STRIP") + pt = LINE_STRIP; + else if(conv.get()=="TRIANGLES") + pt = TRIANGLES; + else if(conv.get()=="TRIANGLE_STRIP") + pt = TRIANGLE_STRIP; + else if(conv.get()=="TRIANGLE_FAN") + pt = TRIANGLE_FAN; + else + throw lexical_error(format("conversion of '%s' to PrimitiveType", conv.get())); +} + +} // namespace GL +} // namespace Msp