mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/graphicsdriver/metal: refactoring
This commit is contained in:
parent
5e17791e4e
commit
8d020ad414
@ -204,14 +204,16 @@ func (g *Graphics) flushIfNeeded(present bool) {
|
||||
}
|
||||
g.flushRenderCommandEncoderIfNeeded()
|
||||
|
||||
// This logic is necessary when skipping clearing the framebuffer.
|
||||
if present && g.screenDrawable == (ca.MetalDrawable{}) {
|
||||
if present {
|
||||
// This check is necessary when skipping to render the screen (SetScreenClearedEveryFrame(false)).
|
||||
if g.screenDrawable == (ca.MetalDrawable{}) {
|
||||
g.screenDrawable = g.view.nextDrawable()
|
||||
}
|
||||
|
||||
if present && g.screenDrawable != (ca.MetalDrawable{}) {
|
||||
if g.screenDrawable != (ca.MetalDrawable{}) {
|
||||
g.cb.PresentDrawable(g.screenDrawable)
|
||||
}
|
||||
}
|
||||
|
||||
g.cb.Commit()
|
||||
|
||||
for _, t := range g.tmpTextures {
|
||||
|
Loading…
Reference in New Issue
Block a user