-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add egui example #48
base: master
Are you sure you want to change the base?
Add egui example #48
Conversation
I think this PR is ready to be merged now - I still haven't tested this on iOS (because I lack the capacity to) and the virtual keyboard is not working, but it's dependant or future changes in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the great work! This all looks good, so I'll test this on Android and iOS and report back.
@@ -3,6 +3,7 @@ | |||
<!-- Base application theme. --> | |||
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar"> | |||
<!-- Customize your theme here. --> | |||
<item name="android:windowFullscreen">true</item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's so that apps are in fullscreen by default and the status bar doesn't overlay the app's content (which I've seen was also an issue in other examples, such as the wgpu one)
Here I go! Oh...
It doesn't look there's any upstream traction on this. If you'd like, you can just mark iOS as unsupported with a comment explaining why: cargo-mobile/src/apple/config/mod.rs Lines 74 to 75 in c75c985
|
I managed to fix that by disabing the default features for Can you please try again now @francesca64 ? |
Now it builds fine, but crashes immediately:
This originates down in the metal-rs crate: https://github.com/gfx-rs/metal-rs/blob/140c8f4e39001ae154f153ffc767da6c0c9d7f06/src/library.rs#L572-L575 The device I'm testing on is running iOS 13.1.2, which should support that, as far as I can tell. This was added to wgpu quite recently: gfx-rs/wgpu#2372 The equivalent logic in MoltenVK dynamically checks if the selector is supported, as opposed to checking the version like in the wgpu PR, which could be significant: https://github.com/KhronosGroup/MoltenVK/blob/101ea9eec158717c38c448d313d3c6452f8b327c/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm#L3781-L3783 @ArthurKValladares can you try to run this too? I'm curious if this is device-dependent. |
Runs fine on my device on iOS 15.2.1. |
Thanks for investigating this, I definitely wouldn't have figured out the root cause of that issue. What can we do about it though? Since that fix has been added to wgpu recently, could you please try using the |
this work is probably already out of date at this point, but can I help get this merged? as I need it for my project anyways and Id so like to contribute back to this project! |
Oh wow, I didn't think somebody would need this :D I don't know if you're aware but this project isn't really maintained much anymore, you're probably better off using https://github.com/tauri-apps/tauri-mobile which is a more active fork. If you need egui I can port this PR over there and try to get it merged. Just give me a day or two. |
Yes! My autism wants to create a mobile app in Rust and egui is what we already are used to and can use efficiently |
This example is (partially) functional right now, at least on Android, but there are a couple of bugs and QOL stuff that I think need to be addressed before merging this PR:
It is currently borked on desktop (unresponsive and resize fails with "Dropped frame with error: The underlying surface has changed, and therefore the swap chain must be updated")Weird workaround with waiting for NativeActivityWeird resolution at the start, which is fixed when rotating the screen (edit: I found out that the resolution is actually set correctly, but the(fixed!)scale_factor
ofwinit::Window
is incorrectly reported as 1.0 at the start. This was fixed in this PR for winit but we still need to wait for a full winit release and for new winit version to be changed inegui_winit
soo untill that I guess this PR is blocked :x )Crash when leaving the app in the backgroundStatus bar overlays the app which leads to some content not being interactable(fixed by enabling fullscreen by default)Update egui_wgpu_backend version when a new one is published with egui 0.15