Commit cee35266 authored by Astro's avatar Astro
Browse files

l0dable: add FrameBuffer.clear()

parent f11e8033
......@@ -30,6 +30,17 @@ impl<'d> FrameBuffer<'d> {
}
}
pub fn clear(&mut self, color: RawColor) {
for y in 0..Display::H {
for x in 0..Display::W {
let bytes: &mut RawColor = unsafe {
transmute(&mut self.buffer.fb[y as usize][x as usize])
};
*bytes = color;
}
}
}
pub fn text<'a, 'f>(&'a mut self, x: isize, y: isize, font: &'f Font, color: RawColor) -> TextRenderer<'a, 'd, 'f> {
TextRenderer {
framebuffer: self,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment