mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/graphicsdriver/directx: dispose a screen image explicitly
A screen image in DirectX 12 should not include any buffers to release so there is not a bug, but disposing it explicitly when resizing the window should be polite.
This commit is contained in:
parent
3c72ff0a65
commit
c22957f678
@ -994,6 +994,11 @@ func (g *graphics12) NewImage(width, height int) (graphicsdriver.Image, error) {
|
||||
}
|
||||
|
||||
func (g *graphics12) NewScreenFramebufferImage(width, height int) (graphicsdriver.Image, error) {
|
||||
if g.screenImage != nil {
|
||||
g.screenImage.Dispose()
|
||||
g.screenImage = nil
|
||||
}
|
||||
|
||||
if err := g.updateSwapChain(width, height); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user