Android Port

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
ellis2323
Posts: 37
Joined: Fri Feb 05, 2010 5:33 pm

Minor modifications

Post by ellis2323 »

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
slytron
Posts: 10
Joined: Wed Oct 15, 2008 1:19 am
Contact:

A ScreenShot of Irrlicht on android

Post by slytron »

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.

Image
android apps and games at http://www.roguetreasure.com
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

slytron, could you make your avatar a bit slimmer? It's wide enough to difform the forum, you could just crop the left.
slytron
Posts: 10
Joined: Wed Oct 15, 2008 1:19 am
Contact:

Resized Avatar

Post by slytron »

Sorry about the large avatar size. I resized it. Is it ok now?
android apps and games at http://www.roguetreasure.com
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Sure, thanks for the quick update ^^
roguetreasure
Posts: 13
Joined: Sun Feb 28, 2010 3:01 pm
Location: Oklahoma
Contact:

Post by roguetreasure »

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
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

I have problem building this with ndk.
I copied irrlichtandroid folder to ndk/apps and run make APP=irrlichtandroid and i got error "No rule to make target 'irrlicht', needed by 'ndk-app-irrlichtandroid'. stop."
what should i do?
what is that pyton script for?
roguetreasure
Posts: 13
Joined: Sun Feb 28, 2010 3:01 pm
Location: Oklahoma
Contact:

Post by roguetreasure »

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/
android apps and games http://www.roguetreasure.com
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

thanks for answer.

1) its windows cygwin ndk1.6 environment
2) make APP= other apps works fine!
4) its set ok.

do you have some irrlicht code in Source dir of NDK, or just Apps dir?

what is "ToRebuild" for?
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

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!
ellis2323
Posts: 37
Joined: Fri Feb 05, 2010 5:33 pm

libGLESv1_CM.so must be present in your NDK

Post by ellis2323 »

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
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

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?
ellis2323
Posts: 37
Joined: Fri Feb 05, 2010 5:33 pm

NDK versions

Post by ellis2323 »

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.
roguetreasure
Posts: 13
Joined: Sun Feb 28, 2010 3:01 pm
Location: Oklahoma
Contact:

Post by roguetreasure »

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

Code: Select all

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
Here is some code to make a directory

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;
	}
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

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
gbox
Posts: 37
Joined: Mon May 01, 2006 3:41 am
Location: jeonju, korea
Contact:

here is irrlicht in motoroy !!

Post by gbox »

http://cafe.naver.com/jcga

professor of Jelabukdo Game Engine Academy
Post Reply