Core guide

Resource ownership

Keep GPU resources alive across accepted draws with opaque handles and leases.

Live example

See Resource ownership in action

See a texture acquired through a resource owner remain usable for the game lifetime.

live rendering loading ticks 0

How it works

Releasing a handle invalidates that handle for future reads. An accepted draw keeps its resource lease until the renderer is safe to release it, while owner disposal cleans up remaining acquisitions.

Public types

  • ResourceOwner
  • ResourceHandle<T>
  • GeometryOwner
  • GeometryHandle

Minimum viable example

const handle = game.resources.acquire(texture, (resource) => resource.release());
renderer.draw_texture(handle.read());
handle.release();

Scope and limitations

Scene ownership automation and multi-scene asset policies are deferred.