29package com.jogamp.opengl.test.junit.jogl.demos.gl2.newt;
31import com.jogamp.newt.opengl.GLWindow;
32import com.jogamp.opengl.test.junit.util.UITestCase;
33import com.jogamp.opengl.test.junit.util.QuitAdapter;
35import com.jogamp.opengl.util.Animator;
37import com.jogamp.opengl.test.junit.jogl.demos.gl2.Teapot;
39import com.jogamp.opengl.GLCapabilities;
40import com.jogamp.opengl.GLProfile;
42import org.junit.Assert;
43import org.junit.BeforeClass;
44import org.junit.AfterClass;
46import org.junit.FixMethodOrder;
47import org.junit.runners.MethodSorters;
49@FixMethodOrder(MethodSorters.NAME_ASCENDING)
52 static int width, height;
58 Assert.assertNotNull(glp);
62 setTestSupported(
false);
73 glWindow.
setTitle(
"Teapot NEWT Test");
90 glWindow.
setSize(width, height);
97 final long t0 = System.currentTimeMillis();
100 while(!quitAdapter.shouldQuit() && t1-t0<duration) {
102 t1 = System.currentTimeMillis();
106 if( !withAnimator ) {
120 runTestGL(caps,
true);
126 runTestGL(caps,
false);
146 runTestGL(caps,
false);
149 static long duration = 500;
151 public static void main(
final String args[]) {
152 for(
int i=0; i<args.length; i++) {
153 if(args[i].equals(
"-time")) {
156 duration = Integer.parseInt(args[i]);
157 }
catch (
final Exception ex) { ex.printStackTrace(); }
void setRedBits(final int redBits)
Sets the number of bits requested for the color buffer's red component.
void setGreenBits(final int greenBits)
Sets the number of bits requested for the color buffer's green component.
void setBlueBits(final int blueBits)
Sets the number of bits requested for the color buffer's blue component.
void setAlphaBits(final int alphaBits)
Sets the number of bits requested for the color buffer's alpha component.
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.
void setStencilBits(final int stencilBits)
Sets the number of bits requested for the stencil buffer.
void setDoubleBuffered(final boolean enable)
Enables or disables double buffering.
void setHardwareAccelerated(final boolean enable)
Enables or disables hardware acceleration.
void setFBO(final boolean enable)
Requesting offscreen FBO mode.
void setNumSamples(final int numSamples)
If sample buffers are enabled, indicates the number of buffers to be allocated.
void setSampleBuffers(final boolean enable)
Defaults to false.
void setDepthBits(final int depthBits)
Sets the number of bits requested for the depth buffer.
Specifies the the OpenGL profile.
static boolean isAvailable(final AbstractGraphicsDevice device, final String profile)
Returns the availability of a profile on a device.
static GLProfile getMaxFixedFunc(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
Returns the highest profile, implementing the fixed function pipeline.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
static final String GL2
The desktop OpenGL profile 1.x up to 3.0.
Adapted from http://www.java-tips.org/other-api-tips/jogl/how-to-draw-a-texture-mapped-teapot-with-au...
void runTestGL(final GLCapabilities caps, final boolean withAnimator)
static void main(final String args[])
void test12_FBOCaps_NoAnim()
void test02_DefCaps_NoAnim()
static void releaseClass()
void test01_DefCaps_Anim()
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.