Java tutorial
//package com.java2s; import android.opengl.GLES20; import android.opengl.GLException; import android.opengl.GLU; import android.opengl.GLUtils; public class Main { public static void checkGlError(String glOp) { int error = GLES20.glGetError(); if (GLES20.GL_NO_ERROR != error) { String errorStr = GLU.gluErrorString(error); if (null == errorStr) { errorStr = GLUtils.getEGLErrorString(error); } String msg = glOp + " caused GL error 0x" + Integer.toHexString(error) + ":" + errorStr; throw new GLException(error, msg); } } }