bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.24k stars 3.58k forks source link

Add a feature to switch NativeActivity and GameActivity for winit in bevy_winit #12058

Closed Litttlefish closed 1 month ago

Litttlefish commented 8 months ago

What problem does this solve or what need does it fill?

I saw #12026 so I forked one and edited bevy_winit to use GameActivity. After compile my game runs smoothly without changes to the code.

But NativeActivity is still useful, so I think bevy can add an option to switch that.

What solution would you like?

Add an option to switch winit between GameActivity and NativeActivity on android.

These two are already implemented properly(?) on winit and android-activity, just need an extra feature to control them.

Litttlefish commented 8 months ago

Addendum: I think bevy can remove default option and add two features to select between them, just like how winit and android-activity does, but this is probably a breaking change.

BD103 commented 8 months ago

I added a comment here. Bevy is generally fine with breaking changes, I'm more concerned that a crate feature is not the right solution.

How is GameActivity / NativeActivity configured in winit?

Litttlefish commented 8 months ago

I added a comment here. Bevy is generally fine with breaking changes, I'm more concerned that a crate feature is not the right solution.

How is GameActivity / NativeActivity configured in winit?

By features, need to pick one when using, just like how android-activity crate does. So I think if breaking the default action is fine, it should be fine to pass the same behavior down just like what winit and android-activity crate did.