texture_stack.reserve(32);
}
-Renderer::~Renderer()
-{
-}
-
void Renderer::begin()
{
if(current_state)
throw invalid_operation("Renderer::begin");
- state_stack.push_back(State());
+ ++frame_index;
+ state_stack.emplace_back();
current_state = &state_stack.back();
RendererBackend::begin();
add_shader_data(standard_shdata);
+ commands.begin_frame(frame_index);
}
void Renderer::end()
break;
}
- texture_stack.push_back(BoundTexture());
+ texture_stack.emplace_back();
BoundTexture &bound_tex = texture_stack.back();
bound_tex.tag = tag;
bound_tex.texture = tex;
{
apply_state();
batch.refresh();
+ pipeline_state.set_primitive_type(batch.get_type());
commands.use_pipeline(&pipeline_state);
commands.draw(batch);
}
{
apply_state();
batch.refresh();
+ pipeline_state.set_primitive_type(batch.get_type());
commands.use_pipeline(&pipeline_state);
commands.draw_instanced(batch, count);
}