29package com.jogamp.opengl.test.junit.jogl.glsl;
31import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
32import com.jogamp.opengl.test.junit.util.GLSLSimpleProgram;
33import com.jogamp.opengl.test.junit.util.UITestCase;
36import com.jogamp.opengl.GLCapabilities;
37import com.jogamp.opengl.GLContext;
38import com.jogamp.opengl.GLProfile;
40import org.junit.Assert;
42import org.junit.FixMethodOrder;
43import org.junit.runners.MethodSorters;
45import com.jogamp.newt.opengl.GLWindow;
46import com.jogamp.opengl.util.Animator;
47import com.jogamp.opengl.test.junit.jogl.demos.es2.shader.RedSquareShader;
48import com.jogamp.opengl.test.junit.util.MiscUtils;
50import java.io.IOException;
51import com.jogamp.opengl.GL2ES2;
53@FixMethodOrder(MethodSorters.NAME_ASCENDING)
55 static long durationPerTest = 100;
58 public
void testGLSLCompilation01() {
60 Assert.assertNotNull(glp);
62 Assert.assertNotNull(caps);
65 Assert.assertNotNull(window);
93 public
void testGLSLUse01() throws InterruptedException {
95 Assert.assertNotNull(glp);
97 Assert.assertNotNull(caps);
100 Assert.assertNotNull(window);
109 Assert.assertEquals(
true, animator.isAnimating());
113 Assert.assertEquals(
true, animator.isAnimating());
119 public static void main(
final String args[])
throws IOException {
120 System.err.println(
"main - start");
121 for(
int i=0; i<args.length; i++) {
122 if(args[i].equals(
"-time")) {
123 durationPerTest =
MiscUtils.
atoi(args[++i], (
int)durationPerTest);
127 org.junit.runner.JUnitCore.
main(tstname);
128 System.err.println(
"main - end");
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final boolean isNativeValid()
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 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.
abstract int makeCurrent()
Makes this GLContext current on the calling thread.
final boolean isCreated()
Indicates whether the underlying native OpenGL context has been created.
abstract void release()
Releases control of this GLContext from the current thread.
abstract GL getGL()
Returns the GL pipeline object for this GLContext.
Specifies the the OpenGL profile.
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.
static final String VERTEX_SHADER_TEXT
static final String FRAGMENT_SHADER_TEXT
static void main(final String args[])
void release(final GL2ES2 gl)
static GLSLSimpleProgram create(final GL2ES2 gl, final String vertShaderCode, final String fragShaderCode, final boolean link)
static int atoi(final String str, final int def)
final long getTotalFPSDuration()
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.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GLContext getContext()
Returns the context associated with this drawable.
GL2ES2 getGL2ES2()
Casts this object to the GL2ES2 interface.
boolean isRealized()
Returns true if this drawable is realized, otherwise false.