Compiling irrlicht ogl-es branch for iphone (progress)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

FuzzYspo0N wrote:Keep in mind its a cellphone, too.

Performance is plenty available, its just a fine balance working to the best of the hardwares abilities (for example, destroying the CPU with 9 ninjas :P)
Oh, for sure.

But we've got to be able to render _some_ kind of animated character (or 5) on the screen at a time (along with the level and other things). I don't expect it to be the same solution as on the PC, but I need _a_ solution.
a screen cap is worth 0x100000 DWORDS
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well then, try a skeleton animated mesh with reduced number of joints/frames. What are the specs of your meshes?
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

I haven't tried bringing it into irrlicht yet, but for example: 14 bones for body and arms/legs ( plus 16 more for the pose-able hand version). 1634 verts for head, and 3644 verts for body (those might be in quads not tris), but those can be reduced as necessary.

Also, this is all in blender, which means I'm going to have to find a chain to export to a good format for irrlicht.
a screen cap is worth 0x100000 DWORDS
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, I guess that this is the top-max number of joints, and polys are much too high for typical mobile apps. it would be a little better with hw skinning support, but I'm not sure if we can get this into the ogl-es branch anytime soon.
Ti-R
Posts: 6
Joined: Tue Feb 03, 2009 9:34 am

Post by Ti-R »

Great jobs guys, I like irrlicht and I just install my Mac!

Just to clarify the steps to make it works very quickly for a non Mac user.

