I'm currently attempting to call the controllers functions as seen here in order to get a list of connected controllers on mac. I'm attempting to achieve this with the following code:
use objc::{class, msg_send, sel, sel_impl};
use objc::runtime::{BOOL, Object};
fn main() {
unsafe {
let class = class!(GCController);
let selector = sel!(controllers);
let obj: *mut Object = msg_send![class, new];
let _: *mut Object = msg_send![class, selector];
// Even void methods must have their return type annotated
let _: () = msg_send![obj, release];
}
}
However, it fails as follows:
thread 'main' panicked at 'Class with name GCController could not be found', src/main.rs:6:21
stack backtrace:
0: rust_begin_unwind
at /rustc/2f3ddd9f594adf9773547aa7cedb43c4ac8ffd2f/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/2f3ddd9f594adf9773547aa7cedb43c4ac8ffd2f/library/core/src/panicking.rs:142:14
2: objc_test::main
at ./src/main.rs:6:21
3: core::ops::function::FnOnce::call_once
at /rustc/2f3ddd9f594adf9773547aa7cedb43c4ac8ffd2f/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
How do I link against the Controllers framework to get this to work? Also, any advice for calling functions would be incredibly appreciated.
I'm currently attempting to call the controllers functions as seen here in order to get a list of connected controllers on mac. I'm attempting to achieve this with the following code:
However, it fails as follows:
How do I link against the Controllers framework to get this to work? Also, any advice for calling functions would be incredibly appreciated.