public GLCapabilities getCapsForSettings(final DisplaySettings settings, final boolean onscreen,
final boolean bitmapRequested, final boolean pbufferRequested, final boolean fboRequested) {
// 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(getProfile());
caps.setHardwareAccelerated(true);
caps.setDoubleBuffered(true);