use of com.android.grafika.gles.OffscreenSurface in project grafika by google.
the class GlesInfoActivity method gatherGlInfo.
/**
* Queries EGL/GL for information, then formats it all into one giant string.
*/
private String gatherGlInfo() {
// We need a GL context to examine, which means we need an EGL surface. Create a 1x1
// pbuffer.
EglCore eglCore = new EglCore(null, EglCore.FLAG_TRY_GLES3);
OffscreenSurface surface = new OffscreenSurface(eglCore, 1, 1);
surface.makeCurrent();
StringBuilder sb = new StringBuilder();
sb.append("===== GL Information =====");
sb.append("\nvendor : ");
sb.append(GLES20.glGetString(GLES20.GL_VENDOR));
sb.append("\nversion : ");
sb.append(GLES20.glGetString(GLES20.GL_VERSION));
sb.append("\nrenderer : ");
sb.append(GLES20.glGetString(GLES20.GL_RENDERER));
sb.append("\nextensions:\n");
sb.append(formatExtensions(GLES20.glGetString(GLES20.GL_EXTENSIONS)));
sb.append("\n===== EGL Information =====");
sb.append("\nvendor : ");
sb.append(eglCore.queryString(EGL14.EGL_VENDOR));
sb.append("\nversion : ");
sb.append(eglCore.queryString(EGL14.EGL_VERSION));
sb.append("\nclient API: ");
sb.append(eglCore.queryString(EGL14.EGL_CLIENT_APIS));
sb.append("\nextensions:\n");
sb.append(formatExtensions(eglCore.queryString(EGL14.EGL_EXTENSIONS)));
surface.release();
eglCore.release();
sb.append("\n===== System Information =====");
sb.append("\nmfgr : ");
sb.append(Build.MANUFACTURER);
sb.append("\nbrand : ");
sb.append(Build.BRAND);
sb.append("\nmodel : ");
sb.append(Build.MODEL);
sb.append("\nrelease : ");
sb.append(Build.VERSION.RELEASE);
sb.append("\nbuild : ");
sb.append(Build.DISPLAY);
sb.append("\n");
return sb.toString();
}
Aggregations