From 97d6afdde90c1d28fd1d0e9d202615b1e3afdce6 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 23 Dec 2014 03:56:06 -0600 Subject: [PATCH] [Android] Add a few helper functions to EGLHelper. Let's us check for extension support and OpenGL version. --- .../dolphinemu/utils/EGLHelper.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/utils/EGLHelper.java b/Source/Android/src/org/dolphinemu/dolphinemu/utils/EGLHelper.java index c908a7631f..4eef5f6a3d 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/utils/EGLHelper.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/utils/EGLHelper.java @@ -354,6 +354,29 @@ public final class EGLHelper return GLES30.glGetStringi(glEnum, index); } + public boolean SupportsExtension(String extension) + { + int[] num_ext = new int[1]; + GLES30.glGetIntegerv(GLES30.GL_NUM_EXTENSIONS, num_ext, 0); + + for (int i = 0; i < num_ext[0]; ++i) + { + String ext = GLES30.glGetStringi(GLES30.GL_EXTENSIONS, i); + if (ext.equals(extension)) + return true; + } + return false; + } + + public int GetVersion() + { + int[] major = new int[1]; + int[] minor = new int[1]; + GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, major, 0); + GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, minor, 0); + return major[0] * 100 + minor[0] * 10; + } + /** * Simplified call to {@link GL10#glGetIntegerv(int, int[], int) *