mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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.
|
// ResetGraphicsDriverState resets the current graphics driver state.
|
||||||
// If the graphics driver doesn't have an API to reset, ResetGraphicsDriverState does nothing.
|
// If the graphics driver doesn't have an API to reset, ResetGraphicsDriverState does nothing.
|
||||||
func ResetGraphicsDriverState(graphicsDriver graphicsdriver.Graphics) (err error) {
|
func ResetGraphicsDriverState(graphicsDriver graphicsdriver.Graphics) (err error) {
|
||||||
if r, ok := graphicsDriver.(interface{ Reset() error }); ok {
|
if r, ok := graphicsDriver.(graphicsdriver.Resetter); ok {
|
||||||
runOnRenderThread(func() {
|
runOnRenderThread(func() {
|
||||||
err = r.Reset()
|
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
|
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 {
|
type Image interface {
|
||||||
ID() ImageID
|
ID() ImageID
|
||||||
Dispose()
|
Dispose()
|
||||||
|
Loading…
Reference in New Issue
Block a user