Browse Source

Update examples so they build

I tested all of these and they work.
pull/10/head
AzureMarker 3 years ago
parent
commit
0b16ff38b8
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 1
      ctru-rs/examples/buttons.rs
  2. 1
      ctru-rs/examples/hello-both-screens.rs
  3. 1
      ctru-rs/examples/hello-world.rs
  4. 1
      ctru-rs/examples/software-keyboard.rs

1
ctru-rs/examples/buttons.rs

@ -7,6 +7,7 @@ use ctru::services::hid::{Hid, KeyPad};
fn main() { fn main() {
// Setup services // Setup services
ctru::init();
let apt = Apt::init().unwrap(); let apt = Apt::init().unwrap();
let hid = Hid::init().unwrap(); let hid = Hid::init().unwrap();
let gfx = Gfx::default(); let gfx = Gfx::default();

1
ctru-rs/examples/hello-both-screens.rs

@ -7,6 +7,7 @@ use ctru::services::hid::{Hid, KeyPad};
fn main() { fn main() {
// Initialize services // Initialize services
ctru::init();
let apt = Apt::init().unwrap(); let apt = Apt::init().unwrap();
let hid = Hid::init().unwrap(); let hid = Hid::init().unwrap();
let gfx = Gfx::default(); let gfx = Gfx::default();

1
ctru-rs/examples/hello-world.rs

@ -9,6 +9,7 @@ fn main() {
// Initialize ctrulib service handles. // Initialize ctrulib service handles.
// Service handles are internally reference-counted. When all instances of a // Service handles are internally reference-counted. When all instances of a
// service handle go out of scope, the service will be closed. // service handle go out of scope, the service will be closed.
ctru::init();
// The APT service handles application management functions, such as enabling sleep // The APT service handles application management functions, such as enabling sleep
// mode and jumping to the home menu or to other applications // mode and jumping to the home menu or to other applications

1
ctru-rs/examples/software-keyboard.rs

@ -7,6 +7,7 @@ use ctru::services::hid::{Hid, KeyPad};
use ctru::applets::swkbd::{Swkbd, Button}; use ctru::applets::swkbd::{Swkbd, Button};
fn main() { fn main() {
ctru::init();
let apt = Apt::init().unwrap(); let apt = Apt::init().unwrap();
let hid = Hid::init().unwrap(); let hid = Hid::init().unwrap();
let gfx = Gfx::default(); let gfx = Gfx::default();

Loading…
Cancel
Save