Closed ArthurKValladares closed 11 months ago
Is there a inherent reason why this app pointer is not accessible trough the
native-activity
module? My application currently relies on someNativeActivity
functionality, and from the gpg::AndroidInitialization documentation it seems like it should be possible to obtain theandroid_app*
while still using a NativeActivity.
Because native-activity
implements the glue layer in pure Rust rather than cross-compiling the C code like game-activity
. Hence there's no android_app
type which belongs to this glue layer, and there is instead a similar struct to store similar members in Rust'y form.
In fact, all that function probably does is pull out the three arguments for gpg::AndroidInitialization::ANativeActivity_onCreate()
from struct android_app
:
Thank you, I understand it now.
Hello,
I currently use this crate trough winit to initialize my Rust Android project, and I am running into some trouble getting the
AndroidApp
api to work with theGooglePlayGames
library that I need to use in my game (trough C ffi). The library gpg allows us to use 3 different initialization functions, two of them I see can be made to match either theandroid-activity
or thenative-activity
modules: https://developers.google.com/games/services/cpp/api/struct/gpg/android-initializationwhich has the same signature as the entry point for
native-activity
:or:
which has the same signature as the entry-point for
game-activity
:The second part of the gpg API comes in the
AndroidPlarformConfiguration::SetActivity
function, where I must pass in an activity that will be active for the lifetime of your application: https://developers.google.com/games/services/cpp/api/class/gpg/android-platform-configuration#classgpg_1_1_android_platform_configuration_1a88c2011548eb4329c38f2a11e35c787cThe only way I currently see to set this activity is by using the
android_app*
pointer passed in to us trough thegame-activity
module.:Is there a inherent reason why this app pointer is not accessible trough the
native-activity
module? My application currently relies on someNativeActivity
functionality, and from the gpg::AndroidInitialization documentation it seems like it should be possible to obtain theandroid_app*
while still using a NativeActivity.I don't need support for this specific behavior to be supported in the crate itself, I'm more than happy to add a declaration like:
to a local branch so I can call the C ffi initialization code from a app-side defined function. I would just appreciate some more context into how to make this work, and some pointers on what to do if the best course of action is modifying a local branch.
Thank you so much, and sorry for the very long and specific issue.