PBuffer max size

Hi

I am using a pbuffer to create a screenshot and have found that if I try to use the size of a pbuffer with a height or width bigger than 1024 I get the following exception:

Exception occurred during event dispatching:
javax.media.opengl.GLException: pbuffer creation error: wglCreatePbufferARB() failed: tried 1 pixel formats, last error was: (Unknown error code 0)
at com.sun.opengl.impl.windows.WindowsPbufferGLDrawable.createPbuffer(WindowsPbufferGLDrawable.java:369)
at com.sun.opengl.impl.windows.WindowsPbufferGLDrawable.(WindowsPbufferGLDrawable.java:77)
at com.sun.opengl.impl.windows.WindowsGLDrawableFactory$2.run(WindowsGLDrawableFactory.java:145)
at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.maybeDoSingleThreadedWorkaround(WindowsGLDrawableFactory.java:212)
at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.createGLPbuffer(WindowsGLDrawableFactory.java:162)

The code that creates the pbuffer looks like:

GLCapabilities cap = new GLCapabilities();
cap.setDoubleBuffered(false);
offScreenCanvas = GLDrawableFactory.getFactory().createGLPbuffer(cap, width, height, null);

I am wondering if there is a way in querying opengl through jogl that will return what the max height/width that the pbuffer allows?

Any help would be much appreciated

Thanks
Mike

I’m sorry but there is no way to do this with the current JOGL API and really no convenient way for us to expose the functionality. I would instead recommend you write a loop trying various widths and heights and catch any GLExceptions generated until one creation attempt succeeds. You can feel free to file an RFE about this with the JOGL Issue Tracker but I can’t guarantee it will be fixed quickly.