]> git.tdb.fi Git - libs/gl.git/blob - source/core/cullface.cpp
Set viewport and scissor before clear commands
[libs/gl.git] / source / core / cullface.cpp
1 #include <msp/strings/format.h>
2 #include "cullface.h"
3
4 namespace Msp {
5 namespace GL {
6
7 void operator>>(const LexicalConverter &conv, FaceWinding &winding)
8 {
9         if(conv.get()=="NON_MANIFOLD")
10                 winding = NON_MANIFOLD;
11         else if(conv.get()=="CLOCKWISE")
12                 winding = CLOCKWISE;
13         else if(conv.get()=="COUNTERCLOCKWISE")
14                 winding = COUNTERCLOCKWISE;
15         else
16                 throw lexical_error(format("conversion of '%s' to FaceWinding", conv.get()));
17 }
18
19 void operator>>(const LexicalConverter &conv, CullMode &cull)
20 {
21         if(conv.get()=="NO_CULL")
22                 cull = NO_CULL;
23         else if(conv.get()=="CULL_FRONT")
24                 cull = CULL_FRONT;
25         else if(conv.get()=="CULL_BACK")
26                 cull = CULL_BACK;
27         else
28                 throw lexical_error(format("conversion of '%s' to CullMode", conv.get()));
29 }
30
31 } // namespace GL
32 } // namespace Msp