From 6d28a9ed9ff039237775ea133377f8b59ca857c1 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 6 Oct 2011 04:47:07 +0200
Subject: NEWT/Android: Add TRANSLUCENT feature / Demo: 'GearsES2T'

---
 src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'src/newt')

diff --git a/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java b/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java
index c5019bf63..2c7031dae 100644
--- a/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java
+++ b/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java
@@ -115,7 +115,9 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 {
     public static int getFormat(CapabilitiesImmutable rCaps) {
         int fmt = PixelFormat.UNKNOWN;
         
-        if(rCaps.getRedBits()<=5 &&
+        if(!rCaps.isBackgroundOpaque()) {
+            fmt = PixelFormat.TRANSLUCENT;
+        } else if(rCaps.getRedBits()<=5 &&
            rCaps.getGreenBits()<=6 &&
            rCaps.getBlueBits()<=5 &&
            rCaps.getAlphaBits()==0) {
@@ -313,7 +315,7 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 {
     
     public void surfaceCreated(SurfaceHolder holder) {    
         Log.d(MD.TAG, "surfaceCreated: "+x+"/"+y+" "+width+"x"+height);
-        surfaceRealized(holder);
+        // surfaceRealized(holder);
         Log.d(MD.TAG, "surfaceCreated: X");
     }
 
@@ -389,7 +391,8 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 {
     
     class MSurfaceView extends SurfaceView {
         public MSurfaceView (Context ctx) {
-            super(ctx);            
+            super(ctx);
+            setBackgroundDrawable(null);
         }
     }
     //----------------------------------------------------------------------
-- 
cgit v1.2.3