diff --git a/ctru-rs/examples/gfx_wide_mode.rs b/ctru-rs/examples/gfx-wide-mode.rs similarity index 62% rename from ctru-rs/examples/gfx_wide_mode.rs rename to ctru-rs/examples/gfx-wide-mode.rs index f4ba365..ac84d60 100644 --- a/ctru-rs/examples/gfx_wide_mode.rs +++ b/ctru-rs/examples/gfx-wide-mode.rs @@ -1,7 +1,6 @@ extern crate ctru; use ctru::console::Console; -use ctru::gfx::Screen; use ctru::services::hid::KeyPad; use ctru::services::{Apt, Hid}; use ctru::Gfx; @@ -11,7 +10,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 mut _console = Console::init(gfx.top_screen.borrow_mut()); println!("Press A to enable/disable wide screen mode."); @@ -23,7 +22,13 @@ fn main() { } if hid.keys_down().contains(KeyPad::KEY_A) { - gfx.set_wide_mode(!gfx.get_wide_mode()); + drop(_console); + + let wide_mode = gfx.top_screen.borrow().get_wide_mode(); + gfx.top_screen.borrow_mut().set_wide_mode(!wide_mode); + + _console = Console::init(gfx.top_screen.borrow_mut()); + println!("Press A to enable/disable wide screen mode."); } gfx.flush_buffers();