use of com.jogamp.nativewindow.util.SurfaceSize in project narchy by automenta.
the class VID method initModeList.
static void initModeList() {
final List<MonitorMode> modes = re.getModeList();
final ArrayList<String> fs_resolutions_list = new ArrayList<>();
final ArrayList<vidmode_t> fs_modes_list = new ArrayList<>();
final HashSet<DimensionImmutable> resSet = new HashSet<>();
for (int i = 0; i < modes.size(); i++) {
// reverse order: low -> high res.
final MonitorMode mm = modes.get(modes.size() - 1 - i);
final SurfaceSize ss = mm.getSurfaceSize();
final DimensionImmutable m = ss.getResolution();
if (resSet.add(m)) {
final StringBuilder sb = new StringBuilder();
sb.append('[');
sb.append(m.getWidth());
sb.append(' ');
sb.append(m.getHeight());
while (sb.length() < 10) sb.append(' ');
sb.append(']');
fs_resolutions_list.add(sb.toString());
sb.setLength(0);
sb.append("Mode ");
sb.append(i);
sb.append(':');
sb.append(m.getWidth());
sb.append('x');
sb.append(m.getHeight());
fs_modes_list.add(new vidmode_t(sb.toString(), m.getWidth(), m.getHeight(), i));
}
}
fs_resolutions = new String[fs_resolutions_list.size()];
fs_modes = new vidmode_t[fs_modes_list.size()];
fs_resolutions_list.toArray(fs_resolutions);
fs_modes_list.toArray(fs_modes);
}
use of com.jogamp.nativewindow.util.SurfaceSize in project narchy by automenta.
the class NEWTWin method getModeString.
public static String getModeString(MonitorMode mm) {
final SurfaceSize ss = mm.getSurfaceSize();
final DimensionImmutable m = ss.getResolution();
final StringBuilder sb = new StringBuilder();
sb.append(m.getWidth());
sb.append('x');
sb.append(m.getHeight());
sb.append('x');
sb.append(ss.getBitsPerPixel());
sb.append('@');
sb.append(mm.getRefreshRate());
sb.append("Hz");
return sb.toString();
}
Aggregations