mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
internal/graphicsdriver/directx: refactoring
This commit is contained in:
parent
78d3e4273b
commit
730c7a2ad0
@ -356,11 +356,12 @@ func (g *graphics11) NewImage(width, height int) (graphicsdriver.Image, error) {
|
||||
}
|
||||
|
||||
func (g *graphics11) NewScreenFramebufferImage(width, height int) (graphicsdriver.Image, error) {
|
||||
if g.graphicsInfra.isSwapChainInited() {
|
||||
if g.screenImage != nil {
|
||||
g.screenImage.Dispose()
|
||||
g.screenImage = nil
|
||||
}
|
||||
|
||||
if g.graphicsInfra.isSwapChainInited() {
|
||||
if err := g.graphicsInfra.resizeSwapChain(width, height); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -370,11 +371,6 @@ func (g *graphics11) NewScreenFramebufferImage(width, height int) (graphicsdrive
|
||||
}
|
||||
}
|
||||
|
||||
if g.screenImage != nil {
|
||||
g.screenImage.Dispose()
|
||||
g.screenImage = nil
|
||||
}
|
||||
|
||||
t, err := g.graphicsInfra.getBuffer(0, &_IID_ID3D11Texture2D)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user