ui: Bug fix: Call glFinish before glfwSwapBuffers to make sure all OpenGL tasks are executed (#161)

This commit is contained in:
Hajime Hoshi 2016-02-24 22:56:47 +09:00
parent ee683c5867
commit 922f392544
2 changed files with 7 additions and 0 deletions

View File

@ -336,3 +336,7 @@ func (c *Context) BufferSubData(bufferType BufferType, data []int16) {
func (c *Context) DrawElements(mode Mode, len int) {
gl.DrawElements(mgl.Enum(mode), len, mgl.UNSIGNED_SHORT, 0)
}
func (c *Context) Finish() {
gl.Finish()
}

View File

@ -147,6 +147,9 @@ func (u *userInterface) isClosed() bool {
}
func (u *userInterface) swapBuffers() {
// Call glFinish before glfwSwapBuffer to make sure
// all OpenGL tasks are executed.
u.context.Finish()
u.context.RunOnContextThread(func() {
u.window.SwapBuffers()
})