mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
ui: Bug fix: The default framebuffer must be bound before swapping buffers
This commit is contained in:
parent
8788c8439f
commit
fc200ec6f2
@ -171,6 +171,8 @@ func (u *userInterface) isClosed() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterface) swapBuffers() {
|
func (u *userInterface) swapBuffers() {
|
||||||
|
// The bound framebuffer must be the default one (0) before swapping buffers.
|
||||||
|
u.context.BindZeroFramebuffer()
|
||||||
// Call glFinish before glfwSwapBuffer to make sure
|
// Call glFinish before glfwSwapBuffer to make sure
|
||||||
// all OpenGL tasks are executed.
|
// all OpenGL tasks are executed.
|
||||||
u.context.Finish()
|
u.context.Finish()
|
||||||
@ -190,7 +192,6 @@ func (u *userInterface) setScreenSize(width, height, scale int) bool {
|
|||||||
|
|
||||||
// To make sure the current existing framebuffers are rendered,
|
// To make sure the current existing framebuffers are rendered,
|
||||||
// swap buffers here before SetSize is called.
|
// swap buffers here before SetSize is called.
|
||||||
u.context.BindZeroFramebuffer()
|
|
||||||
u.swapBuffers()
|
u.swapBuffers()
|
||||||
|
|
||||||
ch := make(chan struct{})
|
ch := make(chan struct{})
|
||||||
|
2
run.go
2
run.go
@ -103,8 +103,6 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gameTime += int64(c) * int64(time.Second/60)
|
gameTime += int64(c) * int64(time.Second/60)
|
||||||
|
|
||||||
// Note that the current bound framebuffer must be the default one (0).
|
|
||||||
ui.SwapBuffers()
|
ui.SwapBuffers()
|
||||||
|
|
||||||
// Calc the current FPS.
|
// Calc the current FPS.
|
||||||
|
Loading…
Reference in New Issue
Block a user