Will main callbacks make their way to the Rust bindings? #86
LouChiSoft
started this conversation in
General
Replies: 3 comments 5 replies
-
Yes the new main callbacks are supported! They should be better documented though. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Would be great if someone could add examples and documentation of using it |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, me again. I had some time to try this out and I still haven't managed to get it working. Unfortunately the error message is simply "expected function" without any further detail. I was wondering if I could get some help with it: Example code: use sdl3_main;
use std::os::raw::c_void;
struct SDLApplication;
impl SDLApplication {
#[sdl3_main::app_init]
pub fn app_init(appstate: *mut *mut c_void) -> sdl3_main::AppResult {
sdl3_main::AppResult::Continue
}
#[sdl3_main::app_iterate]
pub fn app_interate() -> sdl3_main::AppResult {
sdl3_main::AppResult::Continue
}
#[sdl3_main::app_event]
pub fn app_event() -> sdl3_main::AppResult {
sdl3_main::AppResult::Continue
}
#[sdl3_main::app_quit]
pub fn app_quit() {
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I know the crate page lists adding SDL3 features to the crate, but figured I would ask about this one specifically because it's not a simple as "create a binding to the C api" like the rest of the package since it makes heavy use of the C pre-processor and textual include to define the main function in the app that includes
SDL_main.h
Not sure how you planned to port it, assuming you are, but it is something I have enjoyed using in the C++ application I have been writing and would like to use them in Rust as well
Beta Was this translation helpful? Give feedback.
All reactions