Extra Softwares:
Install Xcode with last iPhone SDK. ( http://developer.apple.com/iphone/ )
Install scplugin for your Mac to access svn. ( http://scplugin.tigris.org/ )

SVN:
Checkout svn at this address -> http://irrlicht.svn.sourceforge.net/svn ... hes/ogl-es
(Inside scplugin checkout: Select Recursive and Anonymous and Head Revision)

PATCH:
Apply patch if you need to:
Download the patch of Rockfish
http://www.rockfishnw.com/media/files/TouchEvents.zip
Unzip files and copy them into irrlicht
- source/Irrlicht/CSceneNodeAnimatorCameraTouch.h
- source/Irrlicht/CSceneNodeAnimatorCameraTouch.cpp
- source/Irrlicht/CIrrDeviceIPhone.h
- source/Irrlicht/CIrrDeviceIPhone.cpp
- source/Irrlicht/CIrrDeviceIPhone.m

- include/ISceneNodeAnimatorCameraTouch.h
- include/IEventReceiver.h
- include/ITouchControl.h
- include/irrlicht.h


XCODE:
Now we need to compile irrlicht for the iPhone, i didn't saw any other xcodeproject than the one inside
"source/Irrlicht/MacOSX/MacOSX.xcodeproj", it is not targeting iPhone but help a lot to start !!!
Let's convert it to build for iPhone :)

Open the xcode project.

First, search every ".mm" files and remove them from the project:
- AppDelegate.mm
- CIrrDeviceMacOSX.mm
- OSXClipboard.mm

Second, add a list of Files inside the project:
- source/Irrlicht/CSeneNodeAnimatorCameraTouch.h (Include it only if you apply the Rockfish patch)
- source/Irrlicht/CSeneNodeAnimatorCameraTouch.cpp (Include it only if you apply the Rockfish patch)
- source/Irrlicht/wglext.h
- source/Irrlicht/eglext.h
- source/Irrlicht/gles-ext.h
- source/Irrlicht/COGLESDriver.h
- source/Irrlicht/COGLESDriver.cpp
- source/Irrlicht/COGLESExtensionHandler.h
- source/Irrlicht/COGLESExtensionHandler.cpp
- source/Irrlicht/COGLESMaterialRenderer.h
- source/Irrlicht/COGLESTexture.h
- source/Irrlicht/COGLESTexture.cpp
- source/Irrlicht/CIrrDeviceIPhone.h
- source/Irrlicht/CIrrDeviceIPhone.cpp
- source/Irrlicht/CIrrDeviceIPhone.m

Third, launch "Get Info" on the MacOSX Project (on the top left of the Xcode window), select the "iPhone Simulator 3.x" inside "Base SDK for All Configurations"

Click on "Build and Run" in top center of the window.
Debugger should launch with an error on HelloWorld_dbg.app, it is normal !
Now irrlicht.a should be build inside this path:
- source/Irrlicht/MacOSX/build/Debug-iphonesimulator


Download the excellent template of FuzzYspo0N
http://www.mediafire.com/file/i1juyzy3m ... ateApp.zip
unzip it inside an empty folder
Copy the "irrlicht.a" inside the root of this folder and rename it "libIrrlichtdev.a"

Now open the iPhoneTemplateApp/irrlichtApplication.xcodeproj
Do "Get Info" on "libIrrlichtdev.a", Choose the new path (the file inside the root folder) and close the window the red file should be black now.
Do "Get Info" on "include" directory and pick the irrlicht include directory, now the include directory should be black too.

Launch "Get Info" on the irrlichtApplication Project (on the top left of the Xcode window), select the "iPhone Simulator 3.x" inside "Base SDK for All Configurations", same as before.

Hit Build and Run and you got irrlicht running inside your iPhone Simulator!

Enjoy it !
Felbel
Posts: 4
Joined: Sat Mar 27, 2010 12:14 am

Post by Felbel »

I just tried these steps and everything compiles fine as long as I DON'T patch the files. As soon as I patch I get 42 compile errors...

Irrlicht.cpp
CSceneNodeAnimatorCameraMaya.cpp
CIrrDeviceIPhone.m
COGLESDriver.cpp
COGLESExtensionHandler.cpp
COGLESTexture.cpp

These are the files with the compile errors. I'm wondering if the 1.7 release has already patched some of these files?

Also when I then try to use FuzzYspo0ns template I get 3 errors in UILocalizedIndexedCollation.h

Any insight would be great, I really want to mess around with Irrlicht on the iPhone.
Ti-R
Posts: 6
Joined: Tue Feb 03, 2009 9:34 am

Post by Ti-R »

Hello,

Can you post the first error message please to see if someone can help you (for the patch and for the FuzzYspo0ns template) ?


Did you check out from "http://irrlicht.svn.sourceforge.net/svn ... hes/ogl-es" ?
Felbel
Posts: 4
Joined: Sat Mar 27, 2010 12:14 am

Post by Felbel »

Sorry for the delay, I havent had a whole lot of spare time to mess with this...

First off the problem I was having with FuzzySpoons template was solved by looking through previous posts, I was compiling under Debug mode. As soon as I switched to Release everything compiled and ran just fine.

Yes, I checked out the source from "http://irrlicht.svn.sourceforge.net/svn ... hes/ogl-es"

After copying the files from the patch over to the source and include folders and then adding all the files into the XCode project and trying to compile I got 42 errors.

The following are the first 3 errors, found in the Irrlicht.cpp file

Code: Select all

/Users/Steve/Desktop/(15:04:2010)Irrlicht/(Patch)Irrlicht/source/Irrlicht/MacOSX/../Irrlicht.cpp: In function 'irr::IrrlichtDevice* irr::createDeviceEx(const irr::SIrrlichtCreationParameters&)':
/Users/Steve/Desktop/(15:04:2010)Irrlicht/(Patch)Irrlicht/source/Irrlicht/MacOSX/../Irrlicht.cpp:86: error: expected type-specifier before 'CIrrDeviceIPhone'
/Users/Steve/Desktop/(15:04:2010)Irrlicht/(Patch)Irrlicht/source/Irrlicht/MacOSX/../Irrlicht.cpp:86: error: cannot convert 'int*' to 'irr::IrrlichtDevice*' in assignment
/Users/Steve/Desktop/(15:04:2010)Irrlicht/(Patch)Irrlicht/source/Irrlicht/MacOSX/../Irrlicht.cpp:86: error: expected `;' before 'CIrrDeviceIPhone'
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

For those having trouble compiling the library using the rockfish patch, the rockfish patch doesn't compile due to changes in 1.7.1 (or maybe earlier version).

However I managed to find another version of the CirrDeviceIphone files list here

http://code.google.com/p/mahiruno-beta/ ... icht/?r=26

which do compile and work well. This version also supports multi-touch.
arranger1044
Posts: 2
Joined: Tue Jul 20, 2010 7:17 pm

Post by arranger1044 »

Garfinkle wrote:For those having trouble compiling the library using the rockfish patch, the rockfish patch doesn't compile due to changes in 1.7.1 (or maybe earlier version).

However I managed to find another version of the CirrDeviceIphone files list here

http://code.google.com/p/mahiruno-beta/ ... icht/?r=26

which do compile and work well. This version also supports multi-touch.
I am not able to compile it with those files instead , i get lots of errors : (
Could you repost a complete guide with the new files or the compiled library?
ty
frankneeew
Posts: 4
Joined: Wed Aug 04, 2010 11:56 pm

can't compile

Post by frankneeew »

Garfinkle wrote:For those having trouble compiling the library using the rockfish patch, the rockfish patch doesn't compile due to changes in 1.7.1 (or maybe earlier version).

However I managed to find another version of the CirrDeviceIphone files list here

http://code.google.com/p/mahiruno-beta/ ... icht/?r=26

which do compile and work well. This version also supports multi-touch.
hello i successfully compiled the branch opengl es. and i could run the fuzzy spoon template successfully but i m having trouble with rockfish patch. you said to get CirrDeviceIphone file from there and then add other changes of the rockFish patch (EventReciver.h ITouchControl.h ect...) but it dosen't seem the right way. please you can explain how to apply the RockFish Patch?? thank you .( i m getting crazy )
pmtolk
Posts: 8
Joined: Fri Jul 30, 2010 3:51 am

Post by pmtolk »

I am trying to get Fuzzy spoons template compiling.
I checked out the code here
svn co https://irrlicht.svn.sourceforge.net/sv ... hes/ogl-es irrlicht-ogl-es
Then I had to copy the zlib and libpng from the irrlciht 1.7/source into the iphone one

Then I deleted
First, search every ".mm" files and remove them from the project:
- AppDelegate.mm
- CIrrDeviceMacOSX.mm
- OSXClipboard.mm (only deleted this one)

Then, launch "Get Info" on the MacOSX Project (on the top left of the Xcode window), select the "iPhone Simulator 3.x" inside "Base SDK for All Configurations"

Click on "Build and Run" in top center of the window.
Debugger should launch with an error on HelloWorld_dbg.app, it is normal !
Now irrlicht.a should be build inside this path:
- source/Irrlicht/MacOSX/build/Debug-iphonesimulator

ok this worked

Download the excellent template of FuzzYspo0N
http://www.mediafire.com/file/i1juyzy3m ... ateApp.zip
unzip it inside an empty folder
Copy the "irrlicht.a" inside the root of this folder and rename it "libIrrlichtdev.a"

Now open the iPhoneTemplateApp/irrlichtApplication.xcodeproj
Do "Get Info" on "libIrrlichtdev.a", Choose the new path (the file inside the root folder) and close the window the red file should be black now.
Do "Get Info" on "include" directory and pick the irrlicht include directory, now the include directory should be black too.

OK got all of them except it wants a libIrrlichtsim.a????
And I get the following errors

Undefined symbols:
".objc_class_name_NSObject", referenced from:
.objc_class_name_irrlichtAppDelegate in irrlichtAppDelegate.o
"irr::video::createTRNormalMap(irr::video::CBurningVideoDriver*)", referenced from:
irr::video::CBurningVideoDriver::CBurningVideoDriver(irr::SIrrlichtCreationParameters const&, irr::io::IFileSystem*, irr::video::IImagePresenter*)in libIrrlichtdev.a(CSoftwareDriver2.o)
irr::video::CBurningVideoDriver::CBurningVideoDriver(irr::SIrrlichtCreationParameters const&, irr::io::IFileSystem*, irr::video::IImagePresenter*)in libIrrlichtdev.a(CSoftwareDriver2.o)
".objc_class_name_UIApplication", referenced from:
literal-pointer@__OBJC@__cls_refs@UIApplication in Application.o
".objc_class_name_UIView", referenced from:
.objc_class_name_EAGLView in EAGLView.o
"irr::io::CArchiveLoaderWAD::CArchiveLoaderWAD(irr::io::IFileSystem*)", referenced from:
irr::io::CFileSystem::CFileSystem()in libIrrlichtdev.a(CFileSystem.o)
irr::io::CFileSystem::CFileSystem()in libIrrlichtdev.a(CFileSystem.o)
".objc_class_name_NSTimer", referenced from:
literal-pointer@__OBJC@__cls_refs@NSTimer in irrlichtAppDelegate.o
".objc_class_name_NSNumber", referenced from:
literal-pointer@__OBJC@__cls_refs@NSNumber in EAGLView.o
"irr::video::createTRStencilShadow(irr::video::CBurningVideoDriver*)", referenced from:
irr::video::CBurningVideoDriver::CBurningVideoDriver(irr::SIrrlichtCreationParameters const&, irr::io::IFileSystem*, irr::video::IImagePresenter*)in libIrrlichtdev.a(CSoftwareDriver2.o)
irr::video::CBurningVideoDriver::CBurningVideoDriver(irr::SIrrlichtCreationParameters const&, irr::io::IFileSystem*, irr::video::IImagePresenter*)in libIrrlichtdev.a(CSoftwareDriver2.o)
"irr::scene::CHalflifeMDLMeshFileLoader::CHalflifeMDLMeshFileLoader(irr::scene::ISceneManager*)", referenced from:
irr::scene::CSceneManager::CSceneManager(irr::video::IVideoDriver*, irr::io::IFileSystem*, irr::gui::ICursorControl*, irr::scene::IMeshCache*, irr::gui::IGUIEnvironment*)in libIrrlichtdev.a(CSceneManager.o)
irr::scene::CSceneManager::CSceneManager(irr::video::IVideoDriver*, irr::io::IFileSystem*, irr::gui::ICursorControl*, irr::scene::IMeshCache*, irr::gui::IGUIEnvironment*)in libIrrlichtdev.a(CSceneManager.o)
".objc_class_name_EAGLContext", referenced from:
literal-pointer@__OBJC@__cls_refs@EAGLContext in EAGLView.o
"irr::CIrrDeviceIPhone::CIrrDeviceIPhone(irr::SIrrlichtCreationParameters const&)", referenced from:
_createDeviceEx in libIrrlichtdev.a(Irrlicht.o)
".objc_class_name_NSAutoreleasePool", referenced from:
literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in main.o
".objc_class_name_NSDictionary", referenced from:
literal-pointer@__OBJC@__cls_refs@NSDictionary in EAGLView.o
".objc_class_name_CAEAGLLayer", referenced from:
literal-pointer@__OBJC@__cls_refs@CAEAGLLayer in EAGLView.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
pmtolk
Posts: 8
Joined: Fri Jul 30, 2010 3:51 am

Post by pmtolk »

ok I switched to release and got these errors

Undefined symbols:
"irr::video::createTRNormalMap(irr::video::CBurningVideoDriver*)", referenced from:
irr::video::CBurningVideoDriver::CBurningVideoDriver(irr::SIrrlichtCreationParameters const&, irr::io::IFileSystem*, irr::video::IImagePresenter*)in libIrrlichtdev.a(CSoftwareDriver2.o)
irr::video::CBurningVideoDriver::CBurningVideoDriver(irr::SIrrlichtCreationParameters const&, irr::io::IFileSystem*, irr::video::IImagePresenter*)in libIrrlichtdev.a(CSoftwareDriver2.o)
"irr::io::CArchiveLoaderWAD::CArchiveLoaderWAD(irr::io::IFileSystem*)", referenced from:
irr::io::CFileSystem::CFileSystem()in libIrrlichtdev.a(CFileSystem.o)
irr::io::CFileSystem::CFileSystem()in libIrrlichtdev.a(CFileSystem.o)
"irr::video::createTRStencilShadow(irr::video::CBurningVideoDriver*)", referenced from:
irr::video::CBurningVideoDriver::CBurningVideoDriver(irr::SIrrlichtCreationParameters const&, irr::io::IFileSystem*, irr::video::IImagePresenter*)in libIrrlichtdev.a(CSoftwareDriver2.o)
irr::video::CBurningVideoDriver::CBurningVideoDriver(irr::SIrrlichtCreationParameters const&, irr::io::IFileSystem*, irr::video::IImagePresenter*)in libIrrlichtdev.a(CSoftwareDriver2.o)
"irr::scene::CHalflifeMDLMeshFileLoader::CHalflifeMDLMeshFileLoader(irr::scene::ISceneManager*)", referenced from:
irr::scene::CSceneManager::CSceneManager(irr::video::IVideoDriver*, irr::io::IFileSystem*, irr::gui::ICursorControl*, irr::scene::IMeshCache*, irr::gui::IGUIEnvironment*)in libIrrlichtdev.a(CSceneManager.o)
irr::scene::CSceneManager::CSceneManager(irr::video::IVideoDriver*, irr::io::IFileSystem*, irr::gui::ICursorControl*, irr::scene::IMeshCache*, irr::gui::IGUIEnvironment*)in libIrrlichtdev.a(CSceneManager.o)
"irr::CIrrDeviceIPhone::CIrrDeviceIPhone(irr::SIrrlichtCreationParameters const&)", referenced from:
_createDeviceEx in libIrrlichtdev.a(Irrlicht.o)
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

libirrlichtdev, just copy libirrlichtdev.a and rename it it libirrlichtsim.a


That will fix your issues

libirrlichtsim.a is for use when running on the simulator,

libirrlichtdev.a is for use when running on the device. Make sure when you create this version that you compile the library file with xCode set to device and not simulator or the ARM6 and ARM7 systems won't be used (you will notice the error when you try to run on a device)


I will be putting a file online soon which will be a new template based on the original fuzzy template. I will include a pre-compiled libirrlichtdev.a file and a libirrlichtsim.a file.

The library files have integrated touch controls already configured so should save you some time.

I have also included a bullet physics wrapper, originally created by forum member Buck1000 (and converted to iPhone by myself).

I have also added a web-based back end system that allows you to modify ingame parameters on the fly through your website browser called RudeTweaker.

This should be pretty much everything to get you straight up and running.
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

The template is now online at

http://iphonedevelopmentblog.co.uk/IrrlichtTemplate.zip (70mb approx)

This version will run on both device and simulator.

When running on device make sure you set the paramater

#define RUNNING_ON_DEVICE 0

to

#define RUNNING_ON_DEVICE 1

and vice versa when you are running on simulator.

You will also need to set your code-signing certificates when running on a device.


You should not have to do any other configuration to get this working.

Let me know if you have any problems.
Post Reply