@ -1,6 +1,5 @@
use std::convert::TryInto;
use std::iter::once;
use std::mem::MaybeUninit;
use std::str;
use libctru::{
@ -92,11 +91,9 @@ impl Swkbd {
/// (from 1-3).
pub fn init(keyboard_type: Kind, num_buttons: i32) -> Self {
unsafe {
let mut state = MaybeUninit::<SwkbdState>::uninit();
let mut state = Box::new(SwkbdState::default());
swkbdInit(state.as_mut_ptr(), keyboard_type as u32, num_buttons, -1);
swkbdInit(state.as_mut(), keyboard_type as u32, num_buttons, -1);
Swkbd {
Swkbd { state }
state: Box::new(state.assume_init()),
}
@ -1,5 +1,4 @@
use std::default::Default;
use libctru::{consoleClear, consoleInit, consoleSelect, consoleSetWindow, PrintConsole};
@ -15,12 +14,10 @@ impl Console {
/// printing.
pub fn init(screen: Screen) -> Self {
let mut context = MaybeUninit::<PrintConsole>::uninit();
let mut context = Box::new(PrintConsole::default());
consoleInit(screen.into(), context.as_mut_ptr());
consoleInit(screen.into(), context.as_mut());
Console {
Console { context }
context: Box::new(context.assume_init()),
@ -15,6 +15,7 @@ bindgen "$DEVKITPRO/libctru/include/3ds.h" \
--blacklist-type "__builtin_va_list" \
--blacklist-type "__va_list" \
--opaque-type "MiiData" \
--with-derive-default \
-- \
--target=arm-none-eabi \
--sysroot=$DEVKITARM/arm-none-eabi \