From 38fef1630991101123cf22dbe747cd251bbe67f1 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 21 Jan 2022 14:26:13 +0100 Subject: [PATCH] Simple examples working with new Screen impl --- ctru-rs/examples/buttons.rs | 4 ++-- ctru-rs/examples/hello-both-screens.rs | 6 +++--- ctru-rs/examples/software-keyboard.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index 36127cd..152ede6 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -1,5 +1,5 @@ use ctru::console::Console; -use ctru::gfx::{Gfx, Screen}; +use ctru::gfx::Gfx; use ctru::services::apt::Apt; use ctru::services::hid::{Hid, KeyPad}; @@ -9,7 +9,7 @@ fn main() { let apt = Apt::init().unwrap(); let hid = Hid::init().unwrap(); let gfx = Gfx::default(); - let console = Console::init(&gfx, Screen::Top); + let console = Console::init(gfx.top_screen.borrow_mut()); println!("Hi there! Try pressing a button"); println!("\x1b[29;16HPress Start to exit"); diff --git a/ctru-rs/examples/hello-both-screens.rs b/ctru-rs/examples/hello-both-screens.rs index 180b1b2..67113a3 100644 --- a/ctru-rs/examples/hello-both-screens.rs +++ b/ctru-rs/examples/hello-both-screens.rs @@ -1,5 +1,5 @@ use ctru::console::Console; -use ctru::gfx::{Gfx, Screen}; +use ctru::gfx::Gfx; use ctru::services::apt::Apt; use ctru::services::hid::{Hid, KeyPad}; @@ -11,11 +11,11 @@ fn main() { let gfx = Gfx::default(); // Start a console on the top screen - let top_screen = Console::init(&gfx, Screen::Top); + let top_screen = Console::init(gfx.top_screen.borrow_mut()); // Start a console on the bottom screen. // The most recently initialized console will be active by default - let bottom_screen = Console::init(&gfx, Screen::Bottom); + let bottom_screen = Console::init(gfx.bottom_screen.borrow_mut()); // Let's print on the top screen first top_screen.select(); diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index b3b9347..6be9e81 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -1,6 +1,6 @@ use ctru::applets::swkbd::{Button, Swkbd}; use ctru::console::Console; -use ctru::gfx::{Gfx, Screen}; +use ctru::gfx::Gfx; use ctru::services::apt::Apt; use ctru::services::hid::{Hid, KeyPad}; @@ -9,7 +9,7 @@ fn main() { let apt = Apt::init().unwrap(); let hid = Hid::init().unwrap(); let gfx = Gfx::default(); - let _console = Console::init(&gfx, Screen::Top); + let _console = Console::init(gfx.top_screen.borrow_mut()); println!("Press A to enter some text or press Start to quit");