Struct RenderPass

Source
#[non_exhaustive]
pub struct RenderPass<'pass> { /* private fields */ }

Implementations§

Source§

impl<'pass> RenderPass<'pass>

Source

pub fn select_render_target(&mut self, target: &'pass Target<'_>) -> Result<()>

Select the given render target for the following draw calls.

§Errors

Fails if the given target cannot be used for drawing.

Source

pub fn buffer_info(&self) -> Option<Info>

Get the buffer info being used, if it exists.

§Notes

The resulting buffer::Info is copied (and not taken) from the one currently in use.

Source

pub fn set_buffer_info(&mut self, buffer_info: &Info)

Set the buffer info to use for for the following draw calls.

Source

pub fn attr_info(&self) -> Option<Info>

Get the attribute info being used, if it exists.

§Notes

The resulting attrib::Info is copied (and not taken) from the one currently in use.

Source

pub fn set_attr_info(&mut self, attr_info: &Info)

Set the attribute info to use for any following draw calls.

Source

pub fn draw_arrays(&mut self, primitive: Primitive, vbo_data: Slice<'pass>)

Render primitives from the current vertex array buffer.

§Panics

Panics if no shader program was bound (see RenderPass::bind_program).

Source

pub fn draw_elements<I: Index>( &mut self, primitive: Primitive, vbo_data: Slice<'pass>, indices: &Indices<'pass, I>, )

Draws the vertices in buf indexed by indices.

§Panics

Panics if no shader program was bound (see RenderPass::bind_program).

Source

pub fn bind_program(&mut self, program: &'pass Program)

Use the given shader::Program for the following draw calls.

Source

pub fn bind_light_env(&mut self, env: Option<Pin<&'pass mut LightEnv>>)

Binds a LightEnv for the following draw calls.

Source

pub fn bind_vertex_uniform(&mut self, index: Index, uniform: impl Into<Uniform>)

Bind a uniform to the given index in the vertex shader for the next draw call.

§Panics

Panics if no shader program was bound (see RenderPass::bind_program).

§Example
let idx = uniform::Index::from(0);
let mtx = Matrix4::identity();
instance.bind_vertex_uniform(idx, &mtx);
Source

pub fn bind_geometry_uniform( &mut self, index: Index, uniform: impl Into<Uniform>, )

Bind a uniform to the given index in the geometry shader for the next draw call.

§Panics

Panics if no shader program was bound (see RenderPass::bind_program).

§Example
let idx = uniform::Index::from(0);
let mtx = Matrix4::identity();
instance.bind_geometry_uniform(idx, &mtx);
Source

pub fn texenv(&mut self, stage: Stage) -> &mut TexEnv

Retrieve the TexEnv for the given stage, initializing it first if necessary.

§Example
let stage0 = texenv::Stage::new(0).unwrap();
let texenv0 = instance.texenv(stage0);

Trait Implementations§

Source§

impl Drop for RenderPass<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'pass> !Freeze for RenderPass<'pass>

§

impl<'pass> !RefUnwindSafe for RenderPass<'pass>

§

impl<'pass> !Send for RenderPass<'pass>

§

impl<'pass> !Sync for RenderPass<'pass>

§

impl<'pass> Unpin for RenderPass<'pass>

§

impl<'pass> !UnwindSafe for RenderPass<'pass>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.