mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-04 23:14:28 +01:00
graphics: Use power-of-2 size for the default framebuffer
This commit is contained in:
parent
6bbf6c53ce
commit
f74c1e67ea
@ -409,6 +409,8 @@ func (c *newScreenFramebufferImageCommand) Exec(indexOffsetInBytes int) error {
|
|||||||
if c.height < 1 {
|
if c.height < 1 {
|
||||||
return errors.New("graphics: height must be equal or more than 1.")
|
return errors.New("graphics: height must be equal or more than 1.")
|
||||||
}
|
}
|
||||||
c.result.framebuffer = newScreenFramebuffer(c.width, c.height, c.offsetX, c.offsetY)
|
w := emath.NextPowerOf2Int(c.width)
|
||||||
|
h := emath.NextPowerOf2Int(c.height)
|
||||||
|
c.result.framebuffer = newScreenFramebuffer(w, h, c.offsetX, c.offsetY)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user