mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
graphics: Bug fix: Resolve pixels before the screen is cleared
Fixes #792 Clearing the screen is so special on some environments (like macOS Metal) that other operations on other images can be invalidated. This fixes the issue by resolving the pixels of the offscreen that is used as a render source for the screen before the screen is cleared. We are not sure this is a correct way, but this actually fixes the problem on macOS.
This commit is contained in:
parent
15b13c8b62
commit
4ce850df70
@ -112,6 +112,11 @@ func (c *graphicsContext) Update(afterFrameUpdate func()) error {
|
||||
afterFrameUpdate()
|
||||
}
|
||||
|
||||
// Before clearing the screen, the offscreen's pixels must be solved.
|
||||
// After clearing the screen, resolving doesn't work. This is very hacky
|
||||
// but we could not find other way so far (#792).
|
||||
c.offscreen.resolvePixelsToSet(true)
|
||||
|
||||
// This clear is needed for fullscreen mode or some mobile platforms (#622).
|
||||
c.screen.Clear()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user