29package com.jogamp.opengl.test.junit.newt.mm;
31import java.io.IOException;
32import com.jogamp.opengl.GLCapabilities;
33import com.jogamp.opengl.GLProfile;
35import com.jogamp.opengl.util.Animator;
37import com.jogamp.newt.Display;
38import com.jogamp.newt.MonitorDevice;
39import com.jogamp.newt.NewtFactory;
40import com.jogamp.newt.Screen;
41import com.jogamp.newt.MonitorMode;
42import com.jogamp.newt.opengl.GLWindow;
43import com.jogamp.newt.util.MonitorModeUtil;
44import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
45import com.jogamp.opengl.test.junit.util.UITestCase;
47import com.jogamp.nativewindow.util.Dimension;
55 static int waitTime = 7000;
57 static GLWindow createWindow(
final Screen screen,
final GLCapabilities caps,
final int width,
final int height,
final boolean onscreen,
final boolean undecorated) {
68 final int width = 640;
69 final int height = 480;
74 final GLWindow window = createWindow(screen, caps, width, height,
true ,
false );
83 System.err.println(
"[0] orig : "+mmOrig);
84 System.err.println(
"[0] current: "+mmCurrent);
86 if(
null==monitorModes) {
88 System.err.println(
"Your platform has no ScreenMode change support, sorry");
97 System.err.println(
"[0] set current: "+mm);
100 System.err.print(
"[0] post setting .. wait <");
102 Thread.sleep(waitTime);
103 }
catch (
final InterruptedException e) {
105 System.err.println(
"done>");
109 public static void main(
final String args[])
throws IOException {
void setOnscreen(final boolean onscreen)
Sets whether the surface shall be on- or offscreen.
Visual output device, i.e.
abstract MonitorMode queryCurrentMode()
Returns the current MonitorMode resulting from a native query.
abstract boolean setCurrentMode(MonitorMode mode)
Set the current com.jogamp.newt.MonitorMode.
final List< MonitorMode > getSupportedModes()
Returns a list of immutable MonitorModes supported by this monitor.
final MonitorMode getOriginalMode()
Returns the immutable original com.jogamp.newt.MonitorMode, as used at NEWT initialization.
Immutable MonitorMode Class, consisting of it's read only components:
final float getRefreshRate()
Returns the vertical refresh rate.
static Display createDisplay(final String name)
Create a Display entity.
static Screen createScreen(final Display display, final int index)
Create a Screen entity.
A screen may span multiple MonitorDevices representing their combined virtual size.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final MonitorDevice getMainMonitor()
Returns the MonitorDevice with the highest viewport coverage of this window.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Convenient com.jogamp.newt.MonitorMode utility methods, filters etc.
static List< MonitorMode > filterByFlags(final List< MonitorMode > monitorModes, final int flags)
static List< MonitorMode > filterByResolution(final List< MonitorMode > monitorModes, final DimensionImmutable resolution)
static List< MonitorMode > getHighestAvailableBpp(final List< MonitorMode > monitorModes)
static List< MonitorMode > filterByRotation(final List< MonitorMode > monitorModes, final int rotation)
static List< MonitorMode > filterByRate(final List< MonitorMode > monitorModes, final float refreshRate)
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
Manual testing the ScreenImpl shutdown hook, which shall reset the ScreenMode to it's original state ...
static void main(final String args[])
final synchronized boolean start()
Starts this animator, if not running.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.