From 6bdebb937ab100a934ef6803798ac1c0d8924b36 Mon Sep 17 00:00:00 2001 From: shadowislord Date: Tue, 18 Nov 2014 22:05:14 -0500 Subject: [PATCH] Assume OpenGL ES 2.0 is supported on ICS and higher devices Fixes running jME3 in Android Emulator --- .../java/com/jme3/system/android/OGLESContext.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java b/jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java index 324964976..e669530a9 100644 --- a/jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java +++ b/jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java @@ -99,10 +99,14 @@ public class OGLESContext implements JmeContext, GLSurfaceView.Renderer, SoftTex public GLSurfaceView createView() { Context appContext = JmeAndroidSystem.getActivity().getApplication(); - ActivityManager am = (ActivityManager) appContext.getSystemService(Context.ACTIVITY_SERVICE); - ConfigurationInfo info = am.getDeviceConfigurationInfo(); - if (info.reqGlEsVersion < 0x20000) { - throw new UnsupportedOperationException("OpenGL ES 2.0 is not supported on this device"); + // NOTE: We assume all ICS devices have OpenGL ES 2.0. + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + // below 4.0, check OpenGL ES 2.0 support. + ActivityManager am = (ActivityManager) appContext.getSystemService(Context.ACTIVITY_SERVICE); + ConfigurationInfo info = am.getDeviceConfigurationInfo(); + if (info.reqGlEsVersion < 0x20000) { + throw new UnsupportedOperationException("OpenGL ES 2.0 is not supported on this device"); + } } // Start to set up the view