mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/graphicsdriver/directx: bug fix: wrong size was used when resizing
Updates #2633
This commit is contained in:
parent
2c088b9059
commit
2423733598
@ -385,7 +385,9 @@ func (g *graphics11) NewImage(width, height int) (graphicsdriver.Image, error) {
|
||||
}
|
||||
|
||||
func (g *graphics11) NewScreenFramebufferImage(width, height int) (graphicsdriver.Image, error) {
|
||||
var origWidth, origHeight int
|
||||
if g.screenImage != nil {
|
||||
origWidth, origHeight = g.screenImage.width, g.screenImage.height
|
||||
g.screenImage.Dispose()
|
||||
g.screenImage = nil
|
||||
}
|
||||
@ -394,7 +396,7 @@ func (g *graphics11) NewScreenFramebufferImage(width, height int) (graphicsdrive
|
||||
// For a new image11 instance, use the original image size now.
|
||||
// Use the new image size when a swap chain is actually resized.
|
||||
newWidth, newHeight := width, height
|
||||
width, height = g.newScreenWidth, g.newScreenHeight
|
||||
width, height = origWidth, origHeight
|
||||
g.newScreenWidth, g.newScreenHeight = newWidth, newHeight
|
||||
} else {
|
||||
if err := g.graphicsInfra.initSwapChain(width, height, unsafe.Pointer(g.device), g.window); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user