|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.newt.ScreenMode
public class ScreenMode
Immutable ScreenMode Class, consisting of it's read only components:
MonitorMode, non rotated valuesrotation, measured counter clockwise (CCW)Screen.getScreenModes().ScreenModeUtil to filter and select a desired ScreenMode.Screen.getCurrentScreenMode().Screen.getOriginalScreenMode().Screen.setCurrentScreenMode(com.jogamp.newt.ScreenMode)Screen.getFQName().
Screen.getOriginalScreenMode())
is restored.
// determine target refresh rate
ScreenMode orig = screen.getOriginalScreenMode();
int freq = orig.getMonitorMode().getRefreshRate();
// target resolution
Dimension res = new Dimension(800, 600);
// target rotation
int rot = 0;
// filter available ScreenModes
List screenModes = screen.getScreenModes();
screenModes = ScreenModeUtil.filterByRate(screenModes, freq); // get the nearest ones
screenModes = ScreenModeUtil.filterByRotation(screenModes, rot);
screenModes = ScreenModeUtil.filterByResolution(screenModes, res); // get the nearest ones
screenModes = ScreenModeUtil.getHighestAvailableBpp(screenModes);
// pick 1st one ..
screen.setCurrentScreenMode((ScreenMode) screenModes.get(0));
X11 / AMD just works
NVidia RANDR RefreshRate Bug
If NVidia's 'DynamicTwinView' is enabled, all refresh rates are
unique, ie consequent numbers starting with the default refresh, ie 50, 51, ..
The only way to workaround it is to disable 'DynamicTwinView'.
Read: http://us.download.nvidia.com/XFree86/Linux-x86/260.19.12/README/configtwinview.html
Check to see if 'DynamicTwinView' is enable:
nvidia-settings -q :0/DynamicTwinview
To disable it (workaround), add the following option to your xorg.conf device section:
Option "DynamicTwinView" "False"
NVidia RANDR Rotation:
To enable it, add the following option to your xorg.conf device section:
Option "RandRRotation" "on"
| Field Summary | |
|---|---|
static int |
ROTATE_0
zero rotation, compared to normal settings |
static int |
ROTATE_180
180 degrees CCW rotation |
static int |
ROTATE_270
270 degrees CCW rotation |
static int |
ROTATE_90
90 degrees CCW rotation |
| Constructor Summary | |
|---|---|
ScreenMode(MonitorMode monitorMode,
int rotation)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Tests equality of two ScreenMode objects
by evaluating equality of it's components:monitorMode
rotation
|
MonitorMode |
getMonitorMode()
Returns the unrotated MonitorMode |
int |
getRotatedHeight()
Returns the rotated screen height, derived from getMonitorMode().getSurfaceSize().getResolution()
and getRotation() |
int |
getRotatedWidth()
Returns the rotated screen width, derived from getMonitorMode().getSurfaceSize().getResolution()
and getRotation() |
int |
getRotation()
Returns the CCW rotation of this mode |
int |
hashCode()
Returns a combined hash code of it's elements: monitorMode
rotation
|
static boolean |
isRotationValid(int rotation)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ROTATE_0
public static final int ROTATE_90
public static final int ROTATE_180
public static final int ROTATE_270
| Constructor Detail |
|---|
public ScreenMode(MonitorMode monitorMode,
int rotation)
monitorMode - the monitor moderotation - the screen rotation, measured counter clockwise (CCW)| Method Detail |
|---|
public static boolean isRotationValid(int rotation)
public final MonitorMode getMonitorMode()
MonitorMode
public final int getRotation()
public final int getRotatedWidth()
getMonitorMode().getSurfaceSize().getResolution()
and getRotation()
public final int getRotatedHeight()
getMonitorMode().getSurfaceSize().getResolution()
and getRotation()
public final String toString()
toString in class Objectpublic final boolean equals(Object obj)
ScreenMode objects
by evaluating equality of it's components:monitorModerotation
equals in class Objectpublic final int hashCode()
monitorModerotation
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||