Java Code Examples for android.content.pm.ConfigurationInfo#getGlEsVersion()

The following examples show how to use android.content.pm.ConfigurationInfo#getGlEsVersion() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GlUtil.java    From sealrtc-android with MIT License 6 votes vote down vote up
/**
 * Prefer OpenGL ES 3.0, otherwise 2.0
 *
 * @param context
 * @return
 */
public static int getSupportGLVersion(Context context) {
    final ActivityManager activityManager =
            (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
    int version = configurationInfo.reqGlEsVersion >= 0x30000 ? 3 : 2;
    String glEsVersion = configurationInfo.getGlEsVersion();
    Log.d(
            TAG,
            "reqGlEsVersion: "
                    + Integer.toHexString(configurationInfo.reqGlEsVersion)
                    + ", glEsVersion: "
                    + glEsVersion
                    + ", return: "
                    + version);
    return version;
}
 
Example 2
Source File: AndroidGLESUtil.java    From java6-android-glframework with Mozilla Public License 2.0 6 votes vote down vote up
public static IGLVersion getGLVersion(Context context)
{
   IGLVersion glVersion = XeGLUnknown.GL_UNKNOWN;

   final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
   final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();

   String glesVersionString = configurationInfo.getGlEsVersion();

   // This is messy...
   if (XeGLES2.GLES2_0.versionString.equals(glesVersionString))
   {
      glVersion = XeGLES2.GLES2_0;
   }
   else if (XeGLES3.GLES3_0.versionString.equals(glesVersionString))
   {
      glVersion = XeGLES3.GLES3_0;
   }
   else if (XeGLES3.GLES3_1.versionString.equals(glesVersionString))
   {
      glVersion = XeGLES3.GLES3_1;
   }

   return glVersion;
}
 
Example 3
Source File: GlUtil.java    From PLDroidShortVideo with Apache License 2.0 5 votes vote down vote up
public static int getSupportGLVersion(Context context) {
    final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
    int version = configurationInfo.reqGlEsVersion >= 0x30000 ? 3 : 2;
    String glEsVersion = configurationInfo.getGlEsVersion();
    Log.e(TAG, "reqGlEsVersion: " + Integer.toHexString(configurationInfo.reqGlEsVersion) + ", glEsVersion:" + glEsVersion);
    return version;
}
 
Example 4
Source File: Device.java    From unity-ads-android with Apache License 2.0 5 votes vote down vote up
public static String getGLVersion () {
	if (ClientProperties.getApplicationContext() != null) {
		final ActivityManager activityManager =	(ActivityManager)ClientProperties.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE);

		if (activityManager != null) {
			final ConfigurationInfo configurationInfo =	activityManager.getDeviceConfigurationInfo();

			if (configurationInfo != null) {
				return configurationInfo.getGlEsVersion();
			}
		}
	}

	return null;
}
 
Example 5
Source File: a.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
private static void c(Context context)
{
    ConfigurationInfo configurationinfo = ((ActivityManager)context.getSystemService("activity")).getDeviceConfigurationInfo();
    f = configurationinfo.reqTouchScreen;
    g = configurationinfo.getGlEsVersion();
}