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.GLDrawableFactory;
38import com.jogamp.opengl.GLOffscreenAutoDrawable;
39import com.jogamp.opengl.GLProfile;
40import com.jogamp.opengl.util.Animator;
42import com.jogamp.opengl.test.junit.util.NewtTestUtil;
43import com.jogamp.opengl.test.junit.util.UITestCase;
44import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
46import org.junit.Assert;
47import org.junit.BeforeClass;
49import org.junit.FixMethodOrder;
50import org.junit.runners.MethodSorters;
52@FixMethodOrder(MethodSorters.NAME_ASCENDING)
56 static int width, height;
64 Assert.assertNotNull(glp);
66 Assert.assertNotNull(caps);
70 setTestSupported(
false);
74 private void initShared() {
76 Assert.assertNotNull(sharedDrawable);
77 sharedGears =
new Gears();
78 Assert.assertNotNull(sharedGears);
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 {
92 Assert.assertNotNull(glWindow);
93 glWindow.
setTitle(
"Shared Gears NEWT Test: "+x+
"/"+y+
" shared "+useShared);
95 glWindow.setSharedAutoDrawable(sharedDrawable);
98 glWindow.
setSize(width, height);
106 animator.add(glWindow);
117 public void test01() throws InterruptedException {
120 final GLWindow f1 = runTestGL(animator, 0, 0,
true,
false);
123 f1.
getY()+0,
true,
false);
140 static long duration = 500;
142 public static void main(
final String args[])
throws IOException {
143 for(
int i=0; i<args.length; i++) {
144 if(args[i].equals(
"-time")) {
147 duration = Integer.parseInt(args[i]);
148 }
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.
abstract GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, GLCapabilitiesChooser chooser, int width, int height)
Creates a realized GLOffscreenAutoDrawable incl it's offscreen NativeSurface with the given capabilit...
static GLDrawableFactory getFactory(final GLProfile glProfile)
Returns the sole GLDrawableFactory instance.
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.
GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync)
static void main(final String args[])
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)
final long getTotalFPSDuration()
final void setUpdateFPSFrames(final int frames, final PrintStream out)
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.
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.
void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
Platform-independent GLAutoDrawable specialization, exposing offscreen functionality.