mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
image: Cache size
This commit is contained in:
parent
e366e1c6f3
commit
95316a1de5
7
image.go
7
image.go
@ -30,11 +30,16 @@ type Image struct {
|
||||
framebuffer *graphics.Framebuffer
|
||||
texture *graphics.Texture
|
||||
pixels []uint8
|
||||
width int
|
||||
height int
|
||||
}
|
||||
|
||||
// Size returns the size of the image.
|
||||
func (i *Image) Size() (width, height int) {
|
||||
return i.framebuffer.Size()
|
||||
if i.width == 0 {
|
||||
i.width, i.height = i.framebuffer.Size()
|
||||
}
|
||||
return i.width, i.height
|
||||
}
|
||||
|
||||
// Clear resets the pixels of the image into 0.
|
||||
|
Loading…
Reference in New Issue
Block a user