JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
ExclusiveContextBase00.java
Go to the documentation of this file.
1/**
2 * Copyright 2013 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.opengl.test.junit.jogl.acore.ect;
30
31import com.jogamp.newt.NewtFactory;
32import com.jogamp.newt.Window;
33import com.jogamp.opengl.test.junit.util.GLTestUtil;
34import com.jogamp.opengl.test.junit.util.UITestCase;
35
36import com.jogamp.opengl.util.AnimatorBase;
37
38import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
39import com.jogamp.common.os.Platform;
40import com.jogamp.nativewindow.Capabilities;
41import com.jogamp.nativewindow.util.InsetsImmutable;
42
43import com.jogamp.opengl.GLAutoDrawable;
44import com.jogamp.opengl.GLCapabilities;
45import com.jogamp.opengl.GLCapabilitiesImmutable;
46import com.jogamp.opengl.GLProfile;
47
48import org.junit.Assert;
49import org.junit.BeforeClass;
50import org.junit.AfterClass;
51import org.junit.Test;
52import org.junit.FixMethodOrder;
53import org.junit.runners.MethodSorters;
54
55/**
56 * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase.
57 */
58@FixMethodOrder(MethodSorters.NAME_ASCENDING)
59public abstract class ExclusiveContextBase00 extends UITestCase {
60 static boolean testExclusiveWithAWT = false;
61 static final int durationParts = 9;
62 static long duration = 320 * durationParts; // ms ~ 20 frames
63
64 static boolean showFPS = false;
65 static int showFPSRate = 100;
66
67 static final int demoWinSize = 128;
68
69 static InsetsImmutable insets = null;
70 static int num_x, num_y;
71
72 static int swapInterval = 0;
73
74 @BeforeClass
75 public static void initClass00() {
76 final Window dummyWindow = NewtFactory.createWindow(new Capabilities());
77 dummyWindow.setSize(demoWinSize, demoWinSize);
78 dummyWindow.setVisible(true);
79 Assert.assertEquals(true, dummyWindow.isVisible());
80 Assert.assertEquals(true, dummyWindow.isNativeValid());
81 insets = dummyWindow.getInsets();
82 final int scrnHeight = dummyWindow.getScreen().getHeight();
83 final int scrnWidth = dummyWindow.getScreen().getWidth();
84 final int[] demoScreenSize = dummyWindow.convertToPixelUnits(new int[] { demoWinSize, demoWinSize });
85 final int[] insetsScreenSize = dummyWindow.convertToPixelUnits(new int[] { insets.getTotalWidth(), insets.getTotalHeight() });
86 num_x = scrnWidth / ( demoScreenSize[0] + insetsScreenSize[0] ) - 2;
87 num_y = scrnHeight / ( demoScreenSize[1] + insetsScreenSize[1] ) - 2;
88 dummyWindow.destroy();
89 }
90
91 @AfterClass
92 public static void releaseClass00() {
93 }
94
95 protected abstract boolean isAWTTestCase();
96 protected abstract Thread getAWTRenderThread();
97 protected abstract AnimatorBase createAnimator();
98 protected abstract GLAutoDrawable createGLAutoDrawable(String title, int x, int y, int width, int height, GLCapabilitiesImmutable caps);
99 protected abstract void setGLAutoDrawableVisible(GLAutoDrawable[] glads);
100 protected abstract void destroyGLAutoDrawableVisible(GLAutoDrawable glad);
101
102 protected void runTestGL(final GLCapabilitiesImmutable caps, final int drawableCount, final boolean exclusive, final boolean preAdd, final boolean preVisible, final boolean shortenTest) throws InterruptedException {
103 final boolean useAWTRenderThread = isAWTTestCase();
104 if( useAWTRenderThread && exclusive ) {
105 if( testExclusiveWithAWT ) {
106 System.err.println("Warning: Testing AWT + Exclusive -> Not advised!");
107 } else {
108 System.err.println("Info: Skip test: AWT + Exclusive!");
109 return;
110 }
111 }
112 if( useAWTRenderThread && exclusive && !testExclusiveWithAWT) {
113 System.err.println("Skip test: AWT + Exclusive -> Not advised!");
114 return;
115 }
116 final Thread awtRenderThread = getAWTRenderThread();
117 final AnimatorBase[] animators = new AnimatorBase[drawableCount];
118 final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount];
119 for(int i=0; i<drawableCount; i++) {
120 animators[i] = createAnimator();
121 if( !useAWTRenderThread ) {
123 }
124
125 final int x = ( i % num_x ) * ( demoWinSize + insets.getTotalHeight() ) + insets.getLeftWidth();
126 final int y = ( (i / num_x) % num_y ) * ( demoWinSize + insets.getTotalHeight() ) + insets.getTopHeight();
127 drawables[i] = createGLAutoDrawable("Win #"+i, x, y, demoWinSize, demoWinSize, caps);
128 Assert.assertNotNull(drawables[i]);
129 final GearsES2 demo = new GearsES2(swapInterval);
130 demo.setVerbose(false);
131 drawables[i].addGLEventListener(demo);
132
133 if( preAdd ) {
134 animators[i].add(drawables[i]);
135 if( exclusive ) {
136 if( useAWTRenderThread ) {
137 Assert.assertEquals(null, animators[i].setExclusiveContext(awtRenderThread));
138 } else {
139 Assert.assertEquals(false, animators[i].setExclusiveContext(true));
140 }
141 }
142 }
143 Assert.assertFalse(animators[i].isAnimating());
144 Assert.assertFalse(animators[i].isStarted());
145 }
146
147 if( preVisible ) {
148 setGLAutoDrawableVisible(drawables);
149
150 // Made visible, check if drawables are realized
151 for(int i=0; i<drawableCount; i++) {
152 Assert.assertEquals(true, drawables[i].isRealized());
153 animators[i].setUpdateFPSFrames(showFPSRate, showFPS ? System.err : null);
154 }
155 }
156
157 // Animator Start
158 for(int i=0; i<drawableCount; i++) {
159 Assert.assertTrue(animators[i].start());
160
161 Assert.assertTrue(animators[i].isStarted());
162 if( preAdd ) {
163 Assert.assertTrue(animators[i].isAnimating());
164 } else {
165 Assert.assertFalse(animators[i].isAnimating());
166 if( exclusive ) {
167 if( useAWTRenderThread ) {
168 Assert.assertEquals(null, animators[i].setExclusiveContext(awtRenderThread));
169 } else {
170 Assert.assertEquals(false, animators[i].setExclusiveContext(true));
171 }
172 }
173 animators[i].add(drawables[i]);
174 Assert.assertTrue(animators[i].isAnimating());
175 }
176
177 // After start, ExclusiveContextThread is set
178 Assert.assertEquals(exclusive, animators[i].isExclusiveContextEnabled());
179 {
180 final Thread ect = animators[i].getExclusiveContextThread();
181 if(exclusive) {
182 if( useAWTRenderThread ) {
183 Assert.assertEquals(awtRenderThread, ect);
184 } else {
185 Assert.assertEquals(animators[i].getThread(), ect);
186 }
187 } else {
188 Assert.assertEquals(null, ect);
189 }
190 Assert.assertEquals(ect, drawables[i].getExclusiveContextThread());
191 }
192 }
193
194 if( !preVisible ) {
195 setGLAutoDrawableVisible(drawables);
196
197 // Made visible, check if drawables are realized
198 for(int i=0; i<drawableCount; i++) {
199 Assert.assertEquals(true, drawables[i].isRealized());
200 animators[i].setUpdateFPSFrames(showFPSRate, showFPS ? System.err : null);
201 }
202 }
203
204 // Normal run ..
205 Thread.sleep(duration/durationParts); // 1
206
207 if( !shortenTest ) {
208 // Disable/Enable exclusive mode manually for all GLAutoDrawable
209 if(exclusive) {
210 final Thread ects[] = new Thread[drawableCount];
211 for(int i=0; i<drawableCount; i++) {
212 ects[i] = animators[i].getExclusiveContextThread();
213 if( useAWTRenderThread ) {
214 Assert.assertEquals(awtRenderThread, ects[i]);
215 } else {
216 Assert.assertEquals(animators[i].getThread(), ects[i]);
217 }
218 // Disable ECT now ..
219 {
220 final Thread t = drawables[i].setExclusiveContextThread(null);
221 Assert.assertEquals(ects[i], t); // old one should match
222 }
223 }
224
225 Thread.sleep(duration/durationParts); // 2
226
227 for(int i=0; i<drawableCount; i++) {
228 // poll until clearing drawable ECT is established
229 {
230 boolean ok = null == drawables[i].getExclusiveContextThread();
231 int c = 0;
232 while(!ok && c<5*50) { // 5*50*20 = 5s TO
233 Thread.sleep(20);
234 ok = null == drawables[i].getExclusiveContextThread();
235 c++;
236 }
237 if(c>0) {
238 System.err.println("Clearing drawable ECT was done 'later' @ "+(c*20)+"ms, ok "+ok);
239 }
240 Assert.assertEquals(true, ok);
241 }
242 final Thread t = drawables[i].setExclusiveContextThread(ects[i]);
243 Assert.assertEquals(null, t);
244 }
245
246 Thread.sleep(duration/durationParts); // 3
247
248 // Disable/Enable exclusive mode via Animator for all GLAutoDrawable
249 for(int i=0; i<drawableCount; i++) {
250 ects[i] = animators[i].getExclusiveContextThread();
251 if( useAWTRenderThread ) {
252 Assert.assertEquals(awtRenderThread, ects[i]);
253 } else {
254 Assert.assertEquals(animators[i].getThread(), ects[i]);
255 }
256
257 Assert.assertEquals(true, animators[i].setExclusiveContext(false));
258 Assert.assertFalse(animators[i].isExclusiveContextEnabled());
259 Assert.assertEquals(null, drawables[i].getExclusiveContextThread());
260 }
261
262 Thread.sleep(duration/durationParts); // 4
263
264 for(int i=0; i<drawableCount; i++) {
265 Assert.assertEquals(null, animators[i].setExclusiveContext(ects[i]));
266 Assert.assertTrue(animators[i].isExclusiveContextEnabled());
267 Assert.assertEquals(ects[i], animators[i].getExclusiveContextThread());
268 Assert.assertEquals(ects[i], drawables[i].getExclusiveContextThread());
269 }
270
271 Thread.sleep(duration/durationParts); // 5
272 }
273
274 for(int i=0; i<drawableCount; i++) {
275 Assert.assertEquals(exclusive, animators[i].isExclusiveContextEnabled());
276 Assert.assertTrue(animators[i].isStarted());
277 Assert.assertTrue(animators[i].isAnimating());
278 Assert.assertFalse(animators[i].isPaused());
279
280 // Animator Pause
281 Assert.assertTrue(animators[i].pause());
282 Assert.assertTrue(animators[i].isStarted());
283 Assert.assertFalse(animators[i].isAnimating());
284 Assert.assertTrue(animators[i].isPaused());
285 Assert.assertEquals(exclusive, animators[i].isExclusiveContextEnabled());
286 if(exclusive) {
287 final Thread ect = animators[i].getExclusiveContextThread();
288 if( useAWTRenderThread ) {
289 Assert.assertEquals(awtRenderThread, ect);
290 } else {
291 Assert.assertEquals(animators[i].getThread(), ect);
292 }
293 } else {
294 Assert.assertEquals(null, animators[i].getExclusiveContextThread());
295 }
296
297 Assert.assertEquals(null, drawables[i].getExclusiveContextThread());
298 }
299 Thread.sleep(duration/durationParts); // 6
300
301 // Animator Resume
302 for(int i=0; i<drawableCount; i++) {
303 Assert.assertTrue(animators[i].resume());
304 Assert.assertTrue(animators[i].isStarted());
305 Assert.assertTrue(animators[i].isAnimating());
306 Assert.assertFalse(animators[i].isPaused());
307 Assert.assertEquals(exclusive, animators[i].isExclusiveContextEnabled());
308 if(exclusive) {
309 final Thread ect = animators[i].getExclusiveContextThread();
310 if( useAWTRenderThread ) {
311 Assert.assertEquals(awtRenderThread, ect);
312 } else {
313 Assert.assertEquals(animators[i].getThread(), ect);
314 }
315 Assert.assertEquals(ect, drawables[i].getExclusiveContextThread());
316 } else {
317 Assert.assertEquals(null, animators[i].getExclusiveContextThread());
318 Assert.assertEquals(null, drawables[i].getExclusiveContextThread());
319 }
320 }
321 Thread.sleep(duration/durationParts); // 7
322
323 // Animator Stop #1
324 for(int i=0; i<drawableCount; i++) {
325 Assert.assertTrue(animators[i].stop());
326 Assert.assertFalse(animators[i].isAnimating());
327 Assert.assertFalse(animators[i].isStarted());
328 Assert.assertFalse(animators[i].isPaused());
329 Assert.assertEquals(exclusive, animators[i].isExclusiveContextEnabled());
330 Assert.assertEquals(null, animators[i].getExclusiveContextThread());
331 Assert.assertEquals(null, drawables[i].getExclusiveContextThread());
332 }
333 Thread.sleep(duration/durationParts); // 8
334
335 // Animator Re-Start
336 for(int i=0; i<drawableCount; i++) {
337 Assert.assertTrue(animators[i].start());
338 Assert.assertTrue(animators[i].isStarted());
339 Assert.assertTrue(animators[i].isAnimating());
340 Assert.assertEquals(exclusive, animators[i].isExclusiveContextEnabled());
341 // After start, ExclusiveContextThread is set
342 {
343 final Thread ect = animators[i].getExclusiveContextThread();
344 if(exclusive) {
345 if( useAWTRenderThread ) {
346 Assert.assertEquals(awtRenderThread, ect);
347 } else {
348 Assert.assertEquals(animators[i].getThread(), ect);
349 }
350 } else {
351 Assert.assertEquals(null, ect);
352 }
353 Assert.assertEquals(ect, drawables[i].getExclusiveContextThread());
354 }
355 }
356 Thread.sleep(duration/durationParts); // 9
357
358 // Remove all drawables .. while running!
359 for(int i=0; i<drawableCount; i++) {
360 final GLAutoDrawable drawable = drawables[i];
361 animators[i].remove(drawable);
362 Assert.assertEquals(null, drawable.getExclusiveContextThread());
363 Assert.assertTrue(animators[i].isStarted());
364 Assert.assertFalse(animators[i].isAnimating()); // no drawables in list!
365 }
366 } // !shortenTest
367
368 // Animator Stop #2
369 for(int i=0; i<drawableCount; i++) {
370 Assert.assertTrue(animators[i].stop());
371 Assert.assertFalse(animators[i].isAnimating());
372 Assert.assertFalse(animators[i].isStarted());
373 Assert.assertFalse(animators[i].isPaused());
374 Assert.assertEquals(exclusive, animators[i].isExclusiveContextEnabled());
375 Assert.assertEquals(null, animators[i].getExclusiveContextThread());
376 }
377
378 // Destroy GLWindows
379 for(int i=0; i<drawableCount; i++) {
380 destroyGLAutoDrawableVisible(drawables[i]);
381 Assert.assertEquals(true, GLTestUtil.waitForRealized(drawables[i], false, null));
382 }
383 }
384
385 @Test
386 public void test01NormalPre_1WinPostVis() throws InterruptedException {
387 final GLProfile glp = GLProfile.getGL2ES2();
388 final GLCapabilities caps = new GLCapabilities( glp );
389 runTestGL(caps, 1 /* numWin */, false /* exclusive */, true /* preAdd */, false /* preVis */, false /* short */);
390 }
391
392 @Test
393 public void test02NormalPost_1WinPostVis() throws InterruptedException {
394 final GLProfile glp = GLProfile.getGL2ES2();
395 final GLCapabilities caps = new GLCapabilities( glp );
396 runTestGL(caps, 1 /* numWin */, false /* exclusive */, false /* preAdd */, false /* preVis */, true /* short */);
397 }
398
399 @Test
400 public void test03ExclPre_1WinPostVis() throws InterruptedException {
401 final GLProfile glp = GLProfile.getGL2ES2();
402 final GLCapabilities caps = new GLCapabilities( glp );
403 runTestGL(caps, 1 /* numWin */, true /* exclusive */, true /* preAdd */, false /* preVis */, false /* short */);
404 }
405
406 @Test
407 public void test04ExclPost_1WinPostVis() throws InterruptedException {
408 final GLProfile glp = GLProfile.getGL2ES2();
409 final GLCapabilities caps = new GLCapabilities( glp );
410 runTestGL(caps, 1 /* numWin */, true /* exclusive */, false /* preAdd */, false /* preVis */, true /* short */);
411 }
412
413 @Test
414 public void test05NormalPre_4WinPostVis() throws InterruptedException {
415 final GLProfile glp = GLProfile.getGL2ES2();
416 final GLCapabilities caps = new GLCapabilities( glp );
417 runTestGL(caps, 4 /* numWin */, false /* exclusive */, true /* preAdd */, false /* preVis */, false /* short */);
418 }
419
420 @Test
421 public void test06NormalPost_4WinPostVis() throws InterruptedException {
422 final GLProfile glp = GLProfile.getGL2ES2();
423 final GLCapabilities caps = new GLCapabilities( glp );
424 runTestGL(caps, 4 /* numWin */, false /* exclusive */, false /* preAdd */, false /* preVis */, true /* short */);
425 }
426
427 @Test
428 public void test07ExclPre_4WinPostVis() throws InterruptedException {
429 if( Platform.OSType.MACOS == Platform.getOSType() ) {
430 // Bug 1415 - MacOS 10.14.6 + OpenJDK11U occasional freezes having multiple Windows created on a ExclusiveContextThread
431 System.err.println("Disabled, see Bug 1415");
432 return;
433 }
434 final GLProfile glp = GLProfile.getGL2ES2();
435 final GLCapabilities caps = new GLCapabilities( glp );
436 runTestGL(caps, 4 /* numWin */, true /* exclusive */, true /* preAdd */, false /* preVis */, false /* short */);
437 }
438
439 @Test
440 public void test08ExclPost_4WinPostVis() throws InterruptedException {
441 if( Platform.OSType.MACOS == Platform.getOSType() ) {
442 // Bug 1415 - MacOS 10.14.6 + OpenJDK11U occasional freezes having multiple Windows created on a ExclusiveContextThread
443 System.err.println("Disabled, see Bug 1415");
444 return;
445 }
446 final GLProfile glp = GLProfile.getGL2ES2();
447 final GLCapabilities caps = new GLCapabilities( glp );
448 runTestGL(caps, 4 /* numWin */, true /* exclusive */, false /* preAdd */, false /* preVis */, true /* short */);
449 }
450
451 @Test
452 public void test11NormalPre_1WinPreVis() throws InterruptedException {
453 final GLProfile glp = GLProfile.getGL2ES2();
454 final GLCapabilities caps = new GLCapabilities( glp );
455 runTestGL(caps, 1 /* numWin */, false /* exclusive */, true /* preAdd */, true /* preVis */, false /* short */);
456 }
457
458 @Test
459 public void test12NormalPost_1WinPreVis() throws InterruptedException {
460 final GLProfile glp = GLProfile.getGL2ES2();
461 final GLCapabilities caps = new GLCapabilities( glp );
462 runTestGL(caps, 1 /* numWin */, false /* exclusive */, false /* preAdd */, true /* preVis */, true /* short */);
463 }
464
465 @Test
466 public void test13ExclPre_1WinPreVis() throws InterruptedException {
467 final GLProfile glp = GLProfile.getGL2ES2();
468 final GLCapabilities caps = new GLCapabilities( glp );
469 runTestGL(caps, 1 /* numWin */, true /* exclusive */, true /* preAdd */, true /* preVis */, false /* short */);
470 }
471
472 @Test
473 public void test14ExclPost_1WinPreVis() throws InterruptedException {
474 final GLProfile glp = GLProfile.getGL2ES2();
475 final GLCapabilities caps = new GLCapabilities( glp );
476 runTestGL(caps, 1 /* numWin */, true /* exclusive */, false /* preAdd */, true /* preVis */, true /* short */);
477 }
478
479 @Test
480 public void test15NormalPre_4WinPreVis() throws InterruptedException {
481 final GLProfile glp = GLProfile.getGL2ES2();
482 final GLCapabilities caps = new GLCapabilities( glp );
483 runTestGL(caps, 4 /* numWin */, false /* exclusive */, true /* preAdd */, true /* preVis */, false /* short */);
484 }
485
486 @Test
487 public void test16NormalPost_4WinPreVis() throws InterruptedException {
488 final GLProfile glp = GLProfile.getGL2ES2();
489 final GLCapabilities caps = new GLCapabilities( glp );
490 runTestGL(caps, 4 /* numWin */, false /* exclusive */, false /* preAdd */, true /* preVis */, true /* short */);
491 }
492
493 @Test
494 public void test17ExclPre_4WinPreVis() throws InterruptedException {
495 final GLProfile glp = GLProfile.getGL2ES2();
496 final GLCapabilities caps = new GLCapabilities( glp );
497 runTestGL(caps, 4 /* numWin */, true /* exclusive */, true /* preAdd */, true /* preVis */, false /* short */);
498 }
499
500 @Test
501 public void test18ExclPost_4WinPreVis() throws InterruptedException {
502 final GLProfile glp = GLProfile.getGL2ES2();
503 final GLCapabilities caps = new GLCapabilities( glp );
504 runTestGL(caps, 4 /* numWin */, true /* exclusive */, false /* preAdd */, true /* preVis */, true /* short */);
505 }
506}
Specifies a set of capabilities that a window's rendering context must support, such as color depth p...
static Window createWindow(final CapabilitiesImmutable caps)
Create a top level Window entity on the default Display and default Screen.
abstract int getHeight()
abstract int getWidth()
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
Definition: GLProfile.java:77
static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
Definition: GLProfile.java:913
ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature and An...
abstract void setGLAutoDrawableVisible(GLAutoDrawable[] glads)
abstract GLAutoDrawable createGLAutoDrawable(String title, int x, int y, int width, int height, GLCapabilitiesImmutable caps)
void runTestGL(final GLCapabilitiesImmutable caps, final int drawableCount, final boolean exclusive, final boolean preAdd, final boolean preVisible, final boolean shortenTest)
static boolean waitForRealized(final GLAutoDrawable glad, final boolean realized, final Runnable waitAction)
Definition: GLTestUtil.java:91
Base implementation of GLAnimatorControl
static final int MODE_EXPECT_AWT_RENDERING_THREAD
If present in modeBits field and AWT is available, implementation is aware of the AWT EDT,...
final synchronized void setModeBits(final boolean enable, final int bitValues)
Enables or disables the given bitValues in this Animators modeBits.
final synchronized Thread getExclusiveContextThread()
Returns the exclusive context thread if isExclusiveContextEnabled() and isStarted(),...
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final synchronized void remove(final GLAutoDrawable drawable)
Removes a drawable from the animator's list of rendering drawables.
final void setUpdateFPSFrames(final int frames, final PrintStream out)
int[] convertToPixelUnits(final int[] windowUnitsAndResult)
Converts the given window units into pixel units in place.
InsetsImmutable getInsets()
Returns the insets defined as the width and height of the window decoration on the left,...
Immutable insets representing rectangular window decoration insets on all four edges in window units.
Specifying NEWT's Window functionality:
Definition: Window.java:115
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.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
Thread setExclusiveContextThread(Thread t)
Dedicates this instance's GLContext to the given thread.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Specifies an immutable set of OpenGL capabilities.