Skip to main content

meshes

Macro meshes 

Source
macro_rules! meshes {
    ($(#[$attribute:meta])* $vis:vis enum $set:ident { $($mesh:ident),+ $(,)? }) => { ... };
}
Expand description

Writes the set of every mesh a game draws: an enum with one variant wrapping each named type, which Game::Meshes names.

Each type is named by its own name and must be in scope; a type named twice, and a type that implements Mesh for two part vocabularies, each fail to compile here. The set holds itself as well as every type it names, so a draw into_set turned into the set is drawn too. A pub before enum makes the enum public, and /// lines before that are the enum’s.

use mirage_engine::prelude::*;

meshes! { enum Shape { Cube, Sphere } }