1package com.jogamp.opengl.test.junit.jogl.util.texture;
3import java.io.IOException;
5import com.jogamp.opengl.GLAutoDrawable;
6import com.jogamp.opengl.GLCapabilities;
7import com.jogamp.opengl.GLEventListener;
8import com.jogamp.opengl.GLProfile;
10import org.junit.Assert;
11import org.junit.BeforeClass;
13import org.junit.FixMethodOrder;
14import org.junit.runners.MethodSorters;
16import com.jogamp.newt.opengl.GLWindow;
17import com.jogamp.opengl.test.junit.jogl.demos.es2.TextureSequenceCubeES2;
18import com.jogamp.opengl.test.junit.util.MiscUtils;
19import com.jogamp.opengl.test.junit.util.QuitAdapter;
20import com.jogamp.opengl.test.junit.util.UITestCase;
21import com.jogamp.opengl.util.Animator;
22import com.jogamp.opengl.util.texture.ImageSequence;
23import com.jogamp.opengl.util.texture.TextureIO;
25@FixMethodOrder(MethodSorters.NAME_ASCENDING)
27 static boolean showFPS =
false;
28 static int width = 510;
29 static int height = 300;
30 static boolean useBuildInTexLookup =
false;
31 static long duration = 500;
38 Assert.assertNotNull(glp);
40 Assert.assertNotNull(caps);
43 void testImpl() throws InterruptedException {
45 window.
setTitle(
"TestTextureSequence01NEWT");
54 }
catch (
final IOException e) {
63 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) { }
65 window.
addGLEventListener(
new TextureSequenceCubeES2(texSource,
false, -2.3f, 0f, 0f));
66 final Animator animator =
new Animator(window);
67 animator.setUpdateFPSFrames(60, showFPS ? System.err :
null);
68 final QuitAdapter quitAdapter =
new QuitAdapter();
74 while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
79 Assert.assertFalse(animator.isAnimating());
80 Assert.assertFalse(animator.isStarted());
85 public void test1() throws InterruptedException {
89 public static void main(
final String[] args) {
90 for(
int i=0; i<args.length; i++) {
91 if(args[i].equals(
"-time")) {
94 }
else if(args[i].equals(
"-width")) {
97 }
else if(args[i].equals(
"-height")) {
100 }
else if(args[i].equals(
"-shaderBuildIn")) {
101 useBuildInTexLookup =
true;
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setTitle(final String title)
final void addKeyListener(final KeyListener l)
Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
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 void addWindowListener(final WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
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.
Specifies the the OpenGL profile.
static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
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.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.