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