Irrlicht Mod for Mac

BlitzMax Forums/BlitzMax Programming/Irrlicht Mod for Mac

Will(Posted 2006) [#1]
Now that the Irrlicht engine (irrlicht.sourceforge.net) is available for mac, will the Irrlicht Bmax Mod be updated to support mac?


gman(Posted 2006) [#2]
@Will - been trying since it came out. had several issues getting an old Mac up and running on an OSX that could run BMAX. the mods have been recompiled successfully on Mac. unfortunately, a graciously donated libIrrlicht.a file does not seem to agree very well with BMAX when linking. where im currently at, is i would like to rebuild the MacIrrlicht Xcode project (i have v1.5) and build my own libIrrlicht.a file to try to make it more compatible (plus i need this anyway to support the mods). problem is im a total Mac newb and am having difficulties doing this.

if anyone out there is a Mac dev and feels like they could rebuild the MacIrrlicht Xcode project (and has v1.5) then your time would be much appreciated :)


Jay Kyburz(Posted 2006) [#3]
Im a mac n00b to but could give this a go i guess.

I'm thinking of diving into Irrlicht rather than waiting for BRL's 3d module. (I'm not sure I'm even going to want to use it without a few point releases :)


Is anybody making cool looking apps with Irrlicht yet? Good to work with?


Rambus(Posted 2006) [#4]
I have been using irrlicht for about 8 mounths now, its a very easy API to work with but you have to take into account writting in C++ though more flexible and powerfull can be more time consuming and frustrating.

One thing to consider is that irrlicht is a rendering engine with a gui and some crudy collision detection not a games development suit. If you want to move to irrlicht your going to have to learn other API's (Phsysics, networking, sound .... ) as well. But dont let that put you off, its a wounderfull system.


gman(Posted 2006) [#5]
i have finally started a project actually using the Irrlicht mods and find it very workable. granted im not doing anything extremely complex yet.

also, im on my 3rd attempt at rebuilding the Irrlicht project using Xcode 1.5. i actually have it compiling now, but im getting an undefined reference to one of the two entry functions when i try to link. i dont know enough about Xcode yet to fix my problem. is there a way to manually declare exposed functions in Xcode? when the frustration levels fall to an acceptable point i work on it a little bit more :)

one thing i ran into is that ObjectiveC apparently has a keyword called "id". well, "id" is used as a variable name throughout the Irrlicht code so i had to spend an hour replacing all those references. not sure how Xcode 2+ gets around that. maybe there is a way to exclude support for that command? at least im not getting the malformed object issue anymore which leads me to believe my suspicions that Xcode 1.5 cant link with something built in Xcode 2+ were correct.


Red Ocktober(Posted 2006) [#6]
is there a chance that the guy will be able to recompile the project in 1.5 and release it for all those who bought mac minis will OSX 10.3.9 and aren't ready to plunk down another 100 bills right away for a OS upgrade...

:)

--Mike


Dreamora(Posted 2006) [#7]
Isn't 1.5 for pre X.3 only? (like 10.2.8) Thought x.3 had XCode 2 or even 2.1


gman(Posted 2006) [#8]
10.3 has Xcode 1.5. 10.4 and up is v2+. unfortunately the folks building it for me have 10.4 :(


Jay Kyburz(Posted 2006) [#9]
im 10.4 too sorry.


Will(Posted 2006) [#10]
me too. apple should give developers free OS upgrades. Just email them with what your working on and why its good for the apple community and maybe they will just hook you up, works for me pretty often software makers will just give me stuff on those grounds, or give me crazy discounts.


ozak(Posted 2006) [#11]
So, what's the news on the Mac version of Irrlicht? Played around with the Windows version and I must say that it works sweet. Does the Windows mod source also run under Linux?

I'd be happy to help out with the mac version if needed. I work regularly as a programmer on 3D applications for both Windows, Mac and Linux.


gman(Posted 2006) [#12]

I'd be happy to help out with the mac version if needed.


thank you for the offer :) the "gman is eternally grateful" grand prize goes to the mac dev who can get me an Xcode 1.5 Irrlicht project that successfully builds the libIrrlicht.a file :) while you can compile Xcode 2+ project with compatibility for prior OSXs, trying to link to those with the Xcode 1.5 linker gives tons of malformed object errors. the mods are actually compiled and ready to go, all i need is a good .a file to link to.


Does the Windows mod source also run under Linux?


yes it does. you will need to rebuild the mods, but they should link to the linux .a file from the standard Irrlicht distribution. i have a new dev laptop on the way (arriving friday) and i plan to start with a dual-boot linux/windows system in the hopes that i can better support the linux crowd.


ozak(Posted 2006) [#13]
Ok. I'll see what I can do. So the BlitzMax Irrlicht mods compile fine under OS X in their current version?
(The one I downloaded from your site)
It's just the .a file you need?


gman(Posted 2006) [#14]
there was one minor change that i didnt take the time to figure out why since im stuck on bigger fish. here is the mac-compiled/compatible mods:

http://www.gprogs.com/gg.Irrlicht/gg.mod_macos.zip


Will(Posted 2006) [#15]
Can you post the linking process? I can link them up and make an X-Code 2 version for XCode2 mac users if im reading this right.


ozak(Posted 2006) [#16]
Working on XCode 2.2 here. XCode 2 does not do it for the project :)

I'll keep you posted :)


ozak(Posted 2006) [#17]
Got it build. It seems that placing the .a file in the irrlicht mod dir and choosing it with import destroys the a file as it is modified by bmax.
Goes from 20mb to 4mb after build!
(Anyone wishing to build the mac version should have XCode 2.2. 2.0 does not work with it, and 2.1 is untested but should work fine too according to my info)
If you choose -l for the import the linker can't find the lib file. Where do I place it so that bmax will find it?
It seems this is a static lib on OSX as it's almost 20mb :)
I tried the lib dir. I think this might be all we need, but too tired to look more into it tonight.

Update:

Well. I tried adding it to the gcc lib dir, and I found out how to include it in the Irrlicht mod dir without it getting overwritten.
It's still 20mb in release mode, so all should be there.
I just can't get it to work. Either I get a huge list of missing functions or it just can't find the lib.
I'm afraid I'm stuck here. The OSX build works fine and I can build and run the samples. I'll look more closely at the OSX project.

Does anyone know if BlitzMax uses a certain GCC version for compile/link? Perhaps then I can target an older GCC compiler.
Also, where should i place the lib file to make sure it's found by the BlitzMax linker?


ozak(Posted 2006) [#18]
*BUMP*
Editing does not alter the hours it was posted :)


gman(Posted 2006) [#19]
ill have to check when i get home (at work now). i think it goes in the irrlicht.mod directory and needs to be called: libirrlicht.a

i could not get it to find it any other way. i think BlitzMax uses the installed GCC compiler. so whatever your Xcode version is using.

can you post the beginning of the errors when you get the big list?

thx.


ozak(Posted 2006) [#20]
Placing it in irrlicht.mod gives the following error on building the collision sample:

Building collision
Compiling:collision.bmx
Linking:collision
ld: can't open: -llibirrlicht (No such file or directory, errno = 2)
Build Error: Failed to link /Users/odinjensen/Documents/samples_06_07/07.Collision/collision
Process complete


ozak(Posted 2006) [#21]
Importing the lib itself into irrlicht gives a huge list (shortened)

ld: Undefined symbols:
_CGLChoosePixelFormat
_CGLClearDrawable
_CGLCreateContext
_CGLDestroyContext
_CGLDestroyPixelFormat
_CGLFlushDrawable
_CGLSetCurrentContext
_CGLSetFullScreen
_CGLSetParameter
__ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base
__ZSt18_Rb_tree_incrementPSt18_Rb_tree_node_base
__ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_
_glFinish
_glViewport
_sprintf$LDBLStub
_glActiveTextureARB
_glAlphaFunc
_glAttachObjectARB
_glBegin
_glBindProgramARB
_glBindTexture
_glBlendFunc
_glClear
_glClearColor
_glClientActiveTextureARB
_glColor4ub
_glColorMask
_glColorPointer
_glCompileShaderARB
_glCopyTexSubImage2D
_glCreateProgramObjectARB
_glCreateShaderObjectARB
_glCullFace
_glDeleteObjectARB
_glDeleteProgramsARB
_glDepthFunc
_glDepthMask
_glDisable
_glDisableClientState
_glDrawElements
_glEnable
...


ozak(Posted 2006) [#22]
So that's probably a nogo. The lib is also nowhere near 20 mb in size ;)

I've tried every place known to man, and it just can't find the .a file.
If we can somehow get it to find it. Maybe a verbose dump of the blitz modbuild step? I know it's possible for bmk.


gman(Posted 2006) [#23]
looks like the mac version may need the command:
Import "-lGL"

look to the linux specific import for an example. i think you are close with the missing GL stuff.


ozak(Posted 2006) [#24]
Nope. I tried it. I think it's because the Irrlicht stuff needs the Cocoa and OpenGL framework.


It's not only the GL stuff:

_CGLChoosePixelFormat
_CGLClearDrawable
_CGLCreateContext
_CGLDestroyContext
_CGLDestroyPixelFormat
_CGLFlushDrawable
_CGLSetCurrentContext
_CGLSetFullScreen
_CGLSetParameter
__ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base
__ZSt18_Rb_tree_incrementPSt18_Rb_tree_node_base
__ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_

Dunno how we get this into it. I think it should be Import "-llibirrlicht" and then we need to find a way to get the Blitz compiler to recognize the library file. It keeps saying it can't find it, no matter where I put it.


Will(Posted 2006) [#25]
I'm out of my depth, but I'm posting for moral support! Stay firm!


ozak(Posted 2006) [#26]
*BUMP* Anyone knows where the libirrlicht.a should be or what you can specify to BMK to get it to include a libfile during the linkstage.

There is no DLL or SO file in the OS X version of Irrlicht.
It's a simple static linking library, so we just need to get BMax to recognize it :)


gman(Posted 2006) [#27]
i went through the "where to put it" about a month ago. here is the link:

http://www.blitzmax.com/Community/posts.php?topic=56628

i have a newer version of the mod i think that i was using when i was trying to get my Xcode 1.5 .a file to link. i will see if i can get that zipped tonight.

also, i finally received my new laptop and am getting the linux side installed (to better support the mods and linux). when trying to link to libIrrlicht.a i found i also needed to:
Import "-lGLU"

after that i was able to build and run BMAX Irrlicht projects in linux. you may try adding that under your import of GL.


ozak(Posted 2006) [#28]
Ahh ok. I'll give it a go again. It just don't seem to work with import "libirrlicht.a"

I mean it works, but I get the linker error in BMax.


Will(Posted 2006) [#29]
Any luck?


ozak(Posted 2006) [#30]
Nope. I just can't get the damn thing to work. Tried everything :(

We'll just have to wait and see if anyone else can fix it.
I did compile and run Irrlicht on mac, but no go with Blitzmax.