diff --git a/docs/html/guide/topics/graphics/opengl.jd b/docs/html/guide/topics/graphics/opengl.jd index d19408208a1d8..3e3d569837fe8 100644 --- a/docs/html/guide/topics/graphics/opengl.jd +++ b/docs/html/guide/topics/graphics/opengl.jd @@ -33,14 +33,6 @@ page.tags=games
  • {@link android.opengl.GLSurfaceView}
  • {@link android.opengl.GLSurfaceView.Renderer}
  • -

    Related samples

    -
      -
    1. GLSurfaceViewActivity
    2. -
    3. GLES20Activity
    4. -
    5. TouchRotateActivity
    6. -
    7. Compressed Textures
    8. -

    See also

    1. @@ -54,7 +46,8 @@ href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics

      Android includes support for high performance 2D and 3D graphics with the Open Graphics Library -(OpenGL®), specifically, the OpenGL ES API. OpenGL is a cross-platform graphics API that specifies a +(OpenGL®), specifically, the OpenGL ES API. OpenGL is a cross-platform graphics API that +specifies a standard software interface for 3D graphics processing hardware. OpenGL ES is a flavor of the OpenGL specification intended for embedded devices. Android supports several versions of the OpenGL ES API:

      @@ -65,6 +58,8 @@ API:

    2. OpenGL ES 3.0 - This API specification is supported by Android 4.3 (API level 18) and higher.
    3. +
    4. OpenGL ES 3.1 - This API specification is supported by Android 5.0 (API level 21) and higher. +
    5. Caution: @@ -176,10 +171,18 @@ calling OpenGL APIs using the following classes:

      interface to OpenGL ES 2.0 and is available starting with Android 2.2 (API level 8). -
    6. OpenGL ES 3.0 API Class +
    7. +
    8. OpenGL ES 3.0/3.1 API Packages
    9. @@ -196,9 +199,12 @@ href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml

    For a complete example of how to apply projection and camera view with OpenGL ES 2.0, see the Displaying Graphics with OpenGL ES class.

    +href="{@docRoot}training/graphics/opengl/index.html">Displaying Graphics with OpenGL ES +class.

    Shape Faces and Winding

    @@ -585,10 +601,47 @@ supported.

    device. +

    Android Extension Pack (AEP)

    -

    Checking OpenGL ES Version

    +

    The AEP ensures that your application supports a standardized set of OpenGL extensions above +and beyond +the core set described in the OpenGL 3.1 specification. Packaging these extensions together +encourages a consistent set of functionality across devices, while allowing developers to take full +advantage of the latest crop of mobile GPU devices.

    -

    There are several versions of the OpenGL ES available on Android devices. You can specify the +

    The AEP also improves support for images, shader storage buffers, and atomic counters in +fragment shaders.

    + +

    For your app to be able to use the AEP, the app's manifest must declare that the AEP is required. +In addition, the platform version must support it.

    + +

    Declare the AEP requirement in the manifest as follows:

    + +
    +<uses feature android:name="android.hardware.opengles.aep"
    +              android:required="true" />
    +
    + +

    To verify that the platform version supports the AEP, use the +{@link android.content.pm.PackageManager#hasSystemFeature} method, passing in +{@link android.content.pm.PackageManager#FEATURE_OPENGLES_EXTENSION_PACK} as the argument. The following code snippet +shows an example of how to do so:

    + +
    +boolean deviceSupportsAEP = getPackageManager().hasSystemFeature
    +     (PackageManager.FEATURE_OPENGLES_EXTENSION_PACK);
    +
    + +

    If the method returns true, AEP is supported.

    + +

    For more information about the AEP, visit its page at the +Khronos OpenGL ES Registry. + + +

    Checking the OpenGL ES Version

    + +

    There are several versions of OpenGL ES available on Android devices. You can specify the minimum version of the API your application requires in your manifest, but you may also want to take advantage of features in a newer API at the same time. For example, the OpenGL ES 3.0 API is backward-compatible with the 2.0 version of the API, so you may want to @@ -600,7 +653,7 @@ application manifest, your application should check the version of the API avail You can do this in one of two ways:

      -
    1. Attempt create the higher-level OpenGL ES context ({@link android.opengl.EGLContext}) and +
    2. Attempt to create the higher-level OpenGL ES context ({@link android.opengl.EGLContext}) and check the result.
    3. Create a minimum-supported OpenGL ES context and check the version value.