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
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: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). -For OpenGL ES 2.0:
<!-- Tell the system this app requires OpenGL ES 2.0. -->
@@ -209,16 +215,25 @@ shown below.
installed on devices that do not support OpenGL ES 2.0. If your application is exclusively for
devices that support OpenGL ES 3.0, you can also specify this in your manifest:
+For OpenGL ES 3.0:
+
<!-- Tell the system this app requires OpenGL ES 3.0. -->
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
+
+
+For OpenGL ES 3.1:
+
+
+<!-- Tell the system this app requires OpenGL ES 3.1. -->
+<uses-feature android:glEsVersion="0x00030001" android:required="true" />
Note:
- The OpenGL ES 3.0 API is backwards-compatible with the 2.0 API, which means you can be more
+ The OpenGL ES 3.x API is backwards-compatible with the 2.0 API, which means you can be more
flexible with your implementation of OpenGL ES in your application. By declaring the OpenGL
ES 2.0 API as a requirement in your manifest, you can use that API version as a default, check
- for the availability of the 3.0 API at run time and then use OpenGL ES 3.0 features if the
+ for the availability of the 3.x API at run time and then use OpenGL ES 3.x features if the
device supports it. For more information about checking the OpenGL ES version supported by a
device, see Checking OpenGL ES Version.
@@ -414,7 +429,8 @@ public void onDrawFrame(GL10 unused) {
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.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. + + +
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: