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