29package com.jogamp.opengl.test.junit.jogl.acore.ect;
31import java.awt.BorderLayout;
32import java.awt.Component;
33import java.awt.Container;
34import java.awt.Dimension;
35import java.awt.EventQueue;
38import com.jogamp.opengl.GLAutoDrawable;
39import com.jogamp.opengl.GLCapabilitiesImmutable;
40import com.jogamp.opengl.awt.GLCanvas;
42import org.junit.Assert;
43import org.junit.BeforeClass;
44import org.junit.AfterClass;
45import org.junit.FixMethodOrder;
46import org.junit.runners.MethodSorters;
48import com.jogamp.common.os.Platform;
49import com.jogamp.common.util.VersionNumber;
54@FixMethodOrder(MethodSorters.NAME_ASCENDING)
58 static boolean osxCALayerAWTModBug;
63 final VersionNumber version170 =
new VersionNumber(1, 7, 0);
64 osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
65 0 > Platform.getJavaVersionNumber().compareTo(version170);
66 System.err.println(
"OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug);
67 System.err.println(
"OSType "+Platform.getOSType());
68 System.err.println(
"Java Version "+Platform.getJavaVersionNumber());
71 EventQueue.invokeAndWait(
new Runnable() {
73 awtEDT = Thread.currentThread();
75 }
catch (
final Exception e) {
104 EventQueue.invokeAndWait(
new Runnable() {
106 final Frame frame =
new Frame();
107 frame.setLayout(
new BorderLayout());
108 frame.setMinimumSize(
new Dimension(width, height));
109 frame.setBounds(x, y, width, height);
110 frame.add(glCanvas, BorderLayout.CENTER);
113 if( !osxCALayerAWTModBug ) {
114 frame.setTitle(title);
117 }
catch (
final Exception e) {
119 Assert.assertNull(e);
126 Container p = ((Component)glad).getParent();
127 while(
null != p && !( p instanceof Frame ) ) {
136 EventQueue.invokeAndWait(
new Runnable() {
138 final int count = glads.length;
139 for(
int i=0; i<count; i++) {
141 final Frame frame = getFrame(glad);
142 frame.setVisible(
true);
145 }
catch (
final Exception e) {
147 Assert.assertNull(e);
153 final Frame frame = getFrame(glad);
155 EventQueue.invokeAndWait(
new Runnable() {
159 }
catch (
final Exception e) {
161 Assert.assertNull(e);
A heavyweight AWT component which provides OpenGL rendering support.
ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature and An...
void destroyGLAutoDrawableVisible(final GLAutoDrawable glad)
static void initClass00AWT()
static void releaseClass00AWT()
void setGLAutoDrawableVisible(final GLAutoDrawable[] glads)
GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps)
Frame getFrame(final GLAutoDrawable glad)
Thread getAWTRenderThread()
ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature and An...
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
Specifies an immutable set of OpenGL capabilities.