summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-07-22 13:06:03 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-07-22 13:06:03 -0700
commit68ce000ed88c8df53c0ddb9a556a8cc8e5dcedb2 (patch)
tree5ebae51a2bf246e90598a672c0275762c9e53cee /opengl
parentc58c78de2fc410bdd081b5824228b32596db4ee3 (diff)
parentef6b66cbbbe7ae8ee0450cbbaae4194b069679a1 (diff)
downloadframeworks_base-68ce000ed88c8df53c0ddb9a556a8cc8e5dcedb2.zip
frameworks_base-68ce000ed88c8df53c0ddb9a556a8cc8e5dcedb2.tar.gz
frameworks_base-68ce000ed88c8df53c0ddb9a556a8cc8e5dcedb2.tar.bz2
am ef6b66cb: Merge change 8222 into donut
Merge commit 'ef6b66cbbbe7ae8ee0450cbbaae4194b069679a1' * commit 'ef6b66cbbbe7ae8ee0450cbbaae4194b069679a1': Add a public API that reports the supported OpenGLES API level.
Diffstat (limited to 'opengl')
-rw-r--r--opengl/java/android/opengl/Version.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/opengl/java/android/opengl/Version.java b/opengl/java/android/opengl/Version.java
new file mode 100644
index 0000000..6e89d7e
--- /dev/null
+++ b/opengl/java/android/opengl/Version.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.opengl;
+
+import android.os.SystemProperties;
+
+public final class Version {
+ /**
+ * Return the highest OpenGL ES API level supported by the current device.
+ * <p>
+ * A device that supports a given API level must also support
+ * numerically smaller API levels.
+ * <p>
+ * 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;
+}