]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/pipelinestate.h
Move all OpenGL-specific code to a separate directory
[libs/gl.git] / source / core / pipelinestate.h
index f3c30030f67662422e995ace745ae75d8d4cbc8a..42543e4dc2596f5de2e2c0a7c71e85f9b64fa4c8 100644 (file)
@@ -4,13 +4,12 @@
 #include <vector>
 #include <msp/core/noncopyable.h>
 #include "cullface.h"
+#include "pipelinestate_backend.h"
 
 namespace Msp {
 namespace GL {
 
 class Blend;
-class BufferBackedUniformBlock;
-class DefaultUniformBlock;
 class DepthTest;
 class Framebuffer;
 class Program;
@@ -21,8 +20,10 @@ class Texture;
 class UniformBlock;
 class VertexSetup;
 
-class PipelineState: public NonCopyable
+class PipelineState: public PipelineStateBackend
 {
+       friend PipelineStateBackend;
+
 private:
        struct BoundTexture
        {
@@ -74,13 +75,8 @@ private:
        const Blend *blend;
        mutable unsigned changes;
 
-       static const PipelineState *last_applied;
-       static std::vector<int> bound_tex_targets;
-       static unsigned restart_index;
-
 public:
        PipelineState();
-       ~PipelineState();
 
 private:
        template<typename T>
@@ -95,11 +91,7 @@ public:
        void set_face_cull(CullMode);
        void set_enabled_clip_planes(unsigned);
        void set_texture(unsigned, const Texture *, const Sampler *);
-       void set_uniforms(const DefaultUniformBlock *);
-       void set_uniform_block(unsigned, const BufferBackedUniformBlock *);
-private:
-       void set_uniform_block_(int, const UniformBlock *);
-public:
+       void set_uniform_block(int, const UniformBlock *);
        void set_depth_test(const DepthTest *);
        void set_stencil_test(const StencilTest *);
        void set_blend(const Blend *);
@@ -109,12 +101,6 @@ public:
        const VertexSetup *get_vertex_setup() const { return vertex_setup; }
        FaceWinding get_front_face() const { return front_face; }
        CullMode get_face_cull() const { return face_cull; }
-
-       void apply() const;
-private:
-       void apply(unsigned) const;
-public:
-       static void clear();
 };
 
 } // namespace GL