public DisplayMode findFirstCompatibleMode(DisplayMode modes[]) {
		DisplayMode systemModes[] = device.getDisplayModes();
		for (DisplayMode mode : modes)
			for (DisplayMode systemMode : systemModes)
				if (displayModesMatch(mode, systemMode))
					return systemMode;

		return null;
	}