X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fprimitivetype.cpp;fp=source%2Fcore%2Fprimitivetype.cpp;h=848da8000d786ee26d05d8007453e90437bdac7b;hb=a60b558e1c327fd2e2600ad2551dc0ac648761f2;hp=81375843c9f649609e4ef2c7e60873eca3534dfa;hpb=ebef7085e2672866189ccdb3a89e977e678a89b9;p=libs%2Fgl.git diff --git a/source/core/primitivetype.cpp b/source/core/primitivetype.cpp index 81375843..848da800 100644 --- a/source/core/primitivetype.cpp +++ b/source/core/primitivetype.cpp @@ -1,9 +1,26 @@ #include #include "primitivetype.h" +using namespace std; + namespace Msp { namespace GL { +GLenum get_gl_primitive_type(PrimitiveType pt) +{ + switch(pt) + { + case POINTS: return GL_POINTS; + case LINES: return GL_LINES; + case LINE_STRIP: return GL_LINE_STRIP; + case LINE_LOOP: return GL_LINE_LOOP; + case TRIANGLES: return GL_TRIANGLES; + case TRIANGLE_STRIP: return GL_TRIANGLE_STRIP; + case TRIANGLE_FAN: return GL_TRIANGLE_FAN; + default: throw invalid_argument("get_gl_primitive_type"); + } +} + void operator>>(const LexicalConverter &conv, PrimitiveType &pt) { if(conv.get()=="POINTS")