29package com.jogamp.opengl.test.junit.jogl.acore;
31import java.io.IOException;
33import com.jogamp.opengl.GLCapabilities;
34import com.jogamp.opengl.GLCapabilitiesImmutable;
35import com.jogamp.opengl.GLContext;
36import com.jogamp.opengl.GLDrawable;
37import com.jogamp.opengl.GLDrawableFactory;
38import com.jogamp.opengl.GLEventListener;
39import com.jogamp.opengl.GLProfile;
41import org.junit.Assert;
43import org.junit.FixMethodOrder;
44import org.junit.runners.MethodSorters;
46import com.jogamp.newt.NewtFactory;
47import com.jogamp.newt.Window;
48import com.jogamp.newt.event.WindowAdapter;
49import com.jogamp.newt.event.WindowEvent;
50import com.jogamp.newt.event.WindowUpdateEvent;
51import com.jogamp.opengl.GLAutoDrawableDelegate;
52import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
53import com.jogamp.opengl.test.junit.util.MiscUtils;
54import com.jogamp.opengl.test.junit.util.NewtTestUtil;
55import com.jogamp.opengl.test.junit.util.QuitAdapter;
56import com.jogamp.opengl.test.junit.util.UITestCase;
57import com.jogamp.opengl.util.Animator;
58import com.jogamp.opengl.util.AnimatorBase;
72@FixMethodOrder(MethodSorters.NAME_ASCENDING)
74 static long duration = 500;
83 Assert.assertNotNull(window);
88 System.out.println(
"Window: "+window.getClass().getName());
91 Assert.assertNotNull(drawable);
96 protected void destroyImplInLock() {
133 Assert.assertTrue(animator.isAnimating());
135 while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.
getTotalFPSDuration()<duration) {
138 System.out.println(
"Fin start ...");
141 Assert.assertFalse(animator.isAnimating());
142 Assert.assertFalse(animator.
isStarted());
144 System.out.println(
"Fin Drawable: "+drawable);
145 System.out.println(
"Fin Window: "+window);
154 public static void main(
final String args[])
throws IOException {
155 for(
int i=0; i<args.length; i++) {
156 if(args[i].equals(
"-time")) {
static Window createWindow(final CapabilitiesImmutable caps)
Create a top level Window entity on the default Display and default Screen.
NEWT Window events are provided for notification purposes ONLY.
Fully functional GLAutoDrawable implementation utilizing already created GLDrawable and GLContext ins...
final void windowResizedOp(final int newWidth, final int newHeight)
Handling resize events from the windowing system.
final void windowDestroyNotifyOp()
Implementation to handle destroy notifications from the windowing system.
final void windowRepaintOp()
Default implementation to handle repaint events from the windowing system.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext....
Specifies a set of OpenGL capabilities.
abstract GLDrawable createGLDrawable(NativeSurface target)
Returns an unrealized GLDrawable according to it's chosen GLCapabilitiesImmutable,...
static GLDrawableFactory getFactory(final GLProfile glProfile)
Returns the sole GLDrawableFactory instance.
Specifies the the OpenGL profile.
static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
Test using a NEWT Window for onscreen case.
void testOnScreenDblBuf()
static void main(final String args[])
static long atol(final String str, final long def)
static boolean waitForRealized(final Screen screen, final boolean realized, final Runnable waitAction)
static boolean waitForVisible(final Window win, final boolean visible, final Runnable waitAction)
final long getTotalFPSDuration()
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final void setUpdateFPSFrames(final int frames, final PrintStream out)
synchronized boolean isStarted()
Indicates whether this animator has been started.
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.
int getSurfaceWidth()
Returns the width of the client area excluding insets (window decorations) in pixel units.
int getSurfaceHeight()
Returns the height of the client area excluding insets (window decorations) in pixel units.
Specifying NEWT's Window functionality:
void addKeyListener(KeyListener l)
Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
void addWindowListener(WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
void setWindowDestroyNotifyAction(Runnable r)
Set a custom action handling destruction issued by a toolkit triggered window destroy replacing the d...
void setSize(int width, int height)
Sets the size of the window's client area in window units, excluding decorations.
void setVisible(boolean visible)
Calls setVisible(true, visible), i.e.
void destroy()
Destroys this window incl.releasing all related resources.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Specifies an immutable set of OpenGL capabilities.
GLProfile getGLProfile()
Returns the GL profile you desire or used by the drawable.
An abstraction for an OpenGL rendering target.
void setRealized(boolean realized)
Indicates to GLDrawable implementations whether the underlying surface has been created and can be dr...
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.