Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
m
rust-card10
Commits
cee35266
Commit
cee35266
authored
Aug 24, 2019
by
Astro
⚙
Browse files
l0dable: add FrameBuffer.clear()
parent
f11e8033
Changes
1
Hide whitespace changes
Inline
Side-by-side
l0dable/src/framebuffer/mod.rs
View file @
cee35266
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment