From adfb5b6b4960224c23fec9531765f8d9fdf7ff45 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 19 Aug 2021 12:12:25 +0200 Subject: [PATCH] Small refactoring into GLModel::render() --- src/slic3r/GUI/GLModel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLModel.cpp b/src/slic3r/GUI/GLModel.cpp index 6d54ec20e..a9550bc04 100644 --- a/src/slic3r/GUI/GLModel.cpp +++ b/src/slic3r/GUI/GLModel.cpp @@ -169,6 +169,8 @@ void GLModel::reset() void GLModel::render() const { + GLShaderProgram* shader = wxGetApp().get_current_shader(); + for (const RenderData& data : m_render_data) { if (data.vbo_id == 0 || data.ibo_id == 0) continue; @@ -190,7 +192,6 @@ void GLModel::render() const glsafe(::glEnableClientState(GL_VERTEX_ARRAY)); glsafe(::glEnableClientState(GL_NORMAL_ARRAY)); - GLShaderProgram* shader = wxGetApp().get_current_shader(); if (shader != nullptr) shader->set_uniform("uniform_color", data.color); else