Struct glium::Frame [] [src]

pub struct Frame {
    // some fields omitted
}

Implementation of Surface, targeting the default framebuffer.

The back- and front-buffers are swapped when you call finish.

You must call either finish or set_finish or else the destructor will panic.

Methods

impl Frame

fn new(context: Rc<Context>, dimensions: (u32, u32)) -> Frame

Builds a new Frame. Use the draw function on Display instead of this function.

fn finish(self) -> Result<(), SwapBuffersError>

Stop drawing, swap the buffers, and consume the Frame.

See the documentation of SwapBuffersError about what is being returned.

fn set_finish(&mut self) -> Result<(), SwapBuffersError>

Stop drawing, swap the buffers.

The Frame can now be dropped regularly. Calling finish() or set_finish() again will cause Err(SwapBuffersError::AlreadySwapped) to be returned.

Trait Implementations

impl Surface for Frame

fn clear(&mut self, rect: Option<&Rect>, color: Option<(f32, f32, f32, f32)>, color_srgb: bool, depth: Option<f32>, stencil: Option<i32>)

fn get_dimensions(&self) -> (u32, u32)

fn get_depth_buffer_bits(&self) -> Option<u16>

fn get_stencil_buffer_bits(&self) -> Option<u16>

fn draw<'a, 'b, V, I, U>(&mut self, vertex_buffer: V, index_buffer: I, program: &Program, uniforms: &U, draw_parameters: &DrawParameters) -> Result<(), DrawError> where I: Into<IndicesSource<'a>>, U: Uniforms, V: MultiVerticesSource<'b>

fn blit_color<S>(&self, source_rect: &Rect, target: &S, target_rect: &BlitTarget, filter: MagnifySamplerFilter) where S: Surface

fn blit_from_frame(&self, source_rect: &Rect, target_rect: &BlitTarget, filter: MagnifySamplerFilter)

fn blit_from_simple_framebuffer(&self, source: &SimpleFrameBuffer, source_rect: &Rect, target_rect: &BlitTarget, filter: MagnifySamplerFilter)

fn blit_from_multioutput_framebuffer(&self, source: &MultiOutputFrameBuffer, source_rect: &Rect, target_rect: &BlitTarget, filter: MagnifySamplerFilter)

fn clear_color(&mut self, red: f32, green: f32, blue: f32, alpha: f32)

fn clear_color_srgb(&mut self, red: f32, green: f32, blue: f32, alpha: f32)

fn clear_depth(&mut self, value: f32)

fn clear_stencil(&mut self, value: i32)

fn clear_color_and_depth(&mut self, color: (f32, f32, f32, f32), depth: f32)

fn clear_color_srgb_and_depth(&mut self, color: (f32, f32, f32, f32), depth: f32)

fn clear_color_and_stencil(&mut self, color: (f32, f32, f32, f32), stencil: i32)

fn clear_color_srgb_and_stencil(&mut self, color: (f32, f32, f32, f32), stencil: i32)

fn clear_depth_and_stencil(&mut self, depth: f32, stencil: i32)

fn clear_all(&mut self, color: (f32, f32, f32, f32), depth: f32, stencil: i32)

fn clear_all_srgb(&mut self, color: (f32, f32, f32, f32), depth: f32, stencil: i32)

fn has_depth_buffer(&self) -> bool

fn has_stencil_buffer(&self) -> bool

fn blit_whole_color_to<S>(&self, target: &S, target_rect: &BlitTarget, filter: MagnifySamplerFilter) where S: Surface

fn fill<S>(&self, target: &S, filter: MagnifySamplerFilter) where S: Surface

impl Drop for Frame

fn drop(&mut self)