OpenGL OS/X, Linux problems

Hey guys. I finished my first Ludum Dare entry on Sunday and got some problems with cross-platform support. Everything runs fine on Windows machines but it seems to crash on start-up on Mac and Linux. The first problem was that I worked with Java 1.7 but in the meantime I switched to 1.6. I’m using LWJGL and OpenGL 3.2.

Since I don’t own a Mac or have a Linux system it’s quite hard to find the problem. But through people posting about the crashes it seem to be this part of the code where the error occurs:

int shaderHandle = GL20.glCreateShader(shaderType);

if (shaderHandle != 0) {
	GL20.glShaderSource(shaderHandle, shaderSource);
	GL20.glCompileShader(shaderHandle);
	int compileStatus = GL20.glGetShaderi(shaderHandle, GL20.GL_COMPILE_STATUS);
	
	if (compileStatus == 0) {
		System.out.println("Error compiling shader: GL20.glGetShaderInfoLog(shaderHandle)");
		GL20.glDeleteShader(shaderHandle);
		shaderHandle = 0;
	}
}

if (shaderHandle == 0) {			
	throw new RuntimeException("Error creating shader.");
}

“GL20.glCreateShader(shaderType)” seems to fail and returns 0.

This is how I’m initiating OpenGL on start-up:

PixelFormat pixelFormat = new PixelFormat();
ContextAttribs contextAtrributes = new ContextAttribs(3, 2).withForwardCompatible(true).withProfileCore(true);

try {
	Display.setDisplayMode(new DisplayMode(RESOLUTION.width,RESOLUTION.height));
	Display.setTitle(WINDOW_TITLE);
	Display.create(pixelFormat, contextAtrributes);
} catch (LWJGLException e) {
	e.printStackTrace();
	System.exit(-1);
}

Any ideas how to handle this and/or how to approach cross platform games?

All the posts about the errors are located here:
http://www.ludumdare.com/compo/ludum-dare-27/?action=preview&uid=26860

At least one of the errors is outdated java (unsupported major minor version: 51.0)

Not sure about the others

Running fine on my hackintosh. Mountain Lion 10.8.3

OT: Really need to make a Hackintosh. My mac Mini is just so colossally inconvenient to use. Anybody got any tips here?

Cas :slight_smile:

The major minor version was caused because I used 1.7 but in the meantime I switched to 1.6.

At least it’s good to know that it runs on some systems.

@princec

You can easily boot hacked distributions of OS X to work on a normal pc. (Retail dvd is tough to use).

This guide helped me to make my hackintosh and I dual boot windows 8 and mountain lion using NIRESH ISO.

Niresh’s OS X 10.8.2 <-- download niresh

And here’s the guide.

How to install OS X Mountain Lion on your PC with Niresh

Be sure to install windows 8 and os x on two separate hdds.

Hm, I don’t have a spare HDD, nor even a spare SATA port to bung one in! What a pain. Thanks for the link though.

Cas :slight_smile:

You can run different operating systems in a virtual machine. The CPU should run at or near native speed with relatively recent hardware and modern VMs. I am not sure about 3D support, but I would be more surprised if it did not work well enough to use than if it worked perfectly.

I was planning to try it in VirtualBox. But I expect that it won’t work.

Cas :slight_smile:

fixed it for you :slight_smile:
Also i dont see how using hackintosh would be less inconvienient than a mac mini. Especially the drivers are real annoying to get right.

Hijacked threads are hijacked. ;D

I tried doing this with Mac OS X 10.6 and the OpenGL drivers are there but they aren’t a very recent version, so you might have trouble with that.