mirror of
https://github.com/LegitCamper/picocalc-os-rs.git
synced 2025-12-28 08:15:59 +00:00
split screen logic into seprate crate for testing
This commit is contained in:
9
simulator/Cargo.toml
Normal file
9
simulator/Cargo.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "simulator"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
embedded-graphics = "0.8.1"
|
||||
embedded-graphics-simulator = "0.7.0"
|
||||
shared = { path = "../shared" }
|
||||
32
simulator/src/main.rs
Normal file
32
simulator/src/main.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
#![feature(ascii_char)]
|
||||
|
||||
use embedded_graphics::{
|
||||
geometry::Size,
|
||||
mono_font::{
|
||||
MonoFont, MonoTextStyle,
|
||||
ascii::{FONT_6X9, FONT_10X20},
|
||||
},
|
||||
pixelcolor::{BinaryColor, Rgb565},
|
||||
prelude::{Point, WebColors, *},
|
||||
primitives::{Circle, Line, PrimitiveStyle, Rectangle},
|
||||
text::{Alignment, Baseline, Text, TextStyle},
|
||||
};
|
||||
use embedded_graphics_simulator::{
|
||||
BinaryColorTheme, OutputSettingsBuilder, SimulatorDisplay, Window,
|
||||
};
|
||||
|
||||
use shared::{SCREEN_HEIGHT, SCREEN_WIDTH, TextBuffer};
|
||||
|
||||
fn main() -> Result<(), core::convert::Infallible> {
|
||||
let mut display =
|
||||
SimulatorDisplay::<Rgb565>::new(Size::new(SCREEN_WIDTH as u32, SCREEN_HEIGHT as u32));
|
||||
|
||||
let mut textbuffer = TextBuffer::new();
|
||||
textbuffer.fill('A');
|
||||
textbuffer.draw(&mut display);
|
||||
|
||||
let output_settings = OutputSettingsBuilder::new().build();
|
||||
Window::new("Hello World", &output_settings).show_static(&display);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user