]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/renderer.h
Reorder members of Renderer and PipelineState
[libs/gl.git] / source / render / renderer.h
index 36fe6c919a5e063de7b5fa0e74353fe0643b700d..0371e8374a6a9207faf913f13c16f653cf75fac1 100644 (file)
@@ -101,9 +101,9 @@ private:
        unsigned char changed = 0;
        std::vector<State> state_stack;
        State *state;
-       std::vector<BoundTexture> texture_stack;
        ProgramData standard_shdata;
        std::vector<BoundProgramData> shdata_stack;
+       std::vector<BoundTexture> texture_stack;
        PipelineState pipeline_state;
        Commands commands;
 
@@ -111,6 +111,19 @@ public:
        Renderer();
        ~Renderer();
 
+
+       /** Unbinds all objects and resets related state.  There must be no unpopped
+       state in the stack.  The Renderer remains valid and may be reused for
+       further rendering. */
+       void end();
+
+       /** Saves the current state so it can be restored later. */
+       void push_state();
+
+       /** Restores a previously saved state.  Must be matched with an earlier
+       push_state call. */
+       void pop_state();
+
        /** Sets the camera to render from.  The model matrix is reset to identity. */
        void set_camera(const Camera &);
 
@@ -131,11 +144,6 @@ public:
 
        const Framebuffer *get_framebuffer() const { return state->framebuffer; }
 
-       void set_texture(Tag, const Texture *, const Sampler * = 0);
-private:
-       void flush_textures();
-
-public:
        /** Sets the shader program to use.  As a convenience, uniform values may be
        specified at the same time. */
        void set_shader_program(const Program *prog, const ProgramData *data = 0);
@@ -145,8 +153,11 @@ public:
        last will be used. */
        void add_shader_data(const ProgramData &data);
 
+       void set_texture(Tag, const Texture *, const Sampler * = 0);
+
 private:
        void flush_shader_data();
+       void flush_textures();
 
 public:
        void set_vertex_setup(const VertexSetup *);
@@ -160,18 +171,6 @@ public:
        void set_object_lod_bias(unsigned);
        unsigned get_object_lod_bias() const { return state->object_lod_bias; }
 
-       /** Saves the current state so it can be restored later. */
-       void push_state();
-
-       /** Restores a previously saved state.  Must be matched with an earlier
-       push_state call. */
-       void pop_state();
-
-       /** Unbinds all objects and resets related state.  There must be no unpopped
-       state in the stack.  The Renderer remains valid and may be reused for
-       further rendering. */
-       void end();
-
        void clear(const ClearValue *);
 
        /** Draws a batch of primitives.  A shader must be active. */