Example usage for android.opengl GLES20 glGetError

List of usage examples for android.opengl GLES20 glGetError

Introduction

In this page you can find the example usage for android.opengl GLES20 glGetError.

Prototype

public static native int glGetError();

Source Link

Usage

From source file:Main.java

public static void checkGlError(String op) {
    int error;/*from  ww w.j av  a 2  s .co  m*/
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e("SurfaceTest", op + ": glError " + GLUtils.getEGLErrorString(error));
    }
}

From source file:Main.java

public static void checkGlError(String op) {
    int error;//from  ww w  .  ja  v  a 2 s  .  com
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e("ES20_ERROR", op + ": glError " + error);
        throw new RuntimeException(op + ": glError " + error);
    }
}

From source file:Main.java

public static void checkGLError(String op) {
    for (int error = GLES20.glGetError(); error != 0; error = GLES20.glGetError())
        Log.e(LOGTAG, "After operation " + op + " got glError 0x" + Integer.toHexString(error));
}

From source file:Main.java

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);
        }/*from   w  w w.j a  v a 2s  .  co  m*/

        String msg = glOp + " caused GL error 0x" + Integer.toHexString(error) + ":" + errorStr;
        throw new GLException(error, msg);
    }
}

From source file:Main.java

public static void checkGlError(String op) {
    int error;//from   w  w w  . j av a 2 s  .  c o m
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, op + ": glError " + GLU.gluErrorString(error));
        throw new RuntimeException(op + ": glError " + GLU.gluErrorString(error));
    }
}

From source file:Main.java

/**
 * Checks if we've had an error inside of OpenGL ES, and if so what that error is.
 *
 * @param label Label to report in case of error.
 *///from w w  w.ja v a2s .  c  om
public static void checkGLError(final String tag, final String label) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(tag, label + ": glError " + error);
        throw new RuntimeException(label + ": glError " + error);
    }
}

From source file:Main.java

/**
 * Checks if we've had an error inside of OpenGL ES, and if so what that error is.
 *
 * @param label Label to report in case of error.
 *//*from   w  w w  .  java  2 s .  co  m*/
public static void checkGLError(String label) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, label + ": glError " + error);
        throw new RuntimeException(label + ": glError " + error);
    }
}

From source file:Main.java

public static void checkGLError(String msg) {
    int error = GLES20.glGetError();
    if (error != GLES20.GL_NO_ERROR) {
        String str = msg + ": glError 0x" + Integer.toHexString(error);
        Log.e(TAG, str);//w w  w .j  a v  a  2s .c  om
        int values[] = new int[2];
        GLES20.glGetIntegerv(GLES20.GL_ARRAY_BUFFER_BINDING, values, 0);
        GLES20.glGetIntegerv(GLES20.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, values, 1);
        Log.e(TAG, "Current bound array buffer: " + values[0]);
        Log.e(TAG, "Current bound vertex attrib: " + values[1]);
        throw new RuntimeException(msg);
    }
}

From source file:Main.java

public static void checkNoGLES2Error(String msg) {
    int error = GLES20.glGetError();
    if (error != GLES20.GL_NO_ERROR) {
        throw new RuntimeException(msg + ": GLES20 error: " + error);
    }//from w  w  w.  ja va2 s  . co m
}

From source file:Main.java

/**
 * Utility method for debugging OpenGL calls. Provide the name of the call
 * just after making it://from w w  w . ja  v  a2  s.  c  o  m
 *
 * <pre>
 * mColorHandle = GLES20.glGetUniformLocation(mProgram, "vColor");
 * MyGLRenderer.checkGlError("glGetUniformLocation");</pre>
 *
 * If the operation is not successful, the check throws an error.
 *
 * @param glOperation - Name of the OpenGL call to check.
 */
public static void checkGlError(String glOperation) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, glOperation + ": glError " + error);
        throw new RuntimeException(glOperation + ": glError " + error);
    }
}