Jump to content
  • Advertisement
Sign in to follow this  
choffstein

OpenIL Crashes my app...

This topic is 4804 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am currently trying to do a MacOSX build of an application that uses OpenIL. Unlike most macosx libraries, OpenIL is distributed as a set of dynamic libraries, not as a framework. So anyway, the crash occurs in this set of code:
        if(VIDEO_DEBUG)
		cout << "VIDEO: Initializing SDL subsystem\n";
	
	if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) 
	{
		fprintf(stderr, "Barf! SDL Video Initialization failed!\n");
		exit(1);
	}

	if(VIDEO_DEBUG)
		cout << "VIDEO: Initializing IL\n";

	// initialize DevIL
	ilInit();
	
	if(VIDEO_DEBUG)
		cout << "VIDEO: Settings IL origin\n";
	
	ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
	
	if(VIDEO_DEBUG)
		cout << "VIDEO: Enabling Origin Set\n";
	
	if(!ilEnable(IL_ORIGIN_SET))
	{
		if(VIDEO_DEBUG)
			cerr << "VIDEO ERROR: SERIOUS PROBLEM! ilEnable(IL_ORIGIN_SET) failed in GameVideo::Initialize()!" << endl;
		return false;
	}
	
	if(VIDEO_DEBUG)
		cout << "VIDEO: Initializing ilu\n";
	iluInit();
	
	if(VIDEO_DEBUG)
		cout << "VIDEO: ilutRenderer setting for ILUT_OPENGL\n";
	if(!ilutRenderer(ILUT_OPENGL))
	{		
		if(VIDEO_DEBUG)
			cerr << "VIDEO ERROR: SERIOUS PROBLEM! ilutRenderer(ILUT_OPENGL) failed in GameVideo::Initialize()!" << endl;
		// don't return false, since it's possible to play game w/o ilutRenderer
	}
	
	if(VIDEO_DEBUG)
		cout << "VIDEO: ilutEnable()\n";
	// prevent certain NVidia cards from automatically converting to 16-bit bpp
	ilutEnable(ILUT_OPENGL_CONV);


Specifically, it crashes on ilutRenderer(ILUT_OPENGL) everytime. It never makes it to ilutEnable, and not even into the if statement after ilutRenderer. I did notice when I tried to build that it was having linking errors, saying that /sw/lib/libjpeg.62.dylib, /sw/lib/liblcms.1.dylib and /sw/lib/libpng.3.dylib did not exist. I simply made a copy of the libraries in /usr/local/lib that were installed by the OpenIL installation. Anyway, here is the crash...
[Session started at 2005-09-12 10:11:51 -0400.]
VIDEO: Initializing SDL subsystem
VIDEO: Initializing IL
VIDEO: Settings IL origin
VIDEO: Enabling Origin Set
VIDEO: Initializing ilu
VIDEO: ilutRenderer setting for ILUT_OPENGL
Fatal signal: Bus Error (SDL Parachute Deployed)

Application has exited with status 246.
Here is a debug trace... ilutRenderer->ilutGLInit->glGetIntegerv-> lwz r0,2668(r2) -> EXC_BAD_ACCESS So technically it is crashing on glGenIntegerv() -- however, this is all backend code I do not have access to. Does anyone have any thoughts on why this might be crashing my program? Thanks! -visage

Share this post


Link to post
Share on other sites
Advertisement
Really, that's it? But this code has been working 100% on Linux and Windows builds of our game so far. That's weird. Here's a link to the full source in case anyone is interested:

linky

Share this post


Link to post
Share on other sites
I tried placing ilutInit() right before, and it still crashes my application -- this time on the ilutInit() call.

ilutInit() calls ilutGLInit() calls glGetIntegerv, which crashes my application.

Thoughts?

Share this post


Link to post
Share on other sites
That sounds like an issue with the ilut library. I noticed you didn't get much of a response on the OpenIL forums, either.

I'm out of my depth at this point as I don't have a Mac to try anything out on. Sorry.

Share this post


Link to post
Share on other sites
It seems to have been a problem with libpng, because when the PNG images were replaced with JPEGs, the game ran fine.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!