mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48: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
|
initWindowFloating bool
|
||||||
initWindowMaximized bool
|
initWindowMaximized bool
|
||||||
|
|
||||||
|
bufferOnceSwapped bool
|
||||||
|
|
||||||
origWindowPosX int
|
origWindowPosX int
|
||||||
origWindowPosY int
|
origWindowPosY int
|
||||||
origWindowWidthInDIP int
|
origWindowWidthInDIP int
|
||||||
@ -974,7 +976,8 @@ func (u *userInterfaceImpl) update() (float64, float64, error) {
|
|||||||
return 0, 0, RegularTermination
|
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.setFullscreen(true)
|
||||||
u.setInitFullscreen(false)
|
u.setInitFullscreen(false)
|
||||||
}
|
}
|
||||||
@ -1067,6 +1070,8 @@ func (u *userInterfaceImpl) updateGame() error {
|
|||||||
|
|
||||||
// This works only for OpenGL.
|
// This works only for OpenGL.
|
||||||
u.swapBuffersOnRenderThread()
|
u.swapBuffersOnRenderThread()
|
||||||
|
|
||||||
|
u.bufferOnceSwapped = true
|
||||||
})
|
})
|
||||||
|
|
||||||
if unfocused {
|
if unfocused {
|
||||||
|
Loading…
Reference in New Issue
Block a user