Top Description Inners Fields Constructors Methods
jogamp.newt

public Class MonitorModeProps

extends Object
Class Inheritance
Imports
com.jogamp.common.util.ArrayHashSet, com.jogamp.newt.MonitorDevice, .MonitorMode, .Screen, java.util.ArrayList, .List, com.jogamp.nativewindow.ScalableSurface, com.jogamp.nativewindow.util.Dimension, .DimensionImmutable, .Rectangle, .SurfaceSize, com.jogamp.opengl.math.FloatUtil, jogamp.newt.MonitorDeviceImpl, .ScreenImpl

Encodes and decodes MonitorMode and MonitorDevice properties.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
IDX_MONITOR_MODE_BPP

Elements: count + NUM_RESOLUTION_PROPERTIES

Warning

must be synchronized with ScreenMode.h, native implementation

public static final int
public static final int
MIN_MONITOR_DEVICE_PROPERTIES

Elements:

  • count
  • id
  • IsClone
  • IsPrimary
  • ScreenSizeMM[width, height] (2 elements)
  • Rotated Viewport pixel-units (4 elements)
  • Rotated Viewport window-units (4 elements)
  • CurrentMonitorModeId
  • Rotation
  • SupportedModeId+
public static final int
NUM_MONITOR_MODE_PROPERTIES

Elements: id, rotation

Warning

must be synchronized with ScreenMode.h, native implementation

public static final int
public static final int
NUM_RESOLUTION_PROPERTIES

Elements: width, height

Warning

must be synchronized with ScreenMode.h, native implementation

public static final int
NUM_SIZEANDRATE_PROPERTIES

Elements: refresh-rate (Hz*100), flags

Warning

must be synchronized with ScreenMode.h, native implementation

public static final int
NUM_SURFACE_SIZE_PROPERTIES

Element: bpp

Warning

must be synchronized with ScreenMode.h, native implementation

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static MonitorMode
getByNativeIdAndRotation(final List<MonitorMode> monitorModes, final int modeId, final int rotation)

pack-priv static void
identifyMonitorDevices(final MonitorModeProps.Cache cache)

Identify monitor devices:

  • cloned mode, i.e. consecutive devices being 100% covered by preceding devices.
public static MonitorDevice

Returns:

MonitorDevice of the identical (old or new) element in Cache#monitorDevices, matching the input modeProperties, or null if input could not be processed.
streamInMonitorDevice
(final MonitorModeProps.Cache
hash arrays of unique MonitorMode components and MonitorDevices, allowing to avoid duplicates
cache
,
final ScreenImpl
the associated ScreenImpl
screen
,
final float[]
pre-fetched current pixel-scale, maybe null for ScalableSurface#IDENTITY_PIXELSCALE.
pixelScale
,
final int[]
the input data inclusive supported modes.
monitorProperties
,
int
the offset to the input data
offset
,
final int[]
if not null, returns the index of resulting MonitorDevice within Cache#monitorDevices.
monitor_idx
)

Warning

must be synchronized with ScreenMode.h, native implementation

public static MonitorDevice

Returns:

MonitorDevice of the identical (old or new) element in Cache#monitorDevices, matching the input modeProperties, or null if input could not be processed.
streamInMonitorDevice
(final MonitorModeProps.Cache
hash arrays of unique MonitorMode components and MonitorDevices, allowing to avoid duplicates
cache
,
final ScreenImpl
the associated ScreenImpl
screen
,
final MonitorMode
pre-fetched current MonitorModes from cache.
currentMode
,
final float[]
pre-fetched current pixel-scale, maybe null for ScalableSurface#IDENTITY_PIXELSCALE.
pixelScale
,
final ArrayHashSet<MonitorMode>
pre-assembled list of supported MonitorModes from cache.
supportedModes
,
final int[]
the input data minus supported modes!
monitorProperties
,
int
the offset to the input data
offset
,
final int[]
if not null, returns the index of resulting MonitorDevice within Cache#monitorDevices.
monitor_idx
)

Warning

must be synchronized with ScreenMode.h, native implementation

public static MonitorMode

Returns:

MonitorMode of the identical (old or new) element in Cache#monitorModes, matching the input modeProperties, or null if input could not be processed.
streamInMonitorMode
(final int[]
if not null and cache is given, returns the index of resulting MonitorMode within Cache#monitorModes.
mode_idx
,
final MonitorModeProps.Cache
optional hash arrays of unique MonitorMode components and MonitorDevices, allowing to avoid duplicates
cache
,
final int[]
the input data
modeProperties
,
int
the offset to the input data
offset
)

Warning

must be synchronized with ScreenMode.h, native implementation

