# `CauldronGPU.Target`
[🔗](https://github.com/jaman/cauldron/blob/v0.3.3/cauldron_gpu/lib/cauldron_gpu/target.ex#L1)

Anything a scene can be sent to: a `CauldronGPU` renderer in the VM, a
`CauldronGPU.Host` in its own process, or a browser scene (`Cauldron3D.Net.Scene`).
The converters (`CauldronGPU.Bsp`, `CauldronGPU.AliasModel`, `CauldronGPU.StudioModel`,
`CauldronGPU.Sectors`) upload through it, so they work with every one.

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `canvas`

```elixir
@spec canvas(t(), CauldronGPU.Canvas.t()) :: CauldronGPU.Handle.t()
```

Makes a canvas, a texture drawn into by 2D layers, and returns its handle.

# `material`

```elixir
@spec material(t(), CauldronGPU.Material.t()) :: CauldronGPU.Handle.t()
```

Defines a material and returns its handle.

# `mesh`

```elixir
@spec mesh(t(), CauldronGPU.Mesh.t()) :: CauldronGPU.Handle.t()
```

Uploads a mesh and returns its handle.

# `release`

```elixir
@spec release(t(), CauldronGPU.Handle.t()) :: :ok
```

Lets the target free a mesh, texture or material once no scene entry uses it. A
`CauldronGPU` renderer frees a handle's object when the handle is no longer
referenced, and answers `:ok` here.

# `submit`

```elixir
@spec submit(t(), [CauldronGPU.Stream.change()]) :: :ok | {:error, term()}
```

Sends one tick of changes (`CauldronGPU.Stream`).

# `texture`

```elixir
@spec texture(t(), CauldronGPU.Texture.t()) :: CauldronGPU.Handle.t()
```

Uploads a texture and returns its handle.

---

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