[fixed]Compiling Irrlicht on Mac OS X x86_64

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
fabietto
Posts: 93
Joined: Wed Sep 24, 2008 4:38 pm
Location: Plymouth, UK
Contact:

[fixed]Compiling Irrlicht on Mac OS X x86_64

Post by fabietto »

Dear all,

I recently bought a new Apple laptop, where I'm running Snow Leopard. Since the new machine is a 64 bit one, I provided to recompile all the libraries I use against the x86_64 architecture. Some issues arisen with Irrlicht.

First of all, using the XCode project included into the distribution, it's not possible to select straightaway the x86_64 architecture. I had to add it manually to the "valid architectures" list (right click on MacOsX, within the Groups & Files section -> get info -> build tab -> valid architectures).

Second, the compilation returns some errors (and not warnings as I believe would make more sense) because of four instructions where "Cast from void* to GLuint loses precision". These instructions are located into COpenGLSLMaterialRenderer.cpp at lines 138, 139, 141, and 143:

Code: Select all

#if defined(GL_ARB_geometry_shader4) || defined(GL_EXT_geometry_shader4) || defined(GL_NV_geometry_shader4)
		Driver->extGlProgramParameteri((GLuint)Program, GL_GEOMETRY_INPUT_TYPE_EXT, Driver->primitiveTypeToGL(inType));
		Driver->extGlProgramParameteri((GLuint)Program, GL_GEOMETRY_OUTPUT_TYPE_EXT, Driver->primitiveTypeToGL(outType));
		if (verticesOut==0)
			Driver->extGlProgramParameteri((GLuint)Program, GL_GEOMETRY_VERTICES_OUT_EXT, Driver->MaxGeometryVerticesOut);
		else
			Driver->extGlProgramParameteri((GLuint)Program, GL_GEOMETRY_VERTICES_OUT_EXT, core::min_(verticesOut, Driver->MaxGeometryVerticesOut));
#elif defined(GL_NV_geometry_program4)
		if (verticesOut==0)
			Driver->extGlProgramVertexLimit(GL_GEOMETRY_PROGRAM_NV, Driver->MaxGeometryVerticesOut);
		else
			Driver->extGlProgramVertexLimit(GL_GEOMETRY_PROGRAM_NV, core::min_(verticesOut, Driver->MaxGeometryVerticesOut));
#endif
As suggested in a post I found online (http://webcache.googleusercontent.com/s ... ent=safari), I've modified the above code to look like:

Code: Select all

#if defined(GL_ARB_geometry_shader4) || defined(GL_EXT_geometry_shader4) || defined(GL_NV_geometry_shader4)
		Driver->extGlProgramParameteri((long GLuint)Program, GL_GEOMETRY_INPUT_TYPE_EXT, Driver->primitiveTypeToGL(inType));
		Driver->extGlProgramParameteri((long GLuint)Program, GL_GEOMETRY_OUTPUT_TYPE_EXT, Driver->primitiveTypeToGL(outType));
		if (verticesOut==0)
			Driver->extGlProgramParameteri((long GLuint)Program, GL_GEOMETRY_VERTICES_OUT_EXT, Driver->MaxGeometryVerticesOut);
		else
			Driver->extGlProgramParameteri((long GLuint)Program, GL_GEOMETRY_VERTICES_OUT_EXT, core::min_(verticesOut, Driver->MaxGeometryVerticesOut));
#elif defined(GL_NV_geometry_program4)
		if (verticesOut==0)
			Driver->extGlProgramVertexLimit(GL_GEOMETRY_PROGRAM_NV, Driver->MaxGeometryVerticesOut);
		else
			Driver->extGlProgramVertexLimit(GL_GEOMETRY_PROGRAM_NV, core::min_(verticesOut, Driver->MaxGeometryVerticesOut));
#endif
Once these modifications have been made, the library compiles smoothly. I'm not sure the one I've followed is the best solution to the problem, but so far seems to have worked alright.

Cheers,
Fabio
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The code has already been fixed in the SVN/trunk. It just didn't make it into the SDK.
fabietto
Posts: 93
Joined: Wed Sep 24, 2008 4:38 pm
Location: Plymouth, UK
Contact:

Post by fabietto »

hybrid wrote:The code has already been fixed in the SVN/trunk. It just didn't make it into the SDK.
Fair play, I didn't know you already came across this issue. I searched across the forum but I couldn't find any post mentioning this problem.
voidref
Posts: 1
Joined: Mon Dec 27, 2010 11:18 pm
Location: www.voidref.com

Post by voidref »

The issue here is still int he SDK download as of version 1.7.2
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, as mentioned above it will be in the 1.8 release (SVN/trunk), not in the bug fix releases fo the 1.7 branch.
thatblokeray
Posts: 1
Joined: Mon Feb 13, 2012 3:52 pm

Re: [fixed]Compiling Irrlicht on Mac OS X x86_64

Post by thatblokeray »

I get four errors when I try to correct the above errors. I've tried to manually fix this but couldn't get far. http://i.imgur.com/7j6O4.png
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [fixed]Compiling Irrlicht on Mac OS X x86_64

Post by hybrid »

Yes, there's still a known bug in the type mix that was introduced there. I think there's a patch on the patch tracker which is thought to fix this.
dreamwalker
Posts: 6
Joined: Tue Sep 08, 2009 10:05 am
Location: Philippines

Re: [fixed]Compiling Irrlicht on Mac OS X x86_64

Post by dreamwalker »

I just changed the (long GLuint) to (long) and the warning/error seemed to disappear.
Now I have this problem.
http://irrlicht.sourceforge.net/forum/v ... =7&t=45863
I dream therefore I am.
Post Reply