]> git.tdb.fi Git - libs/gl.git/blob - source/core/primitivetype.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / primitivetype.cpp
1 #include <msp/strings/format.h>
2 #include "primitivetype.h"
3
4 using namespace std;
5
6 namespace Msp {
7 namespace GL {
8
9 void operator>>(const LexicalConverter &conv, PrimitiveType &pt)
10 {
11         if(conv.get()=="POINTS")
12                 pt = POINTS;
13         else if(conv.get()=="LINES")
14                 pt = LINES;
15         else if(conv.get()=="LINE_STRIP")
16                 pt = LINE_STRIP;
17         else if(conv.get()=="TRIANGLES")
18                 pt = TRIANGLES;
19         else if(conv.get()=="TRIANGLE_STRIP")
20                 pt = TRIANGLE_STRIP;
21         else if(conv.get()=="TRIANGLE_FAN")
22                 pt = TRIANGLE_FAN;
23         else
24                 throw lexical_error(format("conversion of '%s' to PrimitiveType", conv.get()));
25 }
26
27 } // namespace GL
28 } // namespace Msp