Changed OpenGL buffer type to GL_ELEMENT_ARRAY_BUFFER for vertex array indices in GLPaintContour. The previous type GL_ARRAY_BUFFER was used by mistake.

This commit is contained in:
Lukáš Hejl 2021-12-08 11:22:50 +01:00
parent 981e249927
commit 66d11bd198

View File

@ -859,9 +859,9 @@ void GLPaintContour::finalize_geometry()
if (!this->contour_indices.empty()) {
glsafe(::glGenBuffers(1, &this->m_contour_EBO_id));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, this->m_contour_EBO_id));
glsafe(::glBufferData(GL_ARRAY_BUFFER, this->contour_indices.size() * sizeof(unsigned int), this->contour_indices.data(), GL_STATIC_DRAW));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, this->m_contour_EBO_id));
glsafe(::glBufferData(GL_ELEMENT_ARRAY_BUFFER, this->contour_indices.size() * sizeof(unsigned int), this->contour_indices.data(), GL_STATIC_DRAW));
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
this->contour_indices.clear();
}
}