mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
graphics: Use math.Ceil for the screen framebuffer size
There are glitches on some mobile devices like Xperia. As the screen framebuffer size might not fit with the actual GL surface size, we guessed that is the cause of the glitches. By using math.Ceil, the screen framebuffer will be a little bigger and can cover the GL surface.
This commit is contained in:
parent
645b94de5f
commit
0b60471ac0
@ -65,8 +65,8 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
|
|||||||
}
|
}
|
||||||
c.offscreen = newVolatileImage(screenWidth, screenHeight)
|
c.offscreen = newVolatileImage(screenWidth, screenHeight)
|
||||||
|
|
||||||
w := int(float64(screenWidth) * screenScale)
|
w := int(math.Ceil(float64(screenWidth) * screenScale))
|
||||||
h := int(float64(screenHeight) * screenScale)
|
h := int(math.Ceil(float64(screenHeight) * screenScale))
|
||||||
px0, py0, px1, py1 := ui.ScreenPadding()
|
px0, py0, px1, py1 := ui.ScreenPadding()
|
||||||
c.screen = newImageWithScreenFramebuffer(w+int(math.Ceil(px0+px1)), h+int(math.Ceil(py0+py1)))
|
c.screen = newImageWithScreenFramebuffer(w+int(math.Ceil(px0+px1)), h+int(math.Ceil(py0+py1)))
|
||||||
c.screenWidth = w
|
c.screenWidth = w
|
||||||
|
Loading…
Reference in New Issue
Block a user