Page 3 of 26

Minor modifications

Posted: Sat Feb 27, 2010 7:46 pm
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

A ScreenShot of Irrlicht on android

Posted: Sun Feb 28, 2010 1:22 am
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

Posted: Sun Feb 28, 2010 2:08 am
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.

Resized Avatar

Posted: Sun Feb 28, 2010 2:37 am
by slytron
Sorry about the large avatar size. I resized it. Is it ok now?

Posted: Sun Feb 28, 2010 7:14 pm
by Dorth
Sure, thanks for the quick update ^^

Posted: Sun Feb 28, 2010 7:54 pm
by roguetreasure
Changed my login name from slytron to roguetreasure to reflect my website name and because slytron seems to have some bad connotation.

Posted: Tue Mar 09, 2010 9:15 am
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?

Posted: Wed Mar 10, 2010 1:11 am
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/

Posted: Wed Mar 10, 2010 8:45 am
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?

Posted: Wed Mar 10, 2010 10:41 am
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!

libGLESv1_CM.so must be present in your NDK

Posted: Wed Mar 10, 2010 10:49 am
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

Posted: Wed Mar 10, 2010 12:14 pm
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?

NDK versions

Posted: Wed Mar 10, 2010 1:13 pm
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.

Posted: Thu Mar 11, 2010 1:59 pm
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();
}

here is irrlicht in motoroy !!

Posted: Fri Mar 12, 2010 12:13 pm
by gbox