mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
ui: Bug fix: Call glFinish before glfwSwapBuffers to make sure all OpenGL tasks are executed (#161)
This commit is contained in:
parent
ee683c5867
commit
922f392544
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user