/cargo-mobile-experiment

Just playing around with cargo mobile

Primary LanguageRust

wgpu-app

This is just the wgpu-rs triangle example with a handful of small changes, which I'll outline below:

  • Annotated main with #[mobile_entry_point], which generates all the extern functions we need for mobile. Note that the name of the function doesn't actually matter for this.
  • Changes conditionally compiled on Android:

To run this on desktop, just do cargo run like normal! For mobile, use cargo android run and cargo apple run respectively (or use cargo android open/cargo apple open to open in Android Studio and Xcode respectively).