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;
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 &);
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);
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 *);
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. */