Posted by
runiter on
Jan 16, 2013; 4:20pm
URL: https://forum.jogamp.org/requested-graphics-configuration-tp4027845p4027869.html
I don't see it there. If you look at the CapsUtil.getCapsForSettings() below you will notice that settings.getColorDepth() is used to check to ensure it is one of 16, 24 or 32 values. But other than that nothing happens here. Its value is never passed to GLCapabilities.
I noticed that GLCapabilities doesn't have setColotDepth() method, but it does have setRedBits(), setGreenBits() and setBlueBits() methods. However those 3 setter methods are never called. Why?
p.s. don't confuse "ColorDepthBits" with z-buffer "DepthBits". I'm only talking about ColorDepthBits here.
public static GLCapabilities getCapsForSettings(final DisplaySettings settings) {
// Validate window dimensions.
if (settings.getWidth() <= 0 || settings.getHeight() <= 0) {
throw new Ardor3dException("Invalid resolution values: " + settings.getWidth() + " " + settings.getHeight());
}
// Validate bit depth.
if ((settings.getColorDepth() != 32) && (settings.getColorDepth() != 16) && (settings.getColorDepth() != 24)
&& (settings.getColorDepth() != -1)) {
throw new Ardor3dException("Invalid pixel depth: " + settings.getColorDepth());
}
final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
caps.setHardwareAccelerated(true);
caps.setDoubleBuffered(true);
caps.setAlphaBits(settings.getAlphaBits());
caps.setDepthBits(settings.getDepthBits());
caps.setNumSamples(settings.getSamples());
caps.setSampleBuffers(settings.getSamples() != 0);
caps.setStereo(settings.isStereo());
caps.setStencilBits(settings.getStencilBits());
return caps;
}