28package com.jogamp.opengl.test.junit.jogl.acore;
30import com.jogamp.opengl.GLAutoDrawable;
31import com.jogamp.opengl.GLCapabilities;
32import com.jogamp.opengl.GLEventListener;
33import com.jogamp.opengl.GLProfile;
35import org.junit.Assert;
37import org.junit.FixMethodOrder;
38import org.junit.runners.MethodSorters;
40import com.jogamp.newt.opengl.GLWindow;
41import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
42import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
43import com.jogamp.opengl.test.junit.util.UITestCase;
44import com.jogamp.opengl.util.Animator;
56@FixMethodOrder(MethodSorters.NAME_ASCENDING)
60 public
void test01_Plain() {
65 public
void test01_Anim() {
69 private void test01Impl(
final boolean anim) {
76 final GLWindow window2 = GLWindow.create(caps);
77 window2.setPosition(0, 0);
78 window2.setSize(200, 200);
79 window2.addGLEventListener(
new RedSquareES2());
81 final GLWindow window1 = GLWindow.create(caps);
83 final Animator animator1 =
new Animator(0 );
84 final Animator animator2 =
new Animator(0 );
86 animator1.add(window1);
87 animator2.add(window2);
92 window1.setPosition(250, 0);
93 window1.setSize(200, 200);
96 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) { }
105 public void display(
final GLAutoDrawable drawable) {
109 window1.addGLEventListener(
new GearsES2());
112 window2.setVisible(
true);
113 window1.setVisible(
true);
119 }
catch(
final InterruptedException ie) {}
124 final int win1Frames = window1.getTotalFPSFrames();
125 final int win2Frames = window2.getTotalFPSFrames();
126 System.err.println(
"Window1: frames "+win1Frames);
127 System.err.println(
"Window2: frames "+win2Frames);
128 Assert.assertTrue(
"Win2 frames not double the amount of Win1 frames", 2*win2Frames >= win1Frames);
134 public static void main(
final String args[]) {
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 final String GL2ES2
The intersection of the desktop GL3, GL2 and embedded ES2 profile.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
Tests recursive GLContext behavior.
static void main(final String args[])
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
void display(GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client.