SFML community forums
General => Feature requests => Topic started by: Astrof 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?
-
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++.
-
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.
-
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)?
-
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.
-
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.
-
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).
-
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/ )