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

Author Topic: SFML on Android using NDK?  (Read 11015 times)

0 Members and 1 Guest are viewing this topic.

Astrof

  • Full Member
  • ***
  • Posts: 135
    • View Profile
SFML on Android using NDK?
« on: April 21, 2010, 04:47:22 am »
I'm planning on getting a new phone soon and will probably get an Android phone.  I was wondering, would it be possible to port SFML to Android using the Android NDK?  What would be needed for this venture?

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
SFML on Android using NDK?
« Reply #1 on: April 21, 2010, 08:34:00 am »
I think android runs on java so this may not be possible (without a binding).

You might be better off trying the iphone or something that uses C/C++.

Walker

  • Full Member
  • ***
  • Posts: 181
    • View Profile
SFML on Android using NDK?
« Reply #2 on: April 21, 2010, 08:50:11 am »
I think the "NDK" allows you to use C/C++.

I guess an early thing to do would be learning OpenGLES, if you already know OpenGL it shouldn't be too hard but I'm not entirely sure on the differences. I think I recall hearing that the NeHe tutorials got ported to Android.

I'm just thinking that porting SFML to a platform like this might end up being very different code/written from scratch and maybe you should look at just borrowing some code from SFML rather than porting it.

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
SFML on Android using NDK?
« Reply #3 on: April 21, 2010, 12:04:45 pm »
Well if it's like the psp there are certain hardware specific functions for things like memory management that need to be exploited for performance.

"The NDK  allows you to implement parts of your applications using native-code languages such as C and C++"

"The NDK  will not benefit most applications. As a developer, you will need to balance its benefits against its drawbacks; notably, using native code does not result in an automatic performance increase, but does always increase application complexity"

"Please note that the NDK does not enable you to develop native-only applications. Android's primary runtime remains the Dalvik virtual machine."

http://developer.android.com/sdk/ndk/index.html

You're pretty much stuck with java.

However it does use OpenGL ES like a lot of other products, maybe a port of SFML for OpenGL ES would be a feasible starting point (once Laurent is happy with the OpenGL version)?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML on Android using NDK?
« Reply #4 on: April 21, 2010, 06:50:17 pm »
Using something other than OpenGL (such as OpenGL ES) may not be possible, I have to adapt the way the graphics & window modules work to make it possible.

This is something that is planned for a future major version.
Laurent Gomila - SFML developer

Klaim

  • Full Member
  • ***
  • Posts: 137
    • View Profile
SFML on Android using NDK?
« Reply #5 on: April 18, 2011, 02:38:51 pm »
Hi, I'm resurecting the topic because I just discovered that : http://code.google.com/p/vs-android/

And I'd like to know if people around here did try to use it and to simply use SFML libs (without audio I guess?) to compile in this environnement?

I'm looking for a way to make simple games using C++ on android but I'm discovering th eenvironnement just now.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML on Android using NDK?
« Reply #6 on: April 18, 2011, 02:46:22 pm »
Interesting. However the SFML window and graphics modules won't run on Android without major internal modifications, since it requires OpenGL ES 2.0 compliant code (correct me if I'm wrong).
Laurent Gomila - SFML developer

Klaim

  • Full Member
  • ***
  • Posts: 137
    • View Profile
SFML on Android using NDK?
« Reply #7 on: April 20, 2011, 11:23:32 am »
Well it looks like there is OpenGL support but I'm not sure wich version is available on the platform (and it's OpenGLES) : http://code.google.com/p/vs-android/wiki/UsageExample

I can't use SFML immediately then, but I will take a look at it later. The nice thing is that Android developpement "looks" easy to setup. I'll give feedback and thought next week (I'll participate to http://artgameweekend.com/ )

 

anything