Refactoring in GLModel::render() to simplify client code

This commit is contained in:
enricoturri1966 2021-07-20 12:36:56 +02:00
parent c61785f775
commit fd5cf8d0cc
6 changed files with 20 additions and 34 deletions
src/slic3r/GUI

View file

@ -161,6 +161,8 @@ void GLModel::render() const
GLShaderProgram* shader = wxGetApp().get_current_shader();
if (shader != nullptr)
shader->set_uniform("uniform_color", data.color);
else
glsafe(::glColor4fv(data.color.data()));
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.ibo_id));
glsafe(::glDrawElements(mode, static_cast<GLsizei>(data.indices_count), GL_UNSIGNED_INT, (const void*)0));