Hi guys.
What is the cause for this error, and what could I do to fix it?
I am using the latest LWJGL jars and natives. Java is updated to the latest version and so are graphics card drivers.
Quoteorg.lwjgl.LWJGLException: Could not create pixel format
at org.lwjgl.opengl.MacOSXPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.MacOSXPeerInfo.choosePixelFormat(MacOSXPeerInfo.java:58)
at org.lwjgl.opengl.MacOSXPeerInfo.<init>(MacOSXPeerInfo.java:53)
at org.lwjgl.opengl.MacOSXPbufferPeerInfo.<init>(MacOSXPbufferPeerInfo.java:46)
at org.lwjgl.opengl.MacOSXDisplay.createPbuffer(MacOSXDisplay.java:526)
at org.lwjgl.opengl.Pbuffer.createPbuffer(Pbuffer.java:234)
at org.lwjgl.opengl.Pbuffer.<init>(Pbuffer.java:219)
at org.lwjgl.opengl.Pbuffer.<init>(Pbuffer.java:190)
at org.lwjgl.opengl.Pbuffer.<init>(Pbuffer.java:166)
Thanks in advance.
It couldn't create your Pbuffer. Check your parameters and try again.
For more help, we need your code, MacOS version, etc. :P
Heres the code where the PBuffer is used:
public static final void test() throws LWJGLException {
pixelformat = new PixelFormat(32, 0, 8, 0, 0);
boolean multisampling = true;
if (multisampling) {
Pbuffer pb = new Pbuffer(640, 480, pixelformat, null);
pb.makeCurrent();
boolean supported = GLContext.getCapabilities().GL_ARB_multisample;
int max_samples = 0;
if(supported) {
max_samples = GL11.glGetInteger(GL30.GL_MAX_SAMPLES);
}
pb.destroy();
if (max_samples != 0) {
pixelformat = pixelformat.withSamples(max_samples);
}
}
}
It happened with various Mac OS versions and even sometimes with windows 7. I would guess it has something to do with the graphics card drivers or hardware since it works fine on some computers.
Bump
What graphics card is it failing with? Intel cards? Are the drivers up to date?
My best guess is that the graphics card just does not support something you are requesting. Maybe try 16bit color, 16bit depth, etc. and see what happens. I also recall that some graphics cards don't support PBuffers well.