mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/graphicsdriver: define Resetter
This commit is contained in:
parent
8cbf545e0f
commit
61ee811579
@ -550,7 +550,7 @@ func InitializeGraphicsDriverState(graphicsDriver graphicsdriver.Graphics) (err
|
||||
// ResetGraphicsDriverState resets the current graphics driver state.
|
||||
// If the graphics driver doesn't have an API to reset, ResetGraphicsDriverState does nothing.
|
||||
func ResetGraphicsDriverState(graphicsDriver graphicsdriver.Graphics) (err error) {
|
||||
if r, ok := graphicsDriver.(interface{ Reset() error }); ok {
|
||||
if r, ok := graphicsDriver.(graphicsdriver.Resetter); ok {
|
||||
runOnRenderThread(func() {
|
||||
err = r.Reset()
|
||||
})
|
||||
|
@ -57,6 +57,10 @@ type Graphics interface {
|
||||
DrawTriangles(dst ImageID, srcs [graphics.ShaderImageCount]ImageID, shader ShaderID, dstRegions []DstRegion, indexOffset int, blend Blend, uniforms []uint32, evenOdd bool) error
|
||||
}
|
||||
|
||||
type Resetter interface {
|
||||
Reset() error
|
||||
}
|
||||
|
||||
type Image interface {
|
||||
ID() ImageID
|
||||
Dispose()
|
||||
|
Loading…
Reference in New Issue
Block a user