Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: I don't understand how you implemented android  (Read 2063 times)

0 Members and 1 Guest are viewing this topic.

bcvz

  • Newbie
  • *
  • Posts: 17
    • View Profile
I don't understand how you implemented android
« 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 ?  ???

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 878
    • View Profile
Re: I don't understand how you implemented android
« Reply #1 on: January 01, 2017, 07:20:43 pm »
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. :)