//AbstractGraphicsDevice device = awtConfig.getScreen().getDevice(); // throws exception
// Alternative: default graphics device
AbstractGraphicsDevice device = GLDrawableFactory.getDesktopFactory().getDefaultDevice();
// Offscreen Canvas3D's capabilites, determined in 'getBestConfiguration'
GLCapabilities canvasCaps = (GLCapabilities)awtConfig.getChosenCapabilities();
// For further investigations : the user's GraphicsConfigTemplate3D (not used yet)
GraphicsConfigTemplate3D gct3D = gcInf0.getGraphicsConfigTemplate3D();
// Assuming that the offscreen drawable will/can support the chosen GLCapabilities
// of the offscreen Canvas3D
final GLCapabilities offCaps = new GLCapabilities(profile);
offCaps.copyFrom(canvasCaps);
// double bufffering only if scene antialiasing is required/preferred and supported
if (offCaps.getSampleBuffers() == false) {
offCaps.setDoubleBuffered(false);
offCaps.setNumSamples(0);
}
// Never stereo
offCaps.setStereo(false);
// Set preferred offscreen drawable : framebuffer object (FBO) or pbuffer
offCaps.setFBO(true); // switches to pbuffer if FBO is not supported
// caps.setPBuffer(true);
// !! a 'null' capability chooser; JOGL doesn't call a chooser for offscreen drawable
// If FBO : 'offDrawable' is of type javax.media.opengl.GLFBODrawable