1 #ifndef MSP_GL_PIPELINESTATE_H_
2 #define MSP_GL_PIPELINESTATE_H_
5 #include <msp/core/noncopyable.h>
7 #include "pipelinestate_backend.h"
23 class PipelineState: public PipelineStateBackend
25 friend PipelineStateBackend;
32 const Texture *texture;
33 const Sampler *sampler;
35 BoundTexture(unsigned);
38 struct BoundUniformBlock
42 const UniformBlock *block;
44 BoundUniformBlock(int);
62 const Framebuffer *framebuffer = 0;
63 const Rect *viewport = 0;
64 const Rect *scissor = 0;
65 const Program *shprog = 0;
66 const VertexSetup *vertex_setup = 0;
67 FaceWinding front_face = COUNTERCLOCKWISE;
68 CullMode face_cull = NO_CULL;
69 std::vector<BoundTexture> textures;
70 std::vector<BoundUniformBlock> uniform_blocks;
71 const DepthTest *depth_test = 0;
72 const StencilTest *stencil_test = 0;
73 const Blend *blend = 0;
74 mutable unsigned changes = 0;
77 void set(T &, T, unsigned);
79 void set_framebuffer(const Framebuffer *);
80 void set_viewport(const Rect *);
81 void set_scissor(const Rect *);
82 void set_shader_program(const Program *);
83 void set_vertex_setup(const VertexSetup *);
84 void set_front_face(FaceWinding);
85 void set_face_cull(CullMode);
86 void set_texture(unsigned, const Texture *, const Sampler *);
87 void set_uniform_block(int, const UniformBlock *);
88 void set_depth_test(const DepthTest *);
89 void set_stencil_test(const StencilTest *);
90 void set_blend(const Blend *);
92 const Framebuffer *get_framebuffer() const { return framebuffer; }
93 const Program *get_shader_program() const { return shprog; }
94 const VertexSetup *get_vertex_setup() const { return vertex_setup; }
95 FaceWinding get_front_face() const { return front_face; }
96 CullMode get_face_cull() const { return face_cull; }