mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/ui: bug fix: needed to wait for swapping buffers before entering fullscreen
Closes #2599
This commit is contained in:
parent
65fb9d56ba
commit
e93bcd9e55
@ -92,6 +92,8 @@ type userInterfaceImpl struct {
|
||||
initWindowFloating bool
|
||||
initWindowMaximized bool
|
||||
|
||||
bufferOnceSwapped bool
|
||||
|
||||
origWindowPosX int
|
||||
origWindowPosY int
|
||||
origWindowWidthInDIP int
|
||||
@ -974,7 +976,8 @@ func (u *userInterfaceImpl) update() (float64, float64, error) {
|
||||
return 0, 0, RegularTermination
|
||||
}
|
||||
|
||||
if u.isInitFullscreen() {
|
||||
// On macOS, one swapping buffers seems required before entering fullscreen (#2599).
|
||||
if u.isInitFullscreen() && (u.bufferOnceSwapped || runtime.GOOS != "darwin") {
|
||||
u.setFullscreen(true)
|
||||
u.setInitFullscreen(false)
|
||||
}
|
||||
@ -1067,6 +1070,8 @@ func (u *userInterfaceImpl) updateGame() error {
|
||||
|
||||
// This works only for OpenGL.
|
||||
u.swapBuffersOnRenderThread()
|
||||
|
||||
u.bufferOnceSwapped = true
|
||||
})
|
||||
|
||||
if unfocused {
|
||||
|
Loading…
Reference in New Issue
Block a user