-
Notifications
You must be signed in to change notification settings - Fork 910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android redraw requests aren't implemented #1723
Comments
Thanks for reporting this! It looks like it was just punted: winit/src/platform_impl/android/mod.rs Lines 408 to 410 in be2e17d
I haven't seen any discussion indicating that it'd be thorny to implement; it's fairly simple on most platforms, albeit very platform-specific. A PR would be very welcome! |
@dvc94ch do you remember anything about this? |
Not sure what it's useful for. I guess setting an AtomicBool and calling looper.wake() should do the trick? |
@francesca64 I've been having an issue with this in my Android application, where the RedrawRequested event was never called and my scene would stay static after 2 frames, so I made my own small function that fixed it for me: pub fn request_redraw() {
match ndk_glue::native_window().as_ref() {
Some(native_window) => {
let a_native_window: *mut ndk_sys::ANativeWindow = native_window.ptr().as_ptr();
let a_native_activity: *mut ndk_sys::ANativeActivity =
ndk_glue::native_activity().ptr().as_ptr();
unsafe {
match (*(*a_native_activity).callbacks).onNativeWindowRedrawNeeded {
Some(callback) => callback(a_native_activity, a_native_window),
None => (),
};
};
}
None => (),
}
} I'm very new to Rust and Native Android development, is there anything wrong with my way of doing? |
winit/src/platform_impl/android/mod.rs
Line 408 in c9558c5
For now, implementing redraw in MainEventsCleared works. But I'm not sure what's supposed to go on here.
The text was updated successfully, but these errors were encountered: