mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08: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)
|
NewImage(width, height int) (Image, error)
|
||||||
NewScreenFramebufferImage(width, height int) (Image, error)
|
NewScreenFramebufferImage(width, height int) (Image, error)
|
||||||
Initialize() error
|
Initialize() error
|
||||||
Reset() error
|
|
||||||
SetVsyncEnabled(enabled bool)
|
SetVsyncEnabled(enabled bool)
|
||||||
FramebufferYDirection() YDirection
|
FramebufferYDirection() YDirection
|
||||||
NeedsRestoring() bool
|
NeedsRestoring() bool
|
||||||
|
@ -662,10 +662,14 @@ func InitializeGraphicsDriverState() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ResetGraphicsDriverState resets the current graphics driver state.
|
// ResetGraphicsDriverState resets the current graphics driver state.
|
||||||
|
// If the graphics driver doesn't have an API to reset, ResetGraphicsDriverState does nothing.
|
||||||
func ResetGraphicsDriverState() error {
|
func ResetGraphicsDriverState() error {
|
||||||
return runOnMainThread(func() error {
|
if r, ok := theGraphicsDriver.(interface{ Reset() error }); ok {
|
||||||
return theGraphicsDriver.Reset()
|
return runOnMainThread(func() error {
|
||||||
})
|
return r.Reset()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MaxImageSize returns the maximum size of an image.
|
// MaxImageSize returns the maximum size of an image.
|
||||||
|
@ -767,10 +767,6 @@ func (g *Graphics) Initialize() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Graphics) Reset() error {
|
|
||||||
panic("metal: Reset is not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *Graphics) flushRenderCommandEncoderIfNeeded() {
|
func (g *Graphics) flushRenderCommandEncoderIfNeeded() {
|
||||||
if g.rce == (mtl.RenderCommandEncoder{}) {
|
if g.rce == (mtl.RenderCommandEncoder{}) {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user