mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
restorable: Make the image stale when volatile state changes
This commit is contained in:
parent
7ec63acd1d
commit
7329880f40
@ -154,7 +154,11 @@ func NewImage(width, height int) *Image {
|
|||||||
// reading pixels from GPU are expensive operations. Volatile images can skip such oprations, but the image content
|
// reading pixels from GPU are expensive operations. Volatile images can skip such oprations, but the image content
|
||||||
// is cleared every frame instead.
|
// is cleared every frame instead.
|
||||||
func (i *Image) SetVolatile(volatile bool) {
|
func (i *Image) SetVolatile(volatile bool) {
|
||||||
|
changed := i.volatile != volatile
|
||||||
i.volatile = volatile
|
i.volatile = volatile
|
||||||
|
if changed {
|
||||||
|
i.makeStale()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extend extends the image by the given size.
|
// Extend extends the image by the given size.
|
||||||
|
Loading…
Reference in New Issue
Block a user