1package com.jogamp.opengl.test.junit.jogl.util.texture;
4import java.io.IOException;
6import com.jogamp.opengl.GLAutoDrawable;
7import com.jogamp.opengl.GLCapabilities;
8import com.jogamp.opengl.GLEventListener;
9import com.jogamp.opengl.GLProfile;
10import com.jogamp.opengl.awt.GLCanvas;
12import org.junit.Assert;
13import org.junit.Assume;
14import org.junit.BeforeClass;
16import org.junit.FixMethodOrder;
17import org.junit.runners.MethodSorters;
19import com.jogamp.opengl.test.junit.jogl.demos.es2.TextureSequenceCubeES2;
20import com.jogamp.opengl.test.junit.util.MiscUtils;
21import com.jogamp.opengl.test.junit.util.QuitAdapter;
22import com.jogamp.opengl.test.junit.util.UITestCase;
23import com.jogamp.opengl.util.Animator;
24import com.jogamp.opengl.util.texture.ImageSequence;
25import com.jogamp.opengl.util.texture.TextureIO;
27@FixMethodOrder(MethodSorters.NAME_ASCENDING)
29 static boolean showFPS =
false;
30 static int width = 510;
31 static int height = 300;
32 static boolean useBuildInTexLookup =
false;
33 static long duration = 500;
40 Assert.assertNotNull(glp);
42 Assert.assertNotNull(caps);
45 void testImpl() throws InterruptedException {
47 final Frame frame =
new Frame(
"TestTextureSequence01AWT");
48 Assert.assertNotNull(frame);
57 }
catch (
final IOException e) {
66 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) { }
70 final QuitAdapter quitAdapter =
new QuitAdapter();
71 new com.jogamp.newt.event.awt.AWTKeyAdapter(quitAdapter, glc).addTo(glc);
72 new com.jogamp.newt.event.awt.AWTWindowAdapter(quitAdapter, glc).addTo(glc);
75 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
77 frame.setSize(width, height);
78 frame.setVisible(
true);
80 }
catch(
final Throwable throwable ) {
81 throwable.printStackTrace();
82 Assume.assumeNoException( throwable );
85 final Animator animator =
new Animator(glc);
86 animator.setUpdateFPSFrames(60, showFPS ? System.err :
null);
89 while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
94 Assert.assertFalse(animator.isAnimating());
95 Assert.assertFalse(animator.isStarted());
97 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
99 frame.setVisible(
false);
103 }
catch(
final Throwable throwable ) {
104 throwable.printStackTrace();
105 Assume.assumeNoException( throwable );
110 public void test1() throws InterruptedException {
114 public static void main(
final String[] args) {
115 for(
int i=0; i<args.length; i++) {
116 if(args[i].equals(
"-time")) {
119 }
else if(args[i].equals(
"-width")) {
122 }
else if(args[i].equals(
"-height")) {
125 }
else if(args[i].equals(
"-shaderBuildIn")) {
126 useBuildInTexLookup =
true;
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
A heavyweight AWT component which provides OpenGL rendering support.
void addGLEventListener(final GLEventListener listener)
Adds the given listener to the end of this drawable queue.
static void main(final String[] args)
static int atoi(final String str, final int def)
static long atol(final String str, final long def)
Simple TextureSequence implementation allowing existing textures or image streams to be used and repl...
final TextureSequence.TextureFrame addFrame(final GL gl, final Texture tex)
static final String PNG
Constant which can be used as a file suffix to indicate a PNG file, value {@value}.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.