// create the Display.
DisplayMode mode;
if (_settings.isFullScreen()) {
mode = getValidDisplayMode(_settings);
if (null == mode) {
throw new Ardor3dException("Bad display mode (w/h/bpp/freq): " + _settings.getWidth() + " / "
+ _settings.getHeight() + " / " + _settings.getColorDepth() + " / " + _settings.getFrequency());
}
} else {
mode = new DisplayMode(_settings.getWidth(), _settings.getHeight());
}
final PixelFormat format = new PixelFormat(_settings.getAlphaBits(), _settings.getDepthBits(),
_settings.getStencilBits()).withSamples(_settings.getSamples()).withStereo(_settings.isStereo());
try {
Display.setDisplayMode(mode);
Display.setFullscreen(_settings.isFullScreen());
Display.create(format);
} catch (final Exception e) {
logger.severe("Cannot create window");
logger.logp(Level.SEVERE, this.getClass().toString(), "initDisplay()", "Exception", e);
throw new Ardor3dException("Cannot create window: " + e.getMessage());
}
_canvasRenderer.init(_settings, true); // true - do swap in renderer.
_inited = true;
}