mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
minor tweaks to improve the rendering of the bouncyball
This commit is contained in:
parent
2d5bd20c16
commit
a2670a7537
2 changed files with 3 additions and 5 deletions
|
|
@ -66,7 +66,7 @@ fn xmain() -> ! {
|
|||
}
|
||||
Opcode::Circle(mid, radius) => {
|
||||
info!("GFX: Drawing cicrle at {:?} radius {:?}", mid, radius);
|
||||
op::circle(display.native_buffer(), mid.x as _, mid.y as _, radius as _, 1, op::PixelColor::On);
|
||||
op::circle(display.native_buffer(), mid.x as _, mid.y as _, radius as _, 0, op::PixelColor::On);
|
||||
}
|
||||
Opcode::Style(stroke_width, stroke_color, fill_color) => {
|
||||
current_color = stroke_color;
|
||||
|
|
|
|||
|
|
@ -128,7 +128,6 @@ impl Bounce {
|
|||
fn shell_main() -> ! {
|
||||
timer::init();
|
||||
log_server::init_wait().unwrap();
|
||||
let mut loops = 0;
|
||||
|
||||
// let log_server_id = xous::SID::from_bytes(b"xous-logs-output").unwrap();
|
||||
let graphics_server_id = xous::SID::from_bytes(b"graphics-server ").unwrap();
|
||||
|
|
@ -227,14 +226,13 @@ fn shell_main() -> ! {
|
|||
info!("drawing string: {}", string_buffer);
|
||||
graphics_server::draw_string(graphics_conn, &string_buffer).expect("unable to draw string");
|
||||
|
||||
//ticktimer_server::sleep_ms(ticktimer_conn, 2000 + loops).expect("couldn't sleep");
|
||||
loops += 1;
|
||||
ticktimer_server::sleep_ms(ticktimer_conn, 2000).expect("couldn't sleep");
|
||||
|
||||
// draw the ball
|
||||
bouncyball.update();
|
||||
graphics_server::clear_region(graphics_conn,
|
||||
bouncyball.bounds.top_left().x as _, bouncyball.bounds.top_left().y as _,
|
||||
bouncyball.bounds.bottom_right().x as _, bouncyball.bounds.bottom_right().y as _)
|
||||
bouncyball.bounds.bottom_right().x as _, bouncyball.bounds.bottom_right().y as usize + 1)
|
||||
.expect("unable to clear region");
|
||||
graphics_server::draw_circle(
|
||||
graphics_conn,
|
||||
|
|
|
|||
Loading…
Reference in a new issue