Java tutorial
//package com.java2s; import android.opengl.GLES20; import android.opengl.GLUtils; import android.util.Log; public class Main { public static void checkGlError(String op) { int error; while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) { Log.e("SurfaceTest", op + ": glError " + GLUtils.getEGLErrorString(error)); } } }