Skip to content

Commit

Permalink
add option to pass external buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
georgik committed Sep 19, 2023
1 parent 471247c commit 6b82e9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ pub struct Display2in13 {

impl Display2in13 {
/// Create a black & white display buffer
pub fn bw() -> Self {
pub fn bw_with_buffer(buffer:[u8; buffer_len(WIDTH as usize, HEIGHT as usize)]) -> Self {
Display2in13 {
buffer: [Color::White.get_byte_value(); buffer_len(WIDTH as usize, HEIGHT as usize)],
buffer,
rotation: DisplayRotation::default(),
is_inverted: true,
}
Expand Down

0 comments on commit 6b82e9c

Please sign in to comment.