]> git.tdb.fi Git - libs/gl.git/blob - source/primitivetype.cpp
Drop Id tags and copyright notices from files
[libs/gl.git] / source / primitivetype.cpp
1 #include "primitivetype.h"
2
3 namespace Msp {
4 namespace GL {
5
6 std::istream &operator>>(std::istream &in, PrimitiveType &pt)
7 {
8         std::string str;
9         in>>str;
10
11         if(str=="POINTS")
12                 pt = POINTS;
13         else if(str=="LINES")
14                 pt = LINES;
15         else if(str=="LINE_LOOP")
16                 pt = LINE_LOOP;
17         else if(str=="LINE_STRIP")
18                 pt = LINE_STRIP;
19         else if(str=="TRIANGLES")
20                 pt = TRIANGLES;
21         else if(str=="TRIANGLE_STRIP")
22                 pt = TRIANGLE_STRIP;
23         else if(str=="TRIANGLE_FAN")
24                 pt = TRIANGLE_FAN;
25         else if(str=="QUADS")
26                 pt = QUADS;
27         else if(str=="QUAD_STRIP")
28                 pt = QUAD_STRIP;
29         else if(str=="POLYGON")
30                 pt = POLYGON;
31         else
32                 in.setstate(std::ios_base::failbit);
33
34         return in;
35 }
36
37 } // namespace GL
38 } // namespace Msp