Checks if we've had an error inside of OpenGL ES, and if so what that error is. - Android android.opengl

Android examples for android.opengl:OpenGL Error

Description

Checks if we've had an error inside of OpenGL ES, and if so what that error is.

Demo Code


//package com.java2s;
import android.opengl.GLES20;
import android.util.Log;

public class Main {
    /**//from  ww w .j  ava  2  s . c om
     * Checks if we've had an error inside of OpenGL ES, and if so what that error is.
     * @param func
     */
    public static void checkGLError(String aTAG, String func) {
        int error;
        while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
            Log.e(aTAG, func + ": glError " + error);
            throw new RuntimeException(func + ": glError " + error);
        }
    }
}

Related Tutorials