29package com.jogamp.opengl.test.junit.jogl.acore;
31import java.io.IOException;
33import com.jogamp.newt.opengl.GLWindow;
35import com.jogamp.nativewindow.util.InsetsImmutable;
36import com.jogamp.opengl.GLCapabilities;
37import com.jogamp.opengl.GLProfile;
38import com.jogamp.opengl.util.Animator;
40import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
41import com.jogamp.opengl.test.junit.util.NewtTestUtil;
42import com.jogamp.opengl.test.junit.util.UITestCase;
44import org.junit.Assert;
45import org.junit.BeforeClass;
47import org.junit.FixMethodOrder;
48import org.junit.runners.MethodSorters;
50@FixMethodOrder(MethodSorters.NAME_ASCENDING)
54 static int width, height;
62 Assert.assertNotNull(glp);
64 Assert.assertNotNull(caps);
68 setTestSupported(
false);
72 private void initShared() {
74 Assert.assertNotNull(sharedDrawable);
75 sharedGears =
new Gears(0);
76 Assert.assertNotNull(sharedGears);
78 sharedDrawable.
setSize(width, height);
84 private void releaseShared() {
85 Assert.assertNotNull(sharedDrawable);
87 sharedDrawable =
null;
90 protected GLWindow runTestGL(
final Animator animator,
final int x,
final int y,
final boolean useShared,
final boolean vsync)
throws InterruptedException {
93 Assert.assertNotNull(glWindow);
94 glWindow.
setTitle(
"Shared Gears NEWT Test: "+x+
"/"+y+
" shared "+useShared);
96 glWindow.setSharedAutoDrawable(sharedDrawable);
99 glWindow.
setSize(width, height);
107 animator.add(glWindow);
119 public
void test01() throws InterruptedException {
125 f1.
getY()+0,
true,
false);
130 Thread.sleep(duration);
131 }
catch(
final Exception e) {
146 static long duration = 2000;
148 public static void main(
final String args[])
throws IOException {
149 for(
int i=0; i<args.length; i++) {
150 if(args[i].equals(
"-time")) {
153 duration = Integer.parseInt(args[i]);
154 }
catch (
final Exception ex) { ex.printStackTrace(); }
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setPosition(final int x, final int y)
Sets the location of the window's client area excluding insets (window decorations) in window units.
final void setTitle(final String title)
final int getX()
Returns the current x position of this window, relative to it's parent.
final int getY()
Returns the current y position of the top-left corner of the client area relative to it's parent in w...
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final InsetsImmutable getInsets()
Returns the insets defined as the width and height of the window decoration on the left,...
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 boolean isAvailable(final AbstractGraphicsDevice device, final String profile)
Returns the availability of a profile on a device.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
static final String GL2
The desktop OpenGL profile 1.x up to 3.0.
static void main(final String args[])
GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync)
Gears.java author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel)
void setSharedGears(final Gears shared)
static boolean waitForRealized(final Screen screen, final boolean realized, final Runnable waitAction)
static boolean waitForVisible(final Window win, final boolean visible, final Runnable waitAction)
Immutable insets representing rectangular window decoration insets on all four edges in window units.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.