Documentation
¶
Overview ¶
Package renderpool recycles render-target allocations. Ebitengine owns atlas placement; the pool only lends exclusive, zero-origin views of live images.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesForSize ¶
BytesForSize estimates the allocation area, including Ebitengine's border for managed images, or standalone power-of-two rounding for unmanaged ones. Shared atlas packing gaps are additional.
Types ¶
type Pool ¶
type Pool struct {
MaxFreeBytes int64
// Optional hooks preserve the caller's allocation diagnostics.
NewImage func(width, height int, unmanaged bool) *ebiten.Image
Deallocate func(*ebiten.Image)
// contains filtered or unexported fields
}
Pool must not be copied after first use. Callers must return each acquired view with Release and must not retain or draw it after releasing it. Previously submitted draws remain ordered before the next Clear/repaint.
func (*Pool) Clear ¶
func (p *Pool) Clear()
Clear releases the idle reserve. Active views remain valid.