Sfoglia il codice sorgente

Add alpha bits to AppSettings. Currently only to be used for Android EGL config choosing.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10809 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
iwg..ic 12 anni fa
parent
commit
c1c9fc871a
1 ha cambiato i file con 28 aggiunte e 0 eliminazioni
  1. 28 0
      engine/src/core/com/jme3/system/AppSettings.java

+ 28 - 0
engine/src/core/com/jme3/system/AppSettings.java

@@ -619,6 +619,25 @@ public final class AppSettings extends HashMap<String, Object> {
         putInteger("DepthBits", value);
     }
 
+    /**
+     * Android Only
+     * Sets the number of alpha bits to use.
+     * <p>
+     * The number of alpha bits specifies the precision of the surface view
+     * background alpha value.  To set the surface view to opaque (fastest setting),
+     * leave the number of alpha bits = 0.  This will cause faster rendering,
+     * but android views located behind the surface view will not be viewable.
+     * To set the surface view to translucent, set the number of alphaBits to 8
+     * or higher.  Values less than 8 (except 0) will set the surface view pixel
+     * format to transparent. <p>
+     * (Default: 0)
+     *
+     * @param value The alpha bits
+     */
+    public void setAlphaBits(int value){
+        putInteger("AlphaBits", value);
+    }
+
     /**
      * Set the number of stencil bits.
      * <p>
@@ -807,6 +826,15 @@ public final class AppSettings extends HashMap<String, Object> {
         return getInteger("DepthBits");
     }
 
+    /**
+     * Android Only
+     * Get the number of alpha bits for the surface view to use.
+     * @see #setAlphaBits(int)
+     */
+    public int getAlphaBits() {
+        return getInteger("AlphaBits");
+    }
+
     /**
      * Get the number of stencil bits
      * @see #setStencilBits(int)