mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
dd393b6f21
commit
b40c5b1e99
@ -147,7 +147,9 @@ func (c *context) updateFrameImpl(graphicsDriver graphicsdriver.Graphics, update
|
||||
|
||||
// Update window icons during a frame, since an icon might be *ebiten.Image and
|
||||
// getting pixels from it needs to be in a frame (#1468).
|
||||
ui.updateIconIfNeeded()
|
||||
if err := ui.updateIconIfNeeded(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Draw the game.
|
||||
if err := c.drawGame(graphicsDriver, forceDraw); err != nil {
|
||||
|
@ -1113,15 +1113,15 @@ func (u *userInterfaceImpl) updateGame() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) updateIconIfNeeded() {
|
||||
func (u *userInterfaceImpl) updateIconIfNeeded() error {
|
||||
// In the fullscreen mode, SetIcon fails (#1578).
|
||||
if u.isFullscreen() {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
imgs := u.getIconImages()
|
||||
if len(imgs) == 0 {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
u.setIconImages(nil)
|
||||
@ -1142,9 +1142,16 @@ func (u *userInterfaceImpl) updateIconIfNeeded() {
|
||||
newImgs[i] = rgba
|
||||
}
|
||||
|
||||
// Catch a possible error at 'At' (#2647).
|
||||
if err := theGlobalState.error(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u.mainThread.Call(func() {
|
||||
u.window.SetIcon(newImgs)
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) swapBuffersOnRenderThread() {
|
||||
|
@ -723,7 +723,8 @@ func (u *userInterfaceImpl) beginFrame() {
|
||||
func (u *userInterfaceImpl) endFrame() {
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) updateIconIfNeeded() {
|
||||
func (u *userInterfaceImpl) updateIconIfNeeded() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func IsScreenTransparentAvailable() bool {
|
||||
|
@ -457,7 +457,8 @@ func (u *userInterfaceImpl) beginFrame() {
|
||||
func (u *userInterfaceImpl) endFrame() {
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) updateIconIfNeeded() {
|
||||
func (u *userInterfaceImpl) updateIconIfNeeded() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func IsScreenTransparentAvailable() bool {
|
||||
|
@ -201,7 +201,8 @@ func (u *userInterfaceImpl) beginFrame() {
|
||||
func (u *userInterfaceImpl) endFrame() {
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) updateIconIfNeeded() {
|
||||
func (u *userInterfaceImpl) updateIconIfNeeded() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func IsScreenTransparentAvailable() bool {
|
||||
|
Loading…
Reference in New Issue
Block a user