From d021da0c6f9402d0caee6f589f689d707a4c4691 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 13 Jan 2022 11:25:28 +0100 Subject: [PATCH] Fixed examples for latest Console changes --- .gitignore | 4 +--- ctru-rs/examples/buttons.rs | 2 +- ctru-rs/examples/gfx_wide_mode.rs | 2 +- ctru-rs/examples/hello-both-screens.rs | 4 ++-- ctru-rs/examples/hello-world.rs | 3 +-- ctru-rs/examples/software-keyboard.rs | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index ec2f1a6..c34b8d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ target Cargo.lock - -.idea/ - +.cargo diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index 23986da..4c7fd60 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -9,7 +9,7 @@ fn main() { let apt = Apt::init().unwrap(); let hid = Hid::init().unwrap(); let gfx = Gfx::default(); - let console = Console::default(); + let console = Console::init(&gfx, ctru::gfx::Screen::Top); println!("Hi there! Try pressing a button"); println!("\x1b[29;16HPress Start to exit"); diff --git a/ctru-rs/examples/gfx_wide_mode.rs b/ctru-rs/examples/gfx_wide_mode.rs index 67b8efb..8572f33 100644 --- a/ctru-rs/examples/gfx_wide_mode.rs +++ b/ctru-rs/examples/gfx_wide_mode.rs @@ -11,7 +11,7 @@ fn main() { let apt = Apt::init().unwrap(); let hid = Hid::init().unwrap(); let gfx = Gfx::default(); - let _console = Console::init(Screen::Top); + let _console = Console::init(&gfx, ctru::gfx::Screen::Top); println!("Press A to enable/disable wide screen mode."); diff --git a/ctru-rs/examples/hello-both-screens.rs b/ctru-rs/examples/hello-both-screens.rs index 51f04d8..22a1783 100644 --- a/ctru-rs/examples/hello-both-screens.rs +++ b/ctru-rs/examples/hello-both-screens.rs @@ -11,11 +11,11 @@ fn main() { let gfx = Gfx::default(); // Start a console on the top screen - let top_screen = Console::init(Screen::Top); + let top_screen = Console::init(&gfx, ctru::gfx::Screen::Top); // Start a console on the bottom screen. // The most recently initialized console will be active by default - let bottom_screen = Console::init(Screen::Bottom); + let bottom_screen = Console::init(&gfx, ctru::gfx::Screen::Bottom); // Let's print on the top screen first top_screen.select(); diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index 68f6f38..7f76266 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -21,8 +21,7 @@ fn main() { // Initialize a ctrulib console and direct standard output to it. // Consoles can be initialized on both the top and bottom screens. - // The top screen is initialized by default. - let _console = Console::default(); + let _console = Console::init(&gfx, ctru::gfx::Screen::Top); // Now we can print to stdout! println!("Hello, world!"); diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index 7b4e4ca..495f9c1 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -9,7 +9,7 @@ fn main() { let apt = Apt::init().unwrap(); let hid = Hid::init().unwrap(); let gfx = Gfx::default(); - let _console = Console::default(); + let _console = Console::init(&gfx, ctru::gfx::Screen::Top); println!("Press A to enter some text or press Start to quit");