Struct lux::window::Frame [] [src]

pub struct Frame {
    // some fields omitted
}

A frame is a render target that can be drawn on.

Because frame rendering will wait on vsync, you should - as the name implies - use one Frame instance per frame.

Trait Implementations

impl Drop for Frame

fn drop(&mut self)

impl Canvas for Frame

fn size(&self) -> (f32, f32)

fn width(&self) -> Float

fn height(&self) -> Float

fn clear<C: Color>(&mut self, color: C)

fn with_scissor<F, R>(&mut self, x: u32, y: u32, w: u32, h: u32, f: F) -> R where F: FnOnce(&mut Self) -> R

fn draw_to_stencil<R, S>(&mut self, typ: StencilType, stencil_fn: S) -> R where S: FnOnce(&mut Self) -> R

fn clear_stencil(&mut self, typ: StencilType)

fn rect<'a>(&'a mut self, x: Float, y: Float, w: Float, h: Float) -> Rectangle<'a, Self>

fn square<'a>(&'a mut self, x: Float, y: Float, size: Float) -> Rectangle<'a, Self>

fn ellipse<'a>(&'a mut self, x: Float, y: Float, w: Float, h: Float) -> Ellipse<'a, Self>

fn circle<'a>(&'a mut self, x: Float, y: Float, size: Float) -> Ellipse<'a, Self>

fn draw_point<C: Color>(&mut self, x: Float, y: Float, color: C)

fn draw_points(&mut self, pixels: &[ColorVertex])

fn draw_line(&mut self, _x1: Float, _y1: Float, _x2: Float, _y2: Float, _line_size: Float)

fn draw_lines<I: Iterator<Item=(Float, Float)>>(&mut self, _positions: I, _line_size: Float)

fn draw_arc(&mut self, _pos: (Float, Float), _radius: Float, _angle1: Float, _angle2: Float, _line_size: Float)

fn sprite(&mut self, sprite: &Sprite, x: Float, y: Float) -> ContainedSprite<Self>

impl Transform for Frame

fn current_matrix_mut(&mut self) -> &mut [[f32; 4]; 4]

fn current_matrix(&self) -> &[[f32; 4]; 4]

fn apply_matrix(&mut self, other: [[Float; 4]; 4]) -> &mut Self

fn translate(&mut self, dx: Float, dy: Float) -> &mut Self

fn scale(&mut self, sx: Float, sy: Float) -> &mut Self

fn shear(&mut self, sx: Float, sy: Float) -> &mut Self

fn rotate(&mut self, theta: Float) -> &mut Self

fn rotate_around(&mut self, point: (Float, Float), theta: Float) -> &mut Self

fn with_matrix<F, R>(&mut self, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_rotation<F, R>(&mut self, rotation: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_translate<F, R>(&mut self, dx: Float, dy: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_scale<F, R>(&mut self, scale_x: Float, scale_y: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_shear<F, R>(&mut self, sx: Float, sy: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_rotate_around<F, R>(&mut self, point: (Float, Float), theta: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

impl Colored for Frame

fn get_color(&self) -> [f32; 4]

fn color<C: Color>(&mut self, color: C) -> &mut Frame

fn with_color<F, C: Color>(&mut self, color: C, f: F) where F: FnOnce(&mut Self)

impl HasDisplay for Frame

fn borrow_display(&self) -> &Display

fn clone_display(&self) -> Display

impl HasFontCache for Frame

fn font_cache(&self) -> RefMut<FontCache>

impl HasSurface for Frame

type Out = Frame

fn surface(&mut self) -> &mut Self::Out

fn surface_and_texture_shader(&mut self) -> (&mut Self::Out, &Program)

fn surface_and_color_shader(&mut self) -> (&mut Self::Out, &Program)

impl HasDrawCache for Frame

fn color_draw_cache(&self) -> &Option<CachedColorDraw>

fn tex_draw_cache(&self) -> &Option<CachedTexDraw>

fn color_draw_cache_mut(&mut self) -> &mut Option<CachedColorDraw>

fn tex_draw_cache_mut(&mut self) -> &mut Option<CachedTexDraw>

impl HasPrograms for Frame

fn texture_shader(&self) -> &Program

fn color_shader(&self) -> &Program

impl Fetch<Vec<Idx>> for Frame

fn fetch(&self) -> Item<Vec<Idx>>

impl Fetch<Vec<TexVertex>> for Frame

fn fetch(&self) -> Item<Vec<TexVertex>>

impl Fetch<Vec<ColorVertex>> for Frame

fn fetch(&self) -> Item<Vec<ColorVertex>>

impl DrawParamMod for Frame

fn draw_param_mod(&self) -> &DrawParamModifier

fn draw_param_mod_mut(&mut self) -> &mut DrawParamModifier

fn scissor(&self) -> Option<(u32, u32, u32, u32)>

fn take_scissor(&mut self) -> Option<(u32, u32, u32, u32)>

fn set_scissor(&mut self, s: Option<(u32, u32, u32, u32)>)

fn stencil_state(&self) -> StencilState

fn set_stencil_state(&mut self, stencil_state: StencilState)