29package com.jogamp.opengl.test.junit.newt;
31import org.junit.Assert;
32import org.junit.Assume;
34import org.junit.FixMethodOrder;
35import org.junit.runners.MethodSorters;
37import com.jogamp.opengl.*;
39import com.jogamp.opengl.util.Animator;
41import com.jogamp.newt.*;
42import com.jogamp.newt.opengl.*;
43import java.io.IOException;
45import com.jogamp.opengl.test.junit.util.UITestCase;
46import com.jogamp.opengl.test.junit.jogl.demos.es1.GearsES1;
48import com.jogamp.nativewindow.AbstractGraphicsDevice;
49import com.jogamp.nativewindow.NativeWindowException;
51@FixMethodOrder(MethodSorters.NAME_ASCENDING)
53 static int width = 640, height = 480;
54 static long durationPerTest = 100;
55 static String remoteDisplay =
"localhost:0.0";
58 throws InterruptedException
60 Assert.assertNotNull(caps);
67 Assert.assertNotNull(glWindow);
70 Assert.assertNotNull(glWindow);
77 Assert.assertEquals(
true,glWindow.
isVisible());
83 static void destroyWindow(
final GLWindow glWindow) {
94 Assert.assertNotNull(glpLocal);
96 Assert.assertNotNull(capsLocal);
98 final GLWindow windowLocal = createWindow(
null, capsLocal, demoLocal);
100 Assert.assertEquals(
true,windowLocal.
isVisible());
105 animator.
add(windowLocal);
117 System.err.println(displayRemote);
119 System.err.println(deviceRemote);
121 System.err.println();
124 Assert.assertNotNull(glpRemote);
126 Assert.assertNotNull(capsRemote);
129 windowRemote = createWindow(screenRemote, capsRemote, demoRemote);
131 System.err.println(nwe);
132 Assume.assumeNoException(nwe);
133 destroyWindow(windowLocal);
138 Assert.assertEquals(
true,windowRemote.
isVisible());
140 animator.
add(windowRemote);
147 if(
null!=demoRemote) {
152 destroyWindow(windowLocal);
153 destroyWindow(windowRemote);
156 static int atoi(
final String a) {
159 i = Integer.parseInt(a);
160 }
catch (
final Exception ex) { ex.printStackTrace(); }
164 public static void main(
final String args[])
throws IOException {
165 for(
int i=0; i<args.length; i++) {
166 if(args[i].equals(
"-time")) {
167 durationPerTest = atoi(args[++i]);
168 }
else if(args[i].equals(
"-display")) {
169 remoteDisplay = args[++i];
172 System.out.println(
"durationPerTest: "+durationPerTest);
173 System.out.println(
"display: "+remoteDisplay);
175 org.junit.runner.JUnitCore.
main(tstname);
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
abstract AbstractGraphicsDevice getGraphicsDevice()
Return the AbstractGraphicsDevice used for depending resources lifecycle, i.e.
abstract void createNative()
Manual trigger the native creation, if it is not done yet.
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 Display getDisplay()
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 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.
Specifies the the OpenGL profile.
static String glAvailabilityToString(final AbstractGraphicsDevice device)
static GLProfile getGL2ES1(final AbstractGraphicsDevice device)
Returns the GL2ES1 profile implementation, hence compatible w/ GL2ES1.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
static final String GL2ES1
The intersection of the desktop GL2 and embedded ES1 profile.
static void initProfiles(final AbstractGraphicsDevice device)
Trigger eager initialization of GLProfiles for the given device, in case it isn't done yet.
GLArrayDataServer backFace
static void main(final String args[])
void testRemoteWindow01()
final long getTotalFPSDuration()
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final void setUpdateFPSFrames(final int frames, final PrintStream out)
final synchronized boolean start()
Starts this animator, if not running.
final boolean isVBO()
Determines whether the data is server side (VBO) and enabled, or a client side array (false).
A interface describing a graphics device in a toolkit-independent manner.
String getConnection()
Returns the semantic GraphicsDevice connection.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.