Example usage for android.opengl GLU gluErrorString

List of usage examples for android.opengl GLU gluErrorString

Introduction

In this page you can find the example usage for android.opengl GLU gluErrorString.

Prototype

public static String gluErrorString(int error) 

Source Link

Document

Return an error string from a GL or GLU error code.

Usage

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);
        }//w w  w.  ja v a2s.  c  om

        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  ww  .j  a va 2s  . 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));
    }
}