Struct glin::fbo::Fbo[][src]

pub struct Fbo<C = ColorAttachment, D = DepthAttachment> { /* fields omitted */ }

Wrapper for an OpenGL frame buffer object

Contains a depth attachment and optionally 1 or more color attachments

Implementations

impl<C, D> Fbo<C, D>[src]

pub fn with_depth<'a, D2: BorrowDepthAttach>(
    &'a self,
    depth: D2
) -> Result<Fbo<&'a C, D2>> where
    &'a C: BorrowColorAttach
[src]

pub fn with_colors<'a, C2: BorrowColorAttach>(
    &'a self,
    colors: Vec<C2>
) -> Result<Fbo<C2, &'a D>> where
    &'a D: BorrowDepthAttach
[src]

pub fn with_colors_no_depth<C2>(&self, colors: Vec<C2>) -> Result<Fbo<C2>> where
    C2: BorrowColorAttach
[src]

pub fn with<C2, D2, DD>(
    &self,
    colors: Vec<C2>,
    depth: DD
) -> Result<Fbo<C2, D2>> where
    C2: BorrowColorAttach,
    D2: BorrowDepthAttach,
    DD: Into<Option<D2>>, 
[src]

impl<C, D> Fbo<C, D>[src]

pub fn blit<C2, D2>(
    &self,
    fbo2: &mut Fbo<C2, D2>,
    src_rect: &Rect,
    dst_rect: &Rect
)
[src]

Copy the contents of the color attachments of this Fbo to dst

From the src_rect rectangle to dst_rect

pub fn blit_color_attachment<C2, D2>(
    &self,
    attachment: u32,
    fbo2: &mut Fbo<C2, D2>,
    src_rect: &Rect,
    dst_rect: &Rect
)
[src]

Copy the contents of the color attachments of this Fbo to dst

From the src_rect rectangle to dst_rect

pub fn blit_depth<C2, D2>(
    &self,
    fbo2: &mut Fbo<C2, D2>,
    src_rect: &Rect,
    dst_rect: &Rect
)
[src]

Copy the contents of the depth attachments of this Fbo to dst

From the src_rect rectangle to dst_rect

pub fn invalidate_color(&self)[src]

pub fn invalidate_depth(&self)[src]

pub fn id(&self) -> GLuint[src]

GL id

pub fn color(&self, idx: usize) -> Option<&C>[src]

Returns the color attachent idx if it exists

pub fn depth(&self) -> Option<&D>[src]

Returns the depth attachent

pub fn into_attachments(self) -> (Vec<C>, Option<D>)[src]

pub unsafe fn read_to<T>(
    &self,
    x: i32,
    y: i32,
    width: i32,
    height: i32,
    format: GLenum,
    ty: GLenum,
    pixels: &mut [T]
)
[src]

pub unsafe fn read_to_buffer<T, B: BufferRange<T>>(
    &self,
    x: i32,
    y: i32,
    width: i32,
    height: i32,
    format: GLenum,
    ty: GLenum,
    buffer: &mut B
)
[src]

impl<C: BorrowColorAttach, D: BorrowDepthAttach> Fbo<C, D>[src]

pub fn viewport(&self) -> Rect[src]

Returns the default viewport for this Fbo

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

Returns the width for this Fbo

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

Returns the height for this Fbo

pub fn aspect_ratio(&self) -> f32[src]

Returns the aspect ratio for this Fbo

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

Returns the width and height for this Fbo

impl<C: Borrow<ColorAttachment>, D: Borrow<DepthAttachment>> Fbo<C, D>[src]

pub fn color_tex(&self, idx: usize) -> Option<&Texture>[src]

Returns the color attachent idx’s texture if it exists

pub fn color_cubemap(&self, idx: usize) -> Option<&CubeMap>[src]

Returns the color attachent idx’s cubemap if it exists

pub fn depth_tex(&self) -> Option<&Texture>[src]

Returns the depth attachment texture if it exists

pub fn depth_cubemap(&self) -> Option<&CubeMap>[src]

Returns the depth attachment cubemap if it exists

impl<C: BorrowMut<ColorAttachment>, D: BorrowMut<DepthAttachment>> Fbo<C, D>[src]

pub fn color_tex_mut(&mut self, idx: usize) -> Option<&mut Texture>[src]

Mutably returns the color attachent idx’s texture if it exists

pub fn depth_tex_mut(&mut self) -> Option<&mut Texture>[src]

Mutably returns the depth attachment texture if it exists

Trait Implementations

impl<C: Debug, D: Debug> Debug for Fbo<C, D>[src]

impl<'a, C: BorrowColorAttach, D: BorrowDepthAttach> OffscreenBuffer for Fbo<C, D>[src]

type ColorAttach = C

type DepthAttach = D

impl<'a, C: BorrowColorAttach, D: BorrowDepthAttach> OffscreenBuffer for &'a Fbo<C, D>[src]

type ColorAttach = C

type DepthAttach = D

Auto Trait Implementations

impl<C = ColorAttachment, D = DepthAttachment> !RefUnwindSafe for Fbo<C, D>

impl<C = ColorAttachment, D = DepthAttachment> !Send for Fbo<C, D>

impl<C = ColorAttachment, D = DepthAttachment> !Sync for Fbo<C, D>

impl<C, D> Unpin for Fbo<C, D> where
    C: Unpin,
    D: Unpin

impl<C = ColorAttachment, D = DepthAttachment> !UnwindSafe for Fbo<C, D>

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[src]

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

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

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

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

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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.