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

This commit is contained in:
enricoturri1966 committed 2021-07-20 12:36:56 +02:00
1 parent c61785f775
commit fd5cf8d0cc
6 files changed
+20 -34

No files matched your search

+2
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));