Rust wrapper for libctru
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
892 B

use ctru::prelude::*;
fn main() {
ctru::init();
let apt = Apt::init().unwrap();
let hid = Hid::init().unwrap();
let gfx = Gfx::init().unwrap();
let mut console = Console::init(gfx.top_screen.borrow_mut());
println!("Press A to enable/disable wide screen mode.");
while apt.main_loop() {
hid.scan_input();
if hid.keys_down().contains(KeyPad::KEY_START) {
break;
}
if hid.keys_down().contains(KeyPad::KEY_A) {
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();
gfx.swap_buffers();
gfx.wait_for_vblank();
}
}