Gets the openGL version that is actually available on this device (ie GL_VERSION_31). - Android android.opengl

Android examples for android.opengl:OpenGL

Description

Gets the openGL version that is actually available on this device (ie GL_VERSION_31).

Demo Code


//package com.java2s;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.ConfigurationInfo;

public class Main {
    /**//from w w w . ja v a2 s. c  o m
     * Gets the openGL version that is actually available on this device (ie GL_VERSION_31).
     *
     * @param context
     * @return
     */
    public static int getDeviceGLVersion(Context context) {
        final ActivityManager activityManager = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configurationInfo = activityManager
                .getDeviceConfigurationInfo();
        return configurationInfo.reqGlEsVersion;
    }
}

Related Tutorials