mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/restorable: Bug fix: Test failed on macOS (Metal)
This commit is contained in:
parent
17869143c0
commit
b0106e95b9
@ -42,7 +42,6 @@ type Graphics interface {
|
||||
NewImage(width, height int) (Image, error)
|
||||
NewScreenFramebufferImage(width, height int) (Image, error)
|
||||
Initialize() error
|
||||
Reset() error
|
||||
SetVsyncEnabled(enabled bool)
|
||||
FramebufferYDirection() YDirection
|
||||
NeedsRestoring() bool
|
||||
|
@ -662,10 +662,14 @@ func InitializeGraphicsDriverState() error {
|
||||
}
|
||||
|
||||
// ResetGraphicsDriverState resets the current graphics driver state.
|
||||
// If the graphics driver doesn't have an API to reset, ResetGraphicsDriverState does nothing.
|
||||
func ResetGraphicsDriverState() error {
|
||||
return runOnMainThread(func() error {
|
||||
return theGraphicsDriver.Reset()
|
||||
})
|
||||
if r, ok := theGraphicsDriver.(interface{ Reset() error }); ok {
|
||||
return runOnMainThread(func() error {
|
||||
return r.Reset()
|
||||
})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MaxImageSize returns the maximum size of an image.
|
||||
|
@ -767,10 +767,6 @@ func (g *Graphics) Initialize() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g *Graphics) Reset() error {
|
||||
panic("metal: Reset is not implemented")
|
||||
}
|
||||
|
||||
func (g *Graphics) flushRenderCommandEncoderIfNeeded() {
|
||||
if g.rce == (mtl.RenderCommandEncoder{}) {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user