Skip to content

Commit

Permalink
Unbind buffers when clearing state.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed Aug 23, 2024
1 parent 999f765 commit d1c2679
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/refresh/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ void GL_ClearState(void)
qglCullFace(GL_BACK);
qglEnable(GL_CULL_FACE);

// unbind buffers
if (qglBindBuffer) {
qglBindBuffer(GL_ARRAY_BUFFER, 0);
qglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}

gl_backend->clear_state();

qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | gl_static.stencil_buffer_bit);
Expand Down
2 changes: 0 additions & 2 deletions src/refresh/tess.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,6 @@ void GL_InitArrays(void)
qglBindVertexArray(gl_static.array_object);

qglGenBuffers(1, &gl_static.index_buffer);
GL_BindBuffer(GL_ELEMENT_ARRAY_BUFFER, gl_static.index_buffer);

qglGenBuffers(1, &gl_static.vertex_buffer);
}

Expand Down

0 comments on commit d1c2679

Please sign in to comment.