29package com.jogamp.opengl.test.junit.newt.mm;
31import java.io.IOException;
32import com.jogamp.nativewindow.NativeWindowFactory;
34import org.junit.Assert;
35import org.junit.BeforeClass;
37import org.junit.FixMethodOrder;
38import org.junit.runners.MethodSorters;
40import com.jogamp.newt.Display;
41import com.jogamp.newt.MonitorDevice;
42import com.jogamp.newt.NewtFactory;
43import com.jogamp.newt.Screen;
44import com.jogamp.newt.MonitorMode;
45import com.jogamp.newt.opengl.GLWindow;
46import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
47import com.jogamp.opengl.test.junit.util.NewtTestUtil;
48import com.jogamp.opengl.test.junit.util.UITestCase;
49import com.jogamp.opengl.util.Animator;
51import java.util.Iterator;
53import com.jogamp.opengl.GLCapabilities;
54import com.jogamp.opengl.GLCapabilitiesImmutable;
60@FixMethodOrder(MethodSorters.NAME_ASCENDING)
62 static int width, height;
64 static int waitTimeShort = 4;
65 static int waitTimeLong = 6;
69 setResetXRandRIfX11AfterClass();
95 Assert.assertTrue(screenModes.size()>0);
97 for(
final Iterator<MonitorMode> iter=screenModes.iterator(); iter.hasNext(); i++) {
98 System.err.println(i+
": "+iter.next());
103 Assert.assertNotNull(mm_o);
105 Assert.assertNotNull(mm_c);
106 System.err.println(
"orig: "+mm_o);
107 System.err.println(
"curr: "+mm_c);
109 for(i=0; i<50; i++) {
111 Assert.assertNotNull(mm_c);
112 System.err.print(
"."+i);
114 System.err.println(
"!");
120 Assert.assertEquals(
false,window.
isVisible());
127 public static void main(
final String args[])
throws IOException {
129 org.junit.runner.JUnitCore.
main(tstname);
Provides a pluggable mechanism for arbitrary window toolkits to adapt their components to the NativeW...
static synchronized void initSingleton()
Static one time initialization of this factory.
abstract boolean isNativeValid()
Visual output device, i.e.
abstract MonitorMode queryCurrentMode()
Returns the current MonitorMode resulting from a native query.
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:
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.
abstract List< MonitorMode > getMonitorModes()
Return a list of all MonitorModes for all MonitorDevices.
abstract boolean isNativeValid()
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final boolean isNativeValid()
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 boolean isVisible()
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Specifies a set of OpenGL capabilities.
Queries the current MonitorMode 50 times, stressing a possible race condition.
static void main(final String args[])
void testScreenModeInfo01()
static boolean waitForRealized(final Screen screen, final boolean realized, final Runnable waitAction)
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Specifies an immutable set of OpenGL capabilities.