summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java15
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java4
2 files changed, 16 insertions, 3 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
index 8d579ce5d..b5a729e02 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
@@ -21,6 +21,7 @@
package com.jogamp.opengl.test.junit.jogl.demos.es1;
+import javax.media.nativewindow.NativeWindow;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES1;
import javax.media.opengl.GLAutoDrawable;
@@ -181,8 +182,18 @@ public class GearsES1 implements GLEventListener {
// Get the GL corresponding to the drawable we are animating
GL2ES1 gl = drawable.getGL().getGL2ES1();
- gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-
+ final boolean hasFocus;
+ if(drawable.getNativeSurface() instanceof NativeWindow) {
+ hasFocus = ((NativeWindow)drawable.getNativeSurface()).hasFocus();
+ } else {
+ hasFocus = true;
+ }
+ if(hasFocus) {
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ } else {
+ gl.glClearColor(0.2f, 0.2f, 0.2f, 0.0f);
+ }
+
// Special handling for the case where the GLJPanel is translucent
// and wants to be composited with other Java 2D content
if (GLProfile.isAWTAvailable() &&
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
index 63bbab66e..51bc7d137 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
@@ -246,9 +246,11 @@ public class GearsES2 implements GLEventListener {
// Get the GL corresponding to the drawable we are animating
GL2ES2 gl = drawable.getGL().getGL2ES2();
- boolean hasFocus = false;
+ final boolean hasFocus;
if(drawable.getNativeSurface() instanceof NativeWindow) {
hasFocus = ((NativeWindow)drawable.getNativeSurface()).hasFocus();
+ } else {
+ hasFocus = true;
}
if(hasFocus) {
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);