public void run() { // Fill in the combos once the window has opened so that the insets can be read. // The assumption is made that the settings window and the display window will have the // same insets as that is used to resize the "full screen windowed" mode appropriately. updateResolutionChoices(); if (source.getWidth() != 0 && source.getHeight() != 0) { displayResCombo.setSelectedItem(source.getWidth() + " x " + source.getHeight()); } else { displayResCombo.setSelectedIndex(displayResCombo.getItemCount()-1); } updateAntialiasChoices(); colorDepthCombo.setSelectedItem(source.getBitsPerPixel() + " bpp"); } });
String colorDepth = (String) colorDepthCombo.getSelectedItem(); if (colorDepth == null) { colorDepth = source.getBitsPerPixel() + " bpp";
private Config getRequestedConfig() { int r, g, b; if (settings.getBitsPerPixel() == 24) { r = g = b = 8; } else { if (settings.getBitsPerPixel() != 16) { logger.log(Level.SEVERE, "Invalid bitsPerPixel setting: {0}, setting to RGB565 (16)", settings.getBitsPerPixel()); settings.setBitsPerPixel(16); } r = 5; g = 6; b = 5; } logger.log(Level.FINE, "Requested Display Config:"); logger.log(Level.FINE, "RGB: {0}, alpha: {1}, depth: {2}, samples: {3}, stencil: {4}", new Object[]{settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(), settings.getSamples(), settings.getStencilBits()}); return new Config( r, g, b, settings.getAlphaBits(), settings.getDepthBits(), settings.getSamples(), settings.getStencilBits()); }
pixelFormat = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(),
pbufferFormat = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(), if (canvasFormat == null){ int samples = getNumSamplesToUse(); canvasFormat = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(),
if (currentDisplayMode.getWidth() == settings.getWidth() && currentDisplayMode.getHeight() == settings.getHeight()) { if (currentDisplayMode.getBitDepth() == settings.getBitsPerPixel()) { if (currentDisplayMode.getRefreshRate() == settings.getFrequency()) { matchingDisplayMode = currentDisplayMode;
}else if (settings.isFullscreen()){ displayMode = getFullscreenDisplayMode(settings.getWidth(), settings.getHeight(), settings.getBitsPerPixel(), settings.getFrequency()); if (displayMode == null) { throw new RuntimeException("Unable to find fullscreen display mode matching settings"); PixelFormat pf = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(),
glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency()); if (settings.getBitsPerPixel() == 24) { glfwWindowHint(GLFW_RED_BITS, 8); glfwWindowHint(GLFW_GREEN_BITS, 8); glfwWindowHint(GLFW_BLUE_BITS, 8); } else if (settings.getBitsPerPixel() == 16) { glfwWindowHint(GLFW_RED_BITS, 5); glfwWindowHint(GLFW_GREEN_BITS, 6);
glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency()); if (settings.getBitsPerPixel() == 24) { glfwWindowHint(GLFW_RED_BITS, 8); glfwWindowHint(GLFW_GREEN_BITS, 8); glfwWindowHint(GLFW_BLUE_BITS, 8); } else if (settings.getBitsPerPixel() == 16) { glfwWindowHint(GLFW_RED_BITS, 5); glfwWindowHint(GLFW_GREEN_BITS, 6);
MyDisplayMode(AppSettings settings) { height = settings.getHeight(); width = settings.getWidth(); bitDepth = settings.getBitsPerPixel(); refreshRate.add(settings.getFrequency()); }
/** * <code>updateDisplayChoices</code> updates the available color depth and * display frequency options to match the currently selected resolution. */ private void updateDisplayChoices() { if (!fullscreenBox.isSelected()) { // don't run this function when changing windowed settings return; } String resolution = (String) displayResCombo.getSelectedItem(); String colorDepth = (String) colorDepthCombo.getSelectedItem(); if (colorDepth == null) { colorDepth = source.getBitsPerPixel() + " bpp"; } String displayFreq = (String) displayFreqCombo.getSelectedItem(); if (displayFreq == null) { displayFreq = source.getFrequency() + " Hz"; } // grab available depths String[] depths = getDepths(resolution, modes); colorDepthCombo.setModel(new DefaultComboBoxModel(depths)); colorDepthCombo.setSelectedItem(colorDepth); // grab available frequencies String[] freqs = getFrequencies(resolution, modes); displayFreqCombo.setModel(new DefaultComboBoxModel(freqs)); // Try to reset freq displayFreqCombo.setSelectedItem(displayFreq); }
public void run() { // Fill in the combos once the window has opened so that the insets can be read. // The assumption is made that the settings window and the display window will have the // same insets as that is used to resize the "full screen windowed" mode appropriately. updateResolutionChoices(); if (source.getWidth() != 0 && source.getHeight() != 0) { displayResCombo.setSelectedItem(source.getWidth() + " x " + source.getHeight()); } else { displayResCombo.setSelectedIndex(displayResCombo.getItemCount()-1); } updateAntialiasChoices(); colorDepthCombo.setSelectedItem(source.getBitsPerPixel() + " bpp"); } });
String colorDepth = (String) colorDepthCombo.getSelectedItem(); if (colorDepth == null) { colorDepth = source.getBitsPerPixel() + " bpp";
updateAntialiasChoices(); displayResCombo.setSelectedItem(source.getWidth() + " x " + source.getHeight()); colorDepthCombo.setSelectedItem(source.getBitsPerPixel() + " bpp");
pbufferFormat = new PixelFormat(settings.getBitsPerPixel(), 0, settings.getDepthBits(), if (canvasFormat == null){ int samples = getNumSamplesToUse(); canvasFormat = new PixelFormat(settings.getBitsPerPixel(), 0, settings.getDepthBits(),
pixelFormat = new PixelFormat(settings.getBitsPerPixel(), 0, settings.getDepthBits(),
if (currentDisplayMode.getWidth() == settings.getWidth() && currentDisplayMode.getHeight() == settings.getHeight()) { if (currentDisplayMode.getBitDepth() == settings.getBitsPerPixel()) { if (currentDisplayMode.getRefreshRate() == settings.getFrequency()) { matchingDisplayMode = currentDisplayMode;
}else if (settings.isFullscreen()){ displayMode = getFullscreenDisplayMode(settings.getWidth(), settings.getHeight(), settings.getBitsPerPixel(), settings.getFrequency()); if (displayMode == null) { throw new RuntimeException("Unable to find fullscreen display mode matching settings"); PixelFormat pf = new PixelFormat(settings.getBitsPerPixel(), 0, settings.getDepthBits(),
glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency()); if (settings.getBitsPerPixel() == 24) { glfwWindowHint(GLFW_RED_BITS, 8); glfwWindowHint(GLFW_GREEN_BITS, 8); glfwWindowHint(GLFW_BLUE_BITS, 8); } else if (settings.getBitsPerPixel() == 16) { glfwWindowHint(GLFW_RED_BITS, 5); glfwWindowHint(GLFW_GREEN_BITS, 6);