for (java.awt.DisplayMode mode : displayModes) {
for (DisplayMode other : modes)
if (other.width == mode.getWidth() && other.height == mode.getHeight() && other.bitsPerPixel == mode.getBitDepth())
continue outer; // Duplicate.
if (mode.getBitDepth() != desktopMode.getBitDepth()) continue;
modes.add(new JglfwDisplayMode(mode.getWidth(), mode.getHeight(), mode.getRefreshRate(), mode.getBitDepth()));
}
return modes.toArray(DisplayMode.class);
}