X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Frender%2Frenderer.h;h=0371e8374a6a9207faf913f13c16f653cf75fac1;hb=3930e89d1dab90a27542c3798782216499b3ab44;hp=36fe6c919a5e063de7b5fa0e74353fe0643b700d;hpb=42c44db6aa2961cffea6263f337adbd9d161c59c;p=libs%2Fgl.git diff --git a/source/render/renderer.h b/source/render/renderer.h index 36fe6c91..0371e837 100644 --- a/source/render/renderer.h +++ b/source/render/renderer.h @@ -101,9 +101,9 @@ private: unsigned char changed = 0; std::vector state_stack; State *state; - std::vector texture_stack; ProgramData standard_shdata; std::vector shdata_stack; + std::vector 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. */