# `CauldronGPU.Host.Record`
[🔗](https://github.com/jaman/cauldron/blob/v0.3.3/cauldron_gpu/lib/cauldron_gpu/host/record.ex#L1)

The scene a host renderer holds, rebuilt from the changes sent to it: meshes, textures
and materials, instances with their latest transform and pose, lights, camera,
environment, effects, light styles, overlay, screen tint and 2D layers. `replay/1` lists the changes that give a new renderer the same
scene.

A released mesh, texture or material stays while a kept instance, pose, material,
overlay or layer names it, and is replayed followed by its drop.

# `key`

```elixir
@type key() :: {CauldronGPU.Handle.kind(), CauldronGPU.Stream.id()}
```

# `t`

```elixir
@type t() :: %CauldronGPU.Host.Record{
  camera: CauldronGPU.Camera.t() | nil,
  effects: [atom()] | nil,
  environment: CauldronGPU.Environment.t() | nil,
  instances: %{required(CauldronGPU.Stream.id()) =&gt; CauldronGPU.Instance.t()},
  layers: CauldronGPU.Stream.change() | nil,
  light_styles: [number() | {number(), number(), number()}] | nil,
  lights: %{required(CauldronGPU.Stream.id()) =&gt; CauldronGPU.Light.t()},
  overlay: CauldronGPU.Stream.change() | nil,
  poses: %{required(CauldronGPU.Stream.id()) =&gt; CauldronGPU.Pose.t()},
  released: MapSet.t(key()),
  resources: %{required(key()) =&gt; CauldronGPU.Stream.change()},
  screen_tint: CauldronGPU.Stream.change() | nil
}
```

# `apply_changes`

```elixir
@spec apply_changes(t(), [CauldronGPU.Stream.change()]) :: t()
```

The record after `changes` were sent.

# `new`

```elixir
@spec new() :: t()
```

An empty record.

# `release`

```elixir
@spec release(t(), CauldronGPU.Handle.kind(), CauldronGPU.Stream.id()) :: t()
```

The record after the object `kind`/`id` was released.

# `replay`

```elixir
@spec replay(t()) :: [CauldronGPU.Stream.change()]
```

The changes that rebuild the recorded scene in a renderer that has none of it.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
