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