當前位置: 首頁>>代碼示例>>Java>>正文


Java FeatureInfo.GL_ES_VERSION_UNDEFINED屬性代碼示例

本文整理匯總了Java中android.content.pm.FeatureInfo.GL_ES_VERSION_UNDEFINED屬性的典型用法代碼示例。如果您正苦於以下問題:Java FeatureInfo.GL_ES_VERSION_UNDEFINED屬性的具體用法?Java FeatureInfo.GL_ES_VERSION_UNDEFINED怎麽用?Java FeatureInfo.GL_ES_VERSION_UNDEFINED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.content.pm.FeatureInfo的用法示例。


在下文中一共展示了FeatureInfo.GL_ES_VERSION_UNDEFINED屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getOpenGL

/**
 * Returns the current device openGL version.
 */
static String getOpenGL(Context context) {
    PackageManager packageManager = context.getPackageManager();
    FeatureInfo[] featureInfos = packageManager.getSystemAvailableFeatures();
    if (featureInfos != null && featureInfos.length > 0) {
        for (FeatureInfo featureInfo : featureInfos) {
            // Null feature name means this feature is the open gl es version feature.
            if (featureInfo.name == null) {
                if (featureInfo.reqGlEsVersion != FeatureInfo.GL_ES_VERSION_UNDEFINED) {
                    return Integer.toString((featureInfo.reqGlEsVersion & 0xffff0000) >> 16);
                } else {
                    return "1"; // Lack of property means OpenGL ES version 1
                }
            }
        }
    }
    return "1";
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:20,代碼來源:CrashDetails.java

示例2: getVersionFromPackageManager

private static int getVersionFromPackageManager(Context context) {
    PackageManager packageManager=context.getPackageManager();
    FeatureInfo[] featureInfos=
            packageManager.getSystemAvailableFeatures();
    if (featureInfos != null && featureInfos.length > 0) {
        for (FeatureInfo featureInfo : featureInfos) {
            // Null feature name means this feature is the open
            // gl es version feature.
            if (featureInfo.name == null) {
                if (featureInfo.reqGlEsVersion != FeatureInfo.GL_ES_VERSION_UNDEFINED) {
                    return getMajorVersion(featureInfo.reqGlEsVersion);
                }
                else {
                    return 1; // Lack of property means OpenGL ES
                    // version 1
                }
            }
        }
    }
    return 1;
}
 
開發者ID:dklisiaris,項目名稱:geopin,代碼行數:21,代碼來源:AbstractMapActivity.java

示例3: getVersionFromPackageManager

private static int getVersionFromPackageManager(Context context) {
  PackageManager packageManager=context.getPackageManager();
  FeatureInfo[] featureInfos=
      packageManager.getSystemAvailableFeatures();
  if (featureInfos != null && featureInfos.length > 0) {
    for (FeatureInfo featureInfo : featureInfos) {
      // Null feature name means this feature is the open
      // gl es version feature.
      if (featureInfo.name == null) {
        if (featureInfo.reqGlEsVersion != FeatureInfo.GL_ES_VERSION_UNDEFINED) {
          return getMajorVersion(featureInfo.reqGlEsVersion);
        }
        else {
          return 1; // Lack of property means OpenGL ES
                    // version 1
        }
      }
    }
  }
  return 1;
}
 
開發者ID:dklisiaris,項目名稱:downtown,代碼行數:21,代碼來源:AbstractMapActivity.java

示例4: getVersionFromPackageManager

private static int getVersionFromPackageManager(Context context) {
    PackageManager packageManager = context.getPackageManager();
    FeatureInfo[] featureInfos  = packageManager.getSystemAvailableFeatures();
    if (featureInfos != null && featureInfos.length > 0) {
        for (FeatureInfo featureInfo : featureInfos) {
            // Null feature name means this feature is the open
            // gl es version feature.
            if (featureInfo.name == null) {
                if (featureInfo.reqGlEsVersion != FeatureInfo.GL_ES_VERSION_UNDEFINED) {
                    return getMajorVersion(featureInfo.reqGlEsVersion);
                }
                else {
                    return 1; // Lack of property means OpenGL ES
                    // version 1
                }
            }
        }
    }
    return 1;
}
 
開發者ID:kartheininger,項目名稱:ClusteredMarkers,代碼行數:20,代碼來源:AbstractMapActivity.java

示例5: getOpenGLVersion

private String getOpenGLVersion() {
    Context context = getActivity();
    PackageManager packageManager = context.getPackageManager();
    FeatureInfo[] featureInfos = packageManager.getSystemAvailableFeatures();
    if (featureInfos != null && featureInfos.length > 0) {
        for (FeatureInfo featureInfo : featureInfos) {
            // Null feature name means this feature is the open gl es version feature.
            if (featureInfo.name == null) {
                if (featureInfo.reqGlEsVersion != FeatureInfo.GL_ES_VERSION_UNDEFINED) {
                    return String.valueOf((featureInfo.reqGlEsVersion & 0xFFFF0000) >> 16) + "." + String.valueOf((featureInfo.reqGlEsVersion & 0x0000FFFF));
                } else {
                    return "1.0"; // Lack of property means OpenGL ES version 1
                }
            }
        }
    }
    return "1.0";
}
 
開發者ID:soarcn,項目名稱:COCOFramework,代碼行數:18,代碼來源:DeviceInfo.java


注:本文中的android.content.pm.FeatureInfo.GL_ES_VERSION_UNDEFINED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。