[][src]Struct luminance::framebuffer::Framebuffer

pub struct Framebuffer<L, D, CS, DS> where
    L: Layerable,
    D: Dimensionable,
    D::Size: Copy,
    CS: ColorSlot<L, D>,
    DS: DepthSlot<L, D>, 
{ /* fields omitted */ }

Framebuffer with static layering, dimension, access and slots formats.

A Framebuffer is a GPU special object used to render to. Because framebuffers have a layering property, it’s possible to have regular render and layered rendering. The dimension of a framebuffer makes it possible to render to 1D, 2D, 3D and cubemaps.

A framebuffer has two kind of slots:

  • color slot ;
  • depth slot.

A framebuffer can have zero or several color slots and it can have zero or one depth slot. If you use several color slots, you’ll be performing what’s called MRT (M ultiple R ender T argets), enabling to render to several textures at once.

Methods

impl Framebuffer<Flat, Dim2, (), ()>[src]

pub fn back_buffer<C>(ctx: &mut C, size: <Dim2 as Dimensionable>::Size) -> Self where
    C: GraphicsContext
[src]

Get the back buffer with the given dimension.

impl<L, D, CS, DS> Framebuffer<L, D, CS, DS> where
    L: Layerable,
    D: Dimensionable,
    D::Size: Copy,
    CS: ColorSlot<L, D>,
    DS: DepthSlot<L, D>, 
[src]

pub fn new<C>(
    ctx: &mut C,
    size: D::Size,
    mipmaps: usize
) -> Result<Framebuffer<L, D, CS, DS>, FramebufferError> where
    C: GraphicsContext
[src]

Create a new farmebuffer.

You’re always handed at least the base level of the texture. If you require any additional levels, you can pass the number via the mipmaps parameter.

pub fn width(&self) -> u32[src]

Width of the framebuffer.

pub fn height(&self) -> u32[src]

Height of the framebuffer.

pub fn color_slot(&self) -> &CS::ColorTextures[src]

Access the underlying color slot.

pub fn depth_slot(&self) -> &DS::DepthTexture[src]

Access the underlying depth slot.

Trait Implementations

impl<L, D, CS, DS> Drop for Framebuffer<L, D, CS, DS> where
    L: Layerable,
    D: Dimensionable,
    D::Size: Copy,
    CS: ColorSlot<L, D>,
    DS: DepthSlot<L, D>, 
[src]

Auto Trait Implementations

impl<L, D, CS, DS> Unpin for Framebuffer<L, D, CS, DS> where
    D: Unpin,
    L: Unpin,
    <CS as ColorSlot<L, D>>::ColorTextures: Unpin,
    <DS as DepthSlot<L, D>>::DepthTexture: Unpin

impl<L, D, CS, DS> !Sync for Framebuffer<L, D, CS, DS>

impl<L, D, CS, DS> !Send for Framebuffer<L, D, CS, DS>

impl<L, D, CS, DS> !UnwindSafe for Framebuffer<L, D, CS, DS>

impl<L, D, CS, DS> !RefUnwindSafe for Framebuffer<L, D, CS, DS>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]