29package com.jogamp.opengl.test.junit.jogl.acore;
31import com.jogamp.newt.opengl.GLWindow;
33import com.jogamp.nativewindow.util.InsetsImmutable;
34import com.jogamp.opengl.GLAutoDrawable;
35import com.jogamp.opengl.GLCapabilities;
36import com.jogamp.opengl.GLContext;
37import com.jogamp.opengl.GLEventListener;
38import com.jogamp.opengl.GLProfile;
39import com.jogamp.opengl.util.Animator;
41import com.jogamp.opengl.test.junit.util.UITestCase;
42import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
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;
59 Assert.assertNotNull(glp);
61 Assert.assertNotNull(caps);
68 Assert.assertNotNull(glWindow);
69 glWindow.
setTitle(
"Shared Gears NEWT Test: "+x+
"/"+y);
71 glWindow.
setSize(width, height);
77 final int[] maxVals =
new int[] { -1, -1 } ;
80 System.err.println(
"swap group max groups "+maxVals[0]+
", barriers "+maxVals[0]+
", "+r);
81 if(maxVals[0]>=group) {
82 System.err.println(
"swap group joing 1: "+glc.
joinSwapGroup(group));
83 if(maxVals[1]>=barrier) {
84 System.err.println(
"swap group bind 1-1: "+glc.
bindSwapBarrier(group, barrier));
93 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
94 final int width,
final int height) {}
98 animator.
add(glWindow);
110 public void test01() throws InterruptedException {
112 final int swap_group = 9999;
113 final int swap_barrier = 9999;
116 final GLWindow f1 = runTestGL(animator, 0, 0, swap_group, swap_barrier);
133 static long duration = 500;
135 public static void main(
final String args[]) {
136 for(
int i=0; i<args.length; i++) {
137 if(args[i].equals(
"-time")) {
140 duration = Integer.parseInt(args[i]);
141 }
catch (
final Exception ex) { ex.printStackTrace(); }
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setTitle(final String title)
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.
void setTopLevelPosition(final int x, final int y)
Sets the location of the top-level window inclusive insets (window decorations) in window units.
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.
Abstraction for an OpenGL rendering context.
final boolean joinSwapGroup(final int group)
final boolean bindSwapBarrier(final int group, final int barrier)
final boolean queryMaxSwapGroups(final int[] maxGroups, final int maxGroups_offset, final int[] maxBarriers, final int maxBarriers_offset)
Specifies the the OpenGL profile.
static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
void test01()
NV swap group is currently disabled .
static void main(final String args[])
GLWindow runTestGL(final Animator animator, final int x, final int y, final int group, final int barrier)
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 synchronized boolean stop()
Stops this animator.
Immutable insets representing rectangular window decoration insets on all four edges in window units.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GLContext getContext()
Returns the context associated with this drawable.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.