private static MonitorMode
streamInMonitorMode0(final MonitorMode.SizeAndRRate sizeAndRate, final int[] modeProperties, int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

private static DimensionImmutable
streamInResolution(final int[] resolutionProperties, int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

private static MonitorMode.SizeAndRRate
streamInSizeAndRRate(final SurfaceSize surfaceSize, final int[] sizeAndRRateProperties, int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

private static SurfaceSize
streamInSurfaceSize(final DimensionImmutable resolution, final int[] sizeProperties, final int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

public static int[]
streamOutMonitorDevice(final MonitorDevice monitorDevice)

Warning

must be synchronized with ScreenMode.h, native implementation

public static int[]
streamOutMonitorMode(final MonitorMode monitorMode)

Warning

must be synchronized with ScreenMode.h, native implementation

public static final void
swapRotatePair(final int rotation, final int[] pairs, int offset, final int numPairs)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

IDX_MONITOR_DEVICE_VIEWPORTback to summary
public static final int IDX_MONITOR_DEVICE_VIEWPORT
IDX_MONITOR_MODE_BPPback to summary
public static final int IDX_MONITOR_MODE_BPP

Elements: count + NUM_RESOLUTION_PROPERTIES

Warning

must be synchronized with ScreenMode.h, native implementation

IDX_MONITOR_MODE_ROTback to summary
public static final int IDX_MONITOR_MODE_ROT

Elements:

Warning

must be synchronized with ScreenMode.h, native implementation

MIN_MONITOR_DEVICE_PROPERTIESback to summary
public static final int MIN_MONITOR_DEVICE_PROPERTIES

Elements:

  • count
  • id
  • IsClone
  • IsPrimary
  • ScreenSizeMM[width, height] (2 elements)
  • Rotated Viewport pixel-units (4 elements)
  • Rotated Viewport window-units (4 elements)
  • CurrentMonitorModeId
  • Rotation
  • SupportedModeId+

with Viewport := [x, y, width, height] (4 elements)

Warning

must be synchronized with ScreenMode.h, native implementation

NUM_MONITOR_MODE_PROPERTIESback to summary
public static final int NUM_MONITOR_MODE_PROPERTIES

Elements: id, rotation

Warning

must be synchronized with ScreenMode.h, native implementation

NUM_MONITOR_MODE_PROPERTIES_ALLback to summary
public static final int NUM_MONITOR_MODE_PROPERTIES_ALL

Elements:

Warning

must be synchronized with ScreenMode.h, native implementation

NUM_RESOLUTION_PROPERTIESback to summary
public static final int NUM_RESOLUTION_PROPERTIES

Elements: width, height

Warning

must be synchronized with ScreenMode.h, native implementation

NUM_SIZEANDRATE_PROPERTIESback to summary
public static final int NUM_SIZEANDRATE_PROPERTIES

Elements: refresh-rate (Hz*100), flags

Warning

must be synchronized with ScreenMode.h, native implementation

NUM_SURFACE_SIZE_PROPERTIESback to summary
public static final int NUM_SURFACE_SIZE_PROPERTIES

Element: bpp

Warning

must be synchronized with ScreenMode.h, native implementation

Constructor Detail

MonitorModePropsback to summary
public MonitorModeProps()

Method Detail

getByNativeIdAndRotationback to summary
private static MonitorMode getByNativeIdAndRotation(final List<MonitorMode> monitorModes, final int modeId, final int rotation)
identifyMonitorDevicesback to summary
pack-priv static void identifyMonitorDevices(final MonitorModeProps.Cache cache)

Identify monitor devices:

  • cloned mode, i.e. consecutive devices being 100% covered by preceding devices.
streamInMonitorDeviceback to summary
public static MonitorDevice streamInMonitorDevice(final MonitorModeProps.Cache cache, final ScreenImpl screen, final float[] pixelScale, final int[] monitorProperties, int offset, final int[] monitor_idx)

Warning

must be synchronized with ScreenMode.h, native implementation

Note

This variant only works for impl. w/ a unique mode key pair modeId, rotation.

Parameters
cache:MonitorModeProps.Cache

hash arrays of unique MonitorMode components and MonitorDevices, allowing to avoid duplicates

screen:ScreenImpl

the associated ScreenImpl

pixelScale:float[]

pre-fetched current pixel-scale, maybe null for ScalableSurface#IDENTITY_PIXELSCALE.

monitorProperties:int[]

the input data inclusive supported modes.

offset:int

the offset to the input data

monitor_idx:int[]

if not null, returns the index of resulting MonitorDevice within Cache#monitorDevices.

Returns:MonitorDevice

MonitorDevice of the identical (old or new) element in Cache#monitorDevices, matching the input modeProperties, or null if input could not be processed.

streamInMonitorDeviceback to summary
public static MonitorDevice streamInMonitorDevice(final MonitorModeProps.Cache cache, final ScreenImpl screen, final MonitorMode currentMode, final float[] pixelScale, final ArrayHashSet<MonitorMode> supportedModes, final int[] monitorProperties, int offset, final int[] monitor_idx)

Warning

must be synchronized with ScreenMode.h, native implementation

This variant expects count to be MIN_MONITOR_DEVICE_PROPERTIES - 1 - NUM_MONITOR_MODE_PROPERTIES, due to lack of supported mode and current mode.

Parameters
cache:MonitorModeProps.Cache

hash arrays of unique MonitorMode components and MonitorDevices, allowing to avoid duplicates

screen:ScreenImpl

the associated ScreenImpl

currentMode:MonitorMode

pre-fetched current MonitorModes from cache.

pixelScale:float[]

pre-fetched current pixel-scale, maybe null for ScalableSurface#IDENTITY_PIXELSCALE.

supportedModes:ArrayHashSet<MonitorMode>

pre-assembled list of supported MonitorModes from cache.

monitorProperties:int[]

the input data minus supported modes!

offset:int

the offset to the input data

monitor_idx:int[]

if not null, returns the index of resulting MonitorDevice within Cache#monitorDevices.

Returns:MonitorDevice

MonitorDevice of the identical (old or new) element in Cache#monitorDevices, matching the input modeProperties, or null if input could not be processed.

streamInMonitorModeback to summary
public static MonitorMode streamInMonitorMode(final int[] mode_idx, final MonitorModeProps.Cache cache, final int[] modeProperties, int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

Parameters
mode_idx:int[]

if not null and cache is given, returns the index of resulting MonitorMode within Cache#monitorModes.

cache:MonitorModeProps.Cache

optional hash arrays of unique MonitorMode components and MonitorDevices, allowing to avoid duplicates

modeProperties:int[]

the input data

offset:int

the offset to the input data

Returns:MonitorMode

MonitorMode of the identical (old or new) element in Cache#monitorModes, matching the input modeProperties, or null if input could not be processed.

streamInMonitorMode0back to summary
private static MonitorMode streamInMonitorMode0(final MonitorMode.SizeAndRRate sizeAndRate, final int[] modeProperties, int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

streamInResolutionback to summary
private static DimensionImmutable streamInResolution(final int[] resolutionProperties, int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

streamInSizeAndRRateback to summary
private static MonitorMode.SizeAndRRate streamInSizeAndRRate(final SurfaceSize surfaceSize, final int[] sizeAndRRateProperties, int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

streamInSurfaceSizeback to summary
private static SurfaceSize streamInSurfaceSize(final DimensionImmutable resolution, final int[] sizeProperties, final int offset)

Warning

must be synchronized with ScreenMode.h, native implementation

streamOutMonitorDeviceback to summary
public static int[] streamOutMonitorDevice(final MonitorDevice monitorDevice)

Warning

must be synchronized with ScreenMode.h, native implementation

streamOutMonitorModeback to summary
public static int[] streamOutMonitorMode(final MonitorMode monitorMode)

Warning

must be synchronized with ScreenMode.h, native implementation

swapRotatePairback to summary
public static final void swapRotatePair(final int rotation, final int[] pairs, int offset, final int numPairs)
jogamp.newt back to summary

public Class MonitorModeProps.Cache

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final ArrayHashSet<MonitorDevice>
public final ArrayHashSet<MonitorMode>
private MonitorDevice
public final ArrayHashSet<DimensionImmutable>
public final ArrayHashSet<MonitorMode.SizeAndRRate>
public final ArrayHashSet<SurfaceSize>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final MonitorDevice
public final void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

monitorDevicesback to summary
public final ArrayHashSet<MonitorDevice> monitorDevices
monitorModesback to summary
public final ArrayHashSet<MonitorMode> monitorModes
primaryback to summary
private MonitorDevice primary
resolutionsback to summary
public final ArrayHashSet<DimensionImmutable> resolutions
sizeAndRatesback to summary
public final ArrayHashSet<MonitorMode.SizeAndRRate> sizeAndRates
surfaceSizesback to summary
public final ArrayHashSet<SurfaceSize> surfaceSizes

Constructor Detail

Cacheback to summary
public Cache()

Method Detail

getPrimaryback to summary
public final MonitorDevice getPrimary()
setPrimaryback to summary
public final void setPrimary(final MonitorDevice p)