mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +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
|
||||
// is cleared every frame instead.
|
||||
func (i *Image) SetVolatile(volatile bool) {
|
||||
changed := i.volatile != volatile
|
||||
i.volatile = volatile
|
||||
if changed {
|
||||
i.makeStale()
|
||||
}
|
||||
}
|
||||
|
||||
// Extend extends the image by the given size.
|
||||
|
Loading…
Reference in New Issue
Block a user