Struct luminance::framebuffer::Framebuffer [−][src]
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]
impl Framebuffer<Flat, Dim2, (), ()>
pub fn back_buffer(size: <Dim2 as Dimensionable>::Size) -> Self
[src]
pub fn back_buffer(size: <Dim2 as Dimensionable>::Size) -> Self
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]
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>,
pub fn new<C>(
ctx: &mut C,
size: D::Size,
mipmaps: usize
) -> Result<Framebuffer<L, D, CS, DS>, FramebufferError> where
C: GraphicsContext,
[src]
pub fn new<C>(
ctx: &mut C,
size: D::Size,
mipmaps: usize
) -> Result<Framebuffer<L, D, CS, DS>, FramebufferError> where
C: GraphicsContext,
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]
pub fn width(&self) -> u32
pub fn height(&self) -> u32
[src]
pub fn height(&self) -> u32
pub fn color_slot(&self) -> &CS
[src]
pub fn color_slot(&self) -> &CS
pub fn depth_slot(&self) -> &DS
[src]
pub fn depth_slot(&self) -> &DS
Trait Implementations
impl<L: Debug, D: Debug, CS: Debug, DS: Debug> Debug for Framebuffer<L, D, CS, DS> where
L: Layerable,
D: Dimensionable,
D::Size: Copy,
CS: ColorSlot<L, D>,
DS: DepthSlot<L, D>,
[src]
impl<L: Debug, D: Debug, CS: Debug, DS: Debug> Debug for Framebuffer<L, D, CS, DS> where
L: Layerable,
D: Dimensionable,
D::Size: Copy,
CS: ColorSlot<L, D>,
DS: DepthSlot<L, D>,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
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]
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>,