|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Immutable MonitorMode Class, consisting of it's read only components:
More...
Classes | |
| class | SizeAndRRate |
| Immutable surfaceSize, flags and refreshRate Class, consisting of it's read only components: More... | |
Public Member Functions | |
| MonitorMode (final int nativeId, final SizeAndRRate sizeAndRRate, final int rotation) | |
| MonitorMode (final SurfaceSize surfaceSize, final float refreshRate, final int flags, final int rotation) | |
Creates a user instance w/o identity to filter our matching modes w/ identity. More... | |
| final int | getId () |
| final SizeAndRRate | getSizeAndRRate () |
| Returns the surfaceSize and refreshRate instance. More... | |
| final SurfaceSize | getSurfaceSize () |
Returns the unrotated SurfaceSize. More... | |
| final float | getRefreshRate () |
| Returns the vertical refresh rate. More... | |
| final int | getFlags () |
| Returns bitfield w/ flags, i.e. More... | |
| final int | getRotation () |
| Returns the CCW rotation of this mode. More... | |
| final int | getRotatedWidth () |
Returns the rotated screen width in pixel units, derived from getMonitorMode().getSurfaceSize().getResolution() and getRotation() More... | |
| final int | getRotatedHeight () |
Returns the rotated screen height in pixel units, derived from getMonitorMode().getSurfaceSize().getResolution() and getRotation() More... | |
| final String | toString () |
| int | compareTo (final MonitorMode mm) |
| final boolean | equals (final Object obj) |
Tests equality of two MonitorMode objects by evaluating equality of it's components:More... | |
| final int | hashCode () |
| Returns a combined hash code of it's elements: More... | |
Static Public Member Functions | |
| static boolean | isRotationValid (final int rotation) |
Static Public Attributes | |
| static final Comparator< MonitorMode > | monitorModeComparator |
Comparator for 2 MonitorModes, following comparison order as described in MonitorMode#compareTo(MonitorMode), returning the ascending order. More... | |
| static final Comparator< MonitorMode > | monitorModeComparatorInv |
Comparator for 2 MonitorModes, following comparison order as described in MonitorMode#compareTo(MonitorMode), returning the descending order. More... | |
| static final int | ROTATE_0 = 0 |
| zero rotation, compared to normal settings More... | |
| static final int | ROTATE_90 = 90 |
| 90 degrees CCW rotation More... | |
| static final int | ROTATE_180 = 180 |
| 180 degrees CCW rotation More... | |
| static final int | ROTATE_270 = 270 |
| 270 degrees CCW rotation More... | |
| static final int | FLAG_INTERLACE = 1 << 0 |
| Frame is split into two fields. More... | |
| static final int | FLAG_DOUBLESCAN = 1 << 1 |
| Lines are doubled. More... | |
Immutable MonitorMode Class, consisting of it's read only components:
SizeAndRRate, consist out of non rotated surface size, refresh rate and flags. rotation, measured counter clockwise (CCW) Aquire and filter MonitorMode
MonitorDevice Selection: MonitorDevices is accessible via Screen#getMonitorDevices(). Window#getMainMonitor(). Screen#getMainMonitor(RectangleImmutable). MonitorDevice#getCurrentMode(). MonitorDevice#getOriginalMode(). MonitorMode Filtering: MonitorDevice's MonitorModes is accessible via MonitorDevice#getSupportedModes(). MonitorModeUtil to filter and select a desired MonitorMode.
Changing MonitorMode
MonitorDevice#setCurrentMode(MonitorMode) to change the current MonitorMode for all Screens referenced via the full qualified name (FQN). original mode is restored when
Example for changing the MonitorMode:
// Pick the monitor:
// Either the one used by a window ..
MonitorDevice monitor = window.getMainMonitor();
// Or arbitrary from the list ..
List<MonitorDevice> allMonitor = getMonitorDevices();
MonitorDevice monitor = allMonitor.get(0);
// Current and original modes ..
MonitorMode mmCurrent = monitor.queryCurrentMode();
MonitorMode mmOrig = monitor.getOriginalMode();
// Target resolution in pixel units
DimensionImmutable res = new Dimension(800, 600);
// Target refresh rate shall be similar to current one ..
float freq = mmCurrent.getRefreshRate();
// Target rotation shall be similar to current one
int rot = mmCurrent.getRotation();
// Filter criterias sequential out of all available MonitorMode of the chosen MonitorDevice
List<MonitorMode> monitorModes = monitor.getSupportedModes();
monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
monitorModes = MonitorModeUtil.filterByRotation(monitorModes, rot);
monitorModes = MonitorModeUtil.filterByResolution(monitorModes, res);
monitorModes = MonitorModeUtil.filterByRate(monitorModes, freq);
monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
// pick 1st one and set to current ..
MonitorMode mm = monitorModes.get(0);
monitor.setCurrentMode(mm);
Definition at line 113 of file MonitorMode.java.
| com.jogamp.newt.MonitorMode.MonitorMode | ( | final int | nativeId, |
| final SizeAndRRate | sizeAndRRate, | ||
| final int | rotation | ||
| ) |
| sizeAndRRate | the surface size and refresh rate mode |
| rotation | the screen rotation, measured counter clockwise (CCW) |
Definition at line 300 of file MonitorMode.java.
| com.jogamp.newt.MonitorMode.MonitorMode | ( | final SurfaceSize | surfaceSize, |
| final float | refreshRate, | ||
| final int | flags, | ||
| final int | rotation | ||
| ) |
Creates a user instance w/o identity to filter our matching modes w/ identity.
See com.jogamp.newt.util.MonitorModeUtil for filter utilities.
| surfaceSize | |
| refreshRate | |
| flags | |
| rotation |
Definition at line 320 of file MonitorMode.java.
| int com.jogamp.newt.MonitorMode.compareTo | ( | final MonitorMode | mm | ) |
Compares sizeAndRRate 1st, then rotation.
Rotation is compared inverted, i.e. 360 - rotation, so the lowest rotation reflects a higher value.
Order of comparing MonitorMode:
Definition at line 394 of file MonitorMode.java.
| final boolean com.jogamp.newt.MonitorMode.equals | ( | final Object | obj | ) |
Tests equality of two MonitorMode objects by evaluating equality of it's components:
nativeId sizeAndRRate rotation Definition at line 419 of file MonitorMode.java.
| final int com.jogamp.newt.MonitorMode.getFlags | ( | ) |
Returns bitfield w/ flags, i.e.
FLAG_DOUBLESCAN, FLAG_INTERLACE, ..
Definition at line 343 of file MonitorMode.java.
| final int com.jogamp.newt.MonitorMode.getId | ( | ) |
Definition at line 325 of file MonitorMode.java.
| final float com.jogamp.newt.MonitorMode.getRefreshRate | ( | ) |
Returns the vertical refresh rate.
Definition at line 338 of file MonitorMode.java.
| final int com.jogamp.newt.MonitorMode.getRotatedHeight | ( | ) |
Returns the rotated screen height in pixel units, derived from getMonitorMode().getSurfaceSize().getResolution() and getRotation()
Definition at line 364 of file MonitorMode.java.
| final int com.jogamp.newt.MonitorMode.getRotatedWidth | ( | ) |
Returns the rotated screen width in pixel units, derived from getMonitorMode().getSurfaceSize().getResolution() and getRotation()
Definition at line 356 of file MonitorMode.java.
| final int com.jogamp.newt.MonitorMode.getRotation | ( | ) |
Returns the CCW rotation of this mode.
Definition at line 348 of file MonitorMode.java.
| final SizeAndRRate com.jogamp.newt.MonitorMode.getSizeAndRRate | ( | ) |
Returns the surfaceSize and refreshRate instance.
Definition at line 328 of file MonitorMode.java.
| final SurfaceSize com.jogamp.newt.MonitorMode.getSurfaceSize | ( | ) |
Returns the unrotated SurfaceSize.
Definition at line 333 of file MonitorMode.java.
| final int com.jogamp.newt.MonitorMode.hashCode | ( | ) |
Returns a combined hash code of it's elements:
nativeId sizeAndRRate rotation Definition at line 439 of file MonitorMode.java.
|
static |
| final String com.jogamp.newt.MonitorMode.toString | ( | ) |
|
static |
|
static |
|
static |
Comparator for 2 MonitorModes, following comparison order as described in MonitorMode#compareTo(MonitorMode), returning the ascending order.
Definition at line 116 of file MonitorMode.java.
|
static |
Comparator for 2 MonitorModes, following comparison order as described in MonitorMode#compareTo(MonitorMode), returning the descending order.
Definition at line 123 of file MonitorMode.java.
|
static |
zero rotation, compared to normal settings
Definition at line 268 of file MonitorMode.java.
|
static |
180 degrees CCW rotation
Definition at line 274 of file MonitorMode.java.
|
static |
270 degrees CCW rotation
Definition at line 277 of file MonitorMode.java.
|
static |
90 degrees CCW rotation
Definition at line 271 of file MonitorMode.java.