29package com.jogamp.opengl.test.junit.jogl.awt;
31import java.lang.reflect.InvocationTargetException;
32import com.jogamp.opengl.GLProfile;
33import com.jogamp.opengl.GLCapabilities;
34import com.jogamp.opengl.awt.GLCanvas;
35import com.jogamp.opengl.util.Animator;
37import com.jogamp.opengl.test.junit.util.UITestCase;
38import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
42import java.awt.Window;
43import javax.swing.JFrame;
45import org.junit.Before;
46import org.junit.BeforeClass;
48import org.junit.FixMethodOrder;
49import org.junit.runners.MethodSorters;
51import static org.junit.Assume.*;
52import static javax.swing.SwingUtilities.*;
58@FixMethodOrder(MethodSorters.NAME_ASCENDING)
60 private Window[] windows;
70 windows =
new Window[]{
72 new Frame(
"Frame GL test"),
73 new JFrame(
"JFrame GL test")
79 for (
final Window window : windows) {
81 System.out.println(
"testing with "+window.getClass().getName());
86 final Runnable test =
new Runnable() {
90 window.add(glCanvas[0]);
95 window.setSize(512, 512);
98 window.setVisible(
true);
103 final Runnable cleanup =
new Runnable() {
105 System.out.println(
"cleaning up...");
106 window.setVisible(
false);
109 }
catch (
final Throwable t) {
110 assumeNoException(t);
127 invokeAndWait(cleanup);
132 public void test01GLDefault() throws InterruptedException, InvocationTargetException {
134 System.out.println(
"GLProfile Default: "+glp);
139 System.out.println(
"not a GL2ES2 profile");
144 public void test02GL2() throws InterruptedException, InvocationTargetException {
147 System.out.println(
"GLProfile GL2: " + glprofile );
151 System.out.println(
"GL2 n/a");
155 public static void main(
final String args[]) {
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static boolean isAvailable(final AbstractGraphicsDevice device, final String profile)
Returns the availability of a profile on a device.
final boolean isGL2ES2()
Indicates whether this profile is capable of GL2ES2.
static String glAvailabilityToString(final AbstractGraphicsDevice device)
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
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.
A heavyweight AWT component which provides OpenGL rendering support.
void addGLEventListener(final GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Tests context creation + display on various kinds of Window implementations.
void runTestGL(final GLCapabilities caps)
static void main(final String args[])
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.