X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Frenderer.cpp;h=4fb2b0c79bc01dc8dcbf6fbc58b79aea98b0f441;hb=4cd245dafe6a7ee5c93edca5aee2d146f1155309;hp=6c8f1b67b29c0deb30161db2acfb19f6cffb2b79;hpb=b95aa29809038b39e6729f4e53af0dfb545bfcdc;p=libs%2Fgl.git diff --git a/source/render/renderer.cpp b/source/render/renderer.cpp index 6c8f1b67..4fb2b0c7 100644 --- a/source/render/renderer.cpp +++ b/source/render/renderer.cpp @@ -27,16 +27,12 @@ Renderer::Renderer() texture_stack.reserve(32); } -Renderer::~Renderer() -{ -} - void Renderer::begin() { if(current_state) throw invalid_operation("Renderer::begin"); - state_stack.push_back(State()); + state_stack.emplace_back(); current_state = &state_stack.back(); RendererBackend::begin(); @@ -167,7 +163,7 @@ void Renderer::set_texture(Tag tag, const Texture *tex, const Sampler *samp) break; } - texture_stack.push_back(BoundTexture()); + texture_stack.emplace_back(); BoundTexture &bound_tex = texture_stack.back(); bound_tex.tag = tag; bound_tex.texture = tex; @@ -244,6 +240,7 @@ void Renderer::draw(const Batch &batch) { apply_state(); batch.refresh(); + pipeline_state.set_primitive_type(batch.get_type()); commands.use_pipeline(&pipeline_state); commands.draw(batch); } @@ -252,6 +249,7 @@ void Renderer::draw_instanced(const Batch &batch, unsigned count) { apply_state(); batch.refresh(); + pipeline_state.set_primitive_type(batch.get_type()); commands.use_pipeline(&pipeline_state); commands.draw_instanced(batch, count); }