1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! What proves that a game's set holds a type, what proves that its input
//! set seats an action, and the marker every set trait is sealed by.
/// Proves that a set holds `T`, and turns a `T` into it.
///
/// Written by [`meshes!`](crate::meshes),
/// [`surface_styles!`](crate::surface_styles) and
/// [`post_effects!`](crate::post_effects) for every type they name. Every
/// call that takes a value of a game's own set is bound by it:
/// [`draw`](crate::FrameContext::draw), both `prepare` calls,
/// [`Instance::surface_style`](crate::mesh::Instance::surface_style),
/// [`set_surface_style`](crate::FrameContext::set_surface_style) and
/// [`set_post_effect`](crate::FrameContext::set_post_effect). A game spells
/// one bound per type, in its own code that draws, or sets a style or
/// effect, for any [`Game`](crate::Game).
///
/// ```
/// use mirage_engine::prelude::*;
///
/// fn draw_cube<G: Game>(ctx: &mut FrameContext<'_, G>, at: Vec3)
/// where
/// G::Meshes: Holds<Cube>,
/// {
/// ctx.draw(Cube.at(at));
/// }
/// ```
/// Proves that one of an [`InputActions`](crate::InputActions) set's three
/// kinds seats `A`.
///
/// Written by the engine for every input set, so a game writes it for none
/// of its own. The input queries,
/// [`rebind`](crate::FrameContext::rebind) and
/// [`bindings`](crate::FrameContext::bindings) are bound by it. `B` is the
/// kind's binding type; it keeps the three kinds apart, since nothing
/// proves a set's three kinds are three different types.
/// [`Meshes`](crate::Meshes), [`ShaderValues`](crate::ShaderValues),
/// [`SurfaceStyles`](crate::SurfaceStyles) and
/// [`PostEffects`](crate::PostEffects) are sealed by this, which the set
/// macros write for every set they write and
/// [`ShaderValues`](macro@crate::ShaderValues) for every value struct, so
/// nothing outside the engine implements a set trait.