logo
pub struct Framebuffer<B, D, CS, DS> where
    B: ?Sized + FramebufferBackend<D>,
    D: Dimensionable,
    CS: ColorSlot<B, D>,
    DS: DepthStencilSlot<B, D>, 
{ /* private fields */ }
Expand description

Typed framebuffers.

Parametricity

Implementations

Create a new Framebuffer.

The mipmaps argument allows to pass the number of extra precision layers the texture will be created with. A precision layer contains the same image as the base layer but in a lower resolution. Currently, the way the resolution is computed depends on the backend, but it is safe to assume that it’s logarithmic in base 2 — i.e. at each layer depth, the resolution is divided by 2 on each axis.

Errors

It is possible that the Framebuffer cannot be created. The FramebufferError provides the reason why.

Notes

You might be interested in the GraphicsContext::new_framebuffer function instead, which is the exact same function, but benefits from more type inference (based on &mut C).

Get the size of the framebuffer.

Access the carried color slot’s texture(s).

Access the carried depth/stencil slot’s texture.

Consume this framebuffer and return the carried slots’ texture(s).

Consume this framebuffer and return the carried ColorSlot::ColorTextures.

Consume this framebuffer and return the carried DepthStencilSlot::DepthStencilTexture.

Get the back buffer from the input context and the required resolution.

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

Returns the argument unchanged.

Calls U::from(self).

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

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.