X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fpipelinestate.h;h=1d313c3b3eb1dea828bacce03d545a4e751748df;hb=c4d81a13ca8ac1479eca78ee190f3762ef3cbec4;hp=8d1d1aaa974c85f89637bf3bd5df8ccfc9511615;hpb=9b3bce7ae76ff8c0c81315d2505ea96bf422a318;p=libs%2Fgl.git diff --git a/source/core/pipelinestate.h b/source/core/pipelinestate.h index 8d1d1aaa..1d313c3b 100644 --- a/source/core/pipelinestate.h +++ b/source/core/pipelinestate.h @@ -3,6 +3,7 @@ #include #include +#include "cullface.h" namespace Msp { namespace GL { @@ -42,7 +43,7 @@ private: { SHPROG = 1, VERTEX_SETUP = 2, - WINDING_TEST = 4, + FACE_CULL = 4, CLIP_PLANES = 8, TEXTURES = 16, UNIFORMS = 32 @@ -50,7 +51,8 @@ private: const Program *shprog; const VertexSetup *vertex_setup; - const WindingTest *winding_test; + FaceWinding front_face; + CullMode face_cull; unsigned enabled_clip_planes; std::vector textures; std::vector uniform_blocks; @@ -63,9 +65,14 @@ public: PipelineState(); ~PipelineState(); +private: + template + void set(T &, T, unsigned); +public: void set_shader_program(const Program *); void set_vertex_setup(const VertexSetup *); - void set_winding_test(const WindingTest *); + void set_front_face(FaceWinding); + void set_face_cull(CullMode); void set_enabled_clip_planes(unsigned); void set_texture(unsigned, const Texture *, const Sampler *); void set_uniforms(const DefaultUniformBlock *); @@ -76,7 +83,8 @@ public: const Program *get_shader_program() const { return shprog; } const VertexSetup *get_vertex_setup() const { return vertex_setup; } - const WindingTest *get_winding_test() const { return winding_test; } + FaceWinding get_front_face() const { return front_face; } + CullMode get_face_cull() const { return face_cull; } void apply() const; private: