rust-mobile / rust-android-examples

Various standalone Rust Android examples
112 stars 21 forks source link

Avoid unnecessary zeroing out in na-mainloop #12

Open JohnScience opened 1 year ago

JohnScience commented 1 year ago

As I was assessing the maturity of Rust for mobile development, I tried different things.

I used na-mainloop example as a template for https://github.com/JohnScience/rust_android_native_activity.

While I was working on it, I noticed a few bad practices:

My take on it is here.

My code is worse because it assumes R8G8B8A8_UNORM but "It works on my machine" TM and I've noticed there's a pull request with some code that ensures R8G8B8A8_UNORM buffer format, and I'm likely to use it soon.