29package com.jogamp.opengl.test.junit.jogl.acore.glels;
31import java.io.IOException;
33import com.jogamp.opengl.GLCapabilities;
34import com.jogamp.opengl.GLProfile;
36import jogamp.nativewindow.jawt.JAWTUtil;
38import com.jogamp.opengl.GLEventListenerState;
39import com.jogamp.opengl.util.Animator;
41import com.jogamp.opengl.test.junit.util.GLEventListenerCounter;
44import org.junit.FixMethodOrder;
45import org.junit.runners.MethodSorters;
63@FixMethodOrder(MethodSorters.NAME_ASCENDING)
67 public
void test01GLCanvasOnscreenGL2ES2() throws InterruptedException {
69 if(
null == reqGLCaps)
return;
70 testGLCanvasImpl(reqGLCaps,
false);
74 public
void test02GLCanvasOnscreenGLES2() throws InterruptedException {
76 if(
null == reqGLCaps)
return;
77 testGLCanvasImpl(reqGLCaps,
false);
81 public
void test11GLCanvasOffscreenGL2ES2() throws InterruptedException {
83 if(
null == reqGLCaps)
return;
84 testGLCanvasImpl(reqGLCaps,
true);
88 public
void test12GLCanvasOffscreenGLES2() throws InterruptedException {
90 if(
null == reqGLCaps)
return;
91 testGLCanvasImpl(reqGLCaps,
true);
94 private void testGLCanvasImpl(
final GLCapabilities caps,
final boolean offscreenLayer)
throws InterruptedException {
95 if( offscreenLayer ) {
96 if( !JAWTUtil.isOffscreenLayerSupported() ) {
97 System.err.println(
"Platform doesn't support offscreen rendering.");
101 if( JAWTUtil.isOffscreenLayerRequired() ) {
102 System.err.println(
"Platform requires offscreen rendering.");
106 final SnapshotGLEventListener snapshotGLEventListener =
new SnapshotGLEventListener();
107 final GLEventListenerCounter glelTracker =
new GLEventListenerCounter();
108 final Animator animator =
new Animator();
116 testGLADOneLifecycle(
null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width,
118 snapshotGLEventListener,
119 null, glels, animator);
124 testGLADOneLifecycle(
null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width+100,
125 height+100, glelTracker,
126 snapshotGLEventListener,
127 glels[0],
null,
null);
132 public static void main(
final String args[])
throws IOException {
133 for(
int i=0; i<args.length; i++) {
134 if(args[i].equals(
"-time")) {
137 duration = Integer.parseInt(args[i]);
138 }
catch (
final Exception ex) { ex.printStackTrace(); }
Specifies a set of OpenGL capabilities.
GLEventListenerState is holding GLAutoDrawable components crucial to relocating all its GLEventListen...
Specifies the the OpenGL profile.
static final String GL2ES2
The intersection of the desktop GL3, GL2 and embedded ES2 profile.
static final String GLES2
The embedded OpenGL profile ES 2.x, with x >= 0.
Test re-association of GLContext/GLDrawables, here GLContext's survival of GLDrawable destruction and...
Test re-association of GLContext/GLDrawables, here GLContext's survival of GLDrawable destruction and...
static void main(final String args[])