Android Port
Minor modifications
I push on git:
- CFileSystem.cpp to handle file
- An Utils class to put files from assets to /sdcard (like slytron)
With theses fixes, you can try particules engine, load 3ds files, load .irr scene and more
Have fun
- CFileSystem.cpp to handle file
- An Utils class to put files from assets to /sdcard (like slytron)
With theses fixes, you can try particules engine, load 3ds files, load .irr scene and more
Have fun
A ScreenShot of Irrlicht on android
Here is a screenshot of irrlicht spinning a world in android emulator (21 FPS )
On my Motrola Droid Phone it gets 53 FPS
If anyone finds optimizations I would be very interested.
On my Motrola Droid Phone it gets 53 FPS
If anyone finds optimizations I would be very interested.
android apps and games at http://www.roguetreasure.com
Resized Avatar
Sorry about the large avatar size. I resized it. Is it ok now?
android apps and games at http://www.roguetreasure.com
-
- Posts: 13
- Joined: Sun Feb 28, 2010 3:01 pm
- Location: Oklahoma
- Contact:
Changed my login name from slytron to roguetreasure to reflect my website name and because slytron seems to have some bad connotation.
android apps and games http://www.roguetreasure.com
-
- Posts: 13
- Joined: Sun Feb 28, 2010 3:01 pm
- Location: Oklahoma
- Contact:
pera.. this is a question better answered by ellis but I'll give it a try
1.) What OS are you attempting to build with? linux or windows with cygwin
2.) What happens when you try make APP=hello-jni
If it compiles or says Nothing to be done for all your compiler is probably setup correctly else go back and review the steps for installing the ndk
3.) I dont know what the python script is for. ellis might have the answer but it is not needed to build irrlichtandroid using command line make
4.) In the Android.mk file in the apps/irrlicht/project/jni directory
make sure the line
LOCAL_CFLAGS := -O3 -DANDROID_NDK -DDISABLE_IMPORTGL -Iapps/irrlicht/project/include/
has the correct path to the irrlicht include files. for instance if you actually put the irrlichtandroid as checked out from git to
ndkrootdirectory/apps/irrlichtandroid/
then the line should read
LOCAL_CFLAGS := -O3 -DANDROID_NDK -DDISABLE_IMPORTGL -Iapps/irrlichtandroid/project/include/
1.) What OS are you attempting to build with? linux or windows with cygwin
2.) What happens when you try make APP=hello-jni
If it compiles or says Nothing to be done for all your compiler is probably setup correctly else go back and review the steps for installing the ndk
3.) I dont know what the python script is for. ellis might have the answer but it is not needed to build irrlichtandroid using command line make
4.) In the Android.mk file in the apps/irrlicht/project/jni directory
make sure the line
LOCAL_CFLAGS := -O3 -DANDROID_NDK -DDISABLE_IMPORTGL -Iapps/irrlicht/project/include/
has the correct path to the irrlicht include files. for instance if you actually put the irrlichtandroid as checked out from git to
ndkrootdirectory/apps/irrlichtandroid/
then the line should read
LOCAL_CFLAGS := -O3 -DANDROID_NDK -DDISABLE_IMPORTGL -Iapps/irrlichtandroid/project/include/
android apps and games http://www.roguetreasure.com
UPDATE: I managed to start the build with cygwin: I had to copy jni folder to source/irrlicht, (apps/irrlicht just needs that Application.mk, nothing else) then its Android.mk gets pulled and it starts building irrlicht lib. However, i encounter various errors about Open GL constants, after investigation, I realize there is no GLES/gl.h file and open gl library. I coped those h files (GLES and KHR dirs) from Linux Android framework, and it all compiles fine, but it dies on linking - of course it needs opengl library.
error is "ld: cannot find -lGLESv1_CM"
So now I need to figure out how to get that library linked. Any ideas are welcome.
Im trying to make this work in Cygwin because I have Linux only at work!
error is "ld: cannot find -lGLESv1_CM"
So now I need to figure out how to get that library linked. Any ideas are welcome.
Im trying to make this work in Cygwin because I have Linux only at work!
libGLESv1_CM.so must be present in your NDK
Hi,
I'm working on OS X and i don't use Cygwin. Your problem is related to the libGLESv1_CM.so. This library is provided by the NDK. On my NDK, i have this file present in:
./build/platforms/android-4/arch-arm/usr/lib/libGLESv1_CM.so
I'm working on OS X and i don't use Cygwin. Your problem is related to the libGLESv1_CM.so. This library is provided by the NDK. On my NDK, i have this file present in:
./build/platforms/android-4/arch-arm/usr/lib/libGLESv1_CM.so
I guess I have some older NDK then! I have only /build/platforms/android-1.5 !!
However, I copied libGLESv1_CM.so to proper dir, changed some stuff in Android.mk and I managed to build libirrlicht.so!!
I run apk and it crashes cause I don't have mesh, i guess..
EDIT: when I manually copy sydney to sdcard/irrlicht it works, but there is some utility code that copies mesh from somewhere to sdcard - so where should I put sydney with activity?
thanks for reply. Do you want zip of cygwin configuration?
However, I copied libGLESv1_CM.so to proper dir, changed some stuff in Android.mk and I managed to build libirrlicht.so!!
I run apk and it crashes cause I don't have mesh, i guess..
EDIT: when I manually copy sydney to sdcard/irrlicht it works, but there is some utility code that copies mesh from somewhere to sdcard - so where should I put sydney with activity?
thanks for reply. Do you want zip of cygwin configuration?
NDK versions
Hi, this is just a remark but NDK version aren't bound to SDK versions. With last SDK you can build App for Android 1.5. The current limit is that OpenGL ES 2.0 is available to Android 2.0 but Irrlicht port don't use this version. So please use last NDK version.
-
- Posts: 13
- Joined: Sun Feb 28, 2010 3:01 pm
- Location: Oklahoma
- Contact:
pera, I posted the code to copy meshes etc from your assets folder to the sdcard in a earlier post on this thread.
It would be a good Idea though to change it so it copies to a folder in the sd card instead of the root of the sdcard.
Be sure you have this line in your AndroidManifest.xml
Here is some code to make a directory
In my game I copy all files from the assets folder to /sdcard/dtw
then on game startup in c++ code I do something like
It would be a good Idea though to change it so it copies to a folder in the sd card instead of the root of the sdcard.
Be sure you have this line in your AndroidManifest.xml
Code: Select all
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Code: Select all
boolean VxCreateDirectory( String strDirPath ) throws IOException
{
boolean bDirCreated = false;
File testDir = new File(strDirPath);
bDirCreated = testDir.mkdirs();
if( false == bDirCreated)
{
//Log.i(LOG_TAG, "ERROR: Create Directory failed " + strDirPath);
}
return bDirCreated;
}
then on game startup in c++ code I do something like
Code: Select all
// add earth sphere
log_msg( 0, "getting earth mesh\n");
irr::scene::IAnimatedMesh* poEarthMesh = m_poSceneMgr->getMesh("/sdcard/dtw/sphere.x");
if (poEarthMesh )
{
log_msg( 0, "creating earth\n");
irr::scene::ISceneNode* poEarthNode = m_poSceneMgr->addMeshSceneNode( poEarthMesh );
if( NULL == poEarthNode)
{
log_msg( 0, "Failed getting earth node");
}
irr::video::ITexture* poTexture = m_poDriver->getTexture("/sdcard/dtw/earth.jpg");
if( NULL == poTexture)
{
log_msg( 0, "Failed getting earth texture");
}
poEarthNode->setMaterialTexture(0, poTexture);
poEarthNode->setMaterialFlag(irr::video::EMF_LIGHTING, false);
//m_poEarthNode->setRotation( irr::core::vector3df(0.0f, 30.0f, 0.0f) );
irr::scene::ISceneNodeAnimator* anim = m_poSceneMgr->createRotationAnimator(irr::core::vector3df(0,0.3f,0));
poEarthNode->addAnimator(anim);
anim->drop();
}
android apps and games http://www.roguetreasure.com