SFML community forums
General => General discussions => Topic started by: bcvz on January 01, 2017, 12:05:03 am
-
Hello,
I was looking at the sfml source code trying to understand how it works
But i am having hard time to figure out how you implemented android
Normally you need a native activity, and you need to get an 'android_app' struct like shown in the doc:
https://developer.android.com/reference/android/app/NativeActivity.html
you need to specify a function for handling inputs, and commands to the 'android_app'
I am researching through your github code and I cannot find any trace of 'android_app' or responding to commands like losing focus, gaining focus. You need the reinit the context when you regain focus, (APP_CMD_GAINED_FOCUS command) , reload textures because they can be lost to when it goes to idle.
Where did you hide these stuff ? ???
-
SFML doesn't use the Android native app glue thingy but instead implemented the interface on its own. Check the "main" submodule in the source directory. On Android sfml-main provides the wrapper around the otherwise native main() entry point and sfml-activity is the actual native activity started by the user.
The whole thing is subject to change, because to be honest I don't really like it the way it's done right now, but it's the usual lack of time problem. :)