29package com.jogamp.opengl.test.junit.jogl.caps;
31import com.jogamp.common.util.InterruptSource;
32import com.jogamp.junit.util.JunitTracer;
33import com.jogamp.newt.event.KeyAdapter;
34import com.jogamp.newt.event.KeyEvent;
35import com.jogamp.newt.opengl.GLWindow;
36import com.jogamp.opengl.test.junit.util.MiscUtils;
37import com.jogamp.opengl.test.junit.util.UITestCase;
38import com.jogamp.opengl.test.junit.util.QuitAdapter;
39import com.jogamp.opengl.util.Animator;
40import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
42import com.jogamp.opengl.GLCapabilities;
43import com.jogamp.opengl.GLProfile;
45import org.junit.Assert;
46import org.junit.BeforeClass;
47import org.junit.AfterClass;
49import org.junit.FixMethodOrder;
50import org.junit.runners.MethodSorters;
52@FixMethodOrder(MethodSorters.NAME_ASCENDING)
55 static int width, height;
66 Assert.assertNotNull(glp);
77 Assert.assertNotNull(glWindow);
78 glWindow.
setTitle(
"Gears NEWT Test (translucent "+!caps.isBackgroundOpaque()+
")");
90 final GLWindow f_glWindow = glWindow;
92 public void keyReleased(
final KeyEvent e) {
97 new InterruptSource.Thread() {
102 new InterruptSource.Thread() {
110 glWindow.
setSize(width, height);
115 while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.
getTotalFPSDuration()<duration) {
127 runTestGL(caps,
false);
136 runTestGL(caps,
false);
145 runTestGL(caps,
true);
148 static long duration = 500;
150 public static void main(
final String args[]) {
151 boolean waitForKey =
false;
153 for(
int i=0; i<args.length; i++) {
154 if(args[i].equals(
"-time")) {
157 }
else if(args[i].equals(
"-wait")) {
162 JunitTracer.waitForKey(
"main");
void setBackgroundOpaque(final boolean opaque)
Sets whether the surface shall be opaque or translucent.
final char getKeyChar()
Returns the UTF-16 character reflecting the key symbol incl.
static boolean isPrintableKey(final short uniChar, final boolean isKeyChar)
Returns true if given uniChar represents a printable character, i.e.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final boolean isFullscreen()
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 boolean isUndecorated()
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final boolean setFullscreen(final boolean fullscreen)
Enable or disable fullscreen mode for this window.
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 setUndecorated(final boolean value)
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.
void test01TransparentUndecorated()
void test01OpaqueDecorated()
void test01TransparentDecorated()
static void releaseClass()
static void main(final String args[])
void runTestGL(final GLCapabilities caps, final boolean undecorated)
static long atol(final String str, final long 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.