From 0b16ff38b816707081aa30fc13635e9032691bf0 Mon Sep 17 00:00:00 2001 From: AzureMarker Date: Thu, 6 Jan 2022 17:27:57 -0800 Subject: [PATCH] Update examples so they build I tested all of these and they work. --- ctru-rs/examples/buttons.rs | 1 + ctru-rs/examples/hello-both-screens.rs | 1 + ctru-rs/examples/hello-world.rs | 1 + ctru-rs/examples/software-keyboard.rs | 1 + 4 files changed, 4 insertions(+) diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index 6395620..7d00765 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -7,6 +7,7 @@ use ctru::services::hid::{Hid, KeyPad}; fn main() { // Setup services + ctru::init(); let apt = Apt::init().unwrap(); let hid = Hid::init().unwrap(); let gfx = Gfx::default(); diff --git a/ctru-rs/examples/hello-both-screens.rs b/ctru-rs/examples/hello-both-screens.rs index 33229ea..84e9f31 100644 --- a/ctru-rs/examples/hello-both-screens.rs +++ b/ctru-rs/examples/hello-both-screens.rs @@ -7,6 +7,7 @@ use ctru::services::hid::{Hid, KeyPad}; fn main() { // Initialize services + ctru::init(); let apt = Apt::init().unwrap(); let hid = Hid::init().unwrap(); let gfx = Gfx::default(); diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index 73afa22..ced5e4b 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -9,6 +9,7 @@ fn main() { // Initialize ctrulib service handles. // Service handles are internally reference-counted. When all instances of a // service handle go out of scope, the service will be closed. + ctru::init(); // The APT service handles application management functions, such as enabling sleep // mode and jumping to the home menu or to other applications diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index cb1b058..3312dbb 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -7,6 +7,7 @@ use ctru::services::hid::{Hid, KeyPad}; use ctru::applets::swkbd::{Swkbd, Button}; fn main() { + ctru::init(); let apt = Apt::init().unwrap(); let hid = Hid::init().unwrap(); let gfx = Gfx::default();