Struct framebuffer::Framebuffer [] [src]

pub struct Framebuffer {
    pub device: File,
    pub frame: Mmap,
    pub var_screen_info: VarScreeninfo,
    pub fix_screen_info: FixScreeninfo,
}

Struct that should be used to work with the framebuffer. Direct usage of frame should not be necessary.

Fields

device
frame
var_screen_info
fix_screen_info

Methods

impl Framebuffer

fn new(path_to_device: &str) -> Result<Framebuffer, FramebufferError>

fn write_frame(&mut self, frame: &[u8])

Writes a frame to the Framebuffer.

fn get_fix_screeninfo(device: &File) -> Result<FixScreeninfo, FramebufferError>

Creates a FixScreeninfo struct and fills it using ioctl.

fn get_var_screeninfo(device: &File) -> Result<VarScreeninfo, FramebufferError>

Creates a VarScreeninfo struct and fills it using ioctl.

fn put_var_screeninfo(device: &File, screeninfo: &VarScreeninfo) -> Result<i32, FramebufferError>

fn set_kd_mode(kd_mode: KdMode) -> Result<i32, FramebufferError>

Sets the tty graphics mode. Make sure to change it back to KdMode::Text after the program is done!