Struct zaplib::Pass

source · []
pub struct Pass {
    pub pass_id: Option<usize>,
}
Expand description

A rendering context e.g. for doing 3d rendering.

Useful if you need:

  • A different set of top-level uniforms (see [PassUniforms]).
  • To render into a Texture, which you can then manipulate to your liking.

Passes are nested, with each [CxWindow] having a [CxWindow::main_pass_id] that renders directly to the screen.

Fields

pass_id: Option<usize>

Implementations

This starts a Pass.

This will automatically add color and depth Textures, since most of the time that is what you’d want. If not, then please use Pass::begin_pass_without_textures.

Note that if you don’t call this at all during a draw cycle, then the Pass will stick around and you can still e.g. change its camera using Pass::set_matrix_mode, which will cause a repaint. Similarly you can still write to shaders within this Pass using Area::get_slice_mut, which will also cause a repaint.

TODO(JP): Decide whether this is a bug or a feature. At the very least there currently no way to clean up a Pass, so that is definitely a bug. We might want to make that the default behavior, and have an explicit method to keep a cached Pass around?

Same as Pass::begin_pass, but doesn’t add Textures automatically.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.