From 1baf11b116d4094ea1f7149bbf1348d6290a637e Mon Sep 17 00:00:00 2001 From: Jack Palevich Date: Wed, 22 Jul 2009 12:59:49 -0700 Subject: [PATCH] Add a public API that reports the supported OpenGLES API level. --- api/current.xml | 50 +++++++++++++++++++++++++ opengl/java/android/opengl/Version.java | 47 +++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 opengl/java/android/opengl/Version.java diff --git a/api/current.xml b/api/current.xml index 46969e0ade2c1..a730ed0830b07 100644 --- a/api/current.xml +++ b/api/current.xml @@ -91622,6 +91622,56 @@ + + + + + + + + + + + * A device that supports a given API level must also support + * numerically smaller API levels. + *

+ * A device that supports a given API level may not necessarily + * support every feature of that API level. API-specific techniques may + * be used to determine whether specific features are supported. + * + * @return the highest OpenGL ES API level supported by the current device. + */ + public static int getOpenGLESVersion() { + return SystemProperties.getInt("ro.opengles.version", OPENGLES_11); + } + + /** + * The version number for OpenGL ES 1.1. + */ + public final static int OPENGLES_11 = 11; + + /** + * The version number for OpenGL ES 2.0. + */ + public final static int OPENGLES_20 = 20; +}