/** * If there is an OpenGl error, logs the error and if {@link * ExoPlayerLibraryInfo#GL_ASSERTIONS_ENABLED} is true throws a {@link RuntimeException}. */ public static void checkGlError() { int error = GLES20.glGetError(); int lastError; if (error != GLES20.GL_NO_ERROR) { do { lastError = error; Log.e(TAG, "glError " + gluErrorString(lastError)); error = GLES20.glGetError(); } while (error != GLES20.GL_NO_ERROR); if (ExoPlayerLibraryInfo.GL_ASSERTIONS_ENABLED) { throw new RuntimeException("glError " + gluErrorString(lastError)); } } }
public void checkGLError(String ex) { int error = GLES20.glGetError(); if (error != GLES20.GL_NO_ERROR) { String description = GLU.gluErrorString(error); RajLog.e(ex + "[" + error + "]: " + description); throw new RuntimeException(ex + "[" + error + "]: " + description); } }
/** * Checks for an OpenGL error and throws a {@link RendererException} if * there is one. Ignores the value of * {@link RendererUtil#ENABLE_ERROR_CHECKING}. */ public static void checkGLErrorForced() { int error = GLES20.glGetError(); if (error != 0) { String message = GLU.gluErrorString(error); if (message == null) { throw new RendererException("An unknown OpenGL error has occurred."); } else { throw new RendererException("An OpenGL error has occurred: " + message); } } }
/** * Checks for an OpenGL error and throws a {@link RendererException} if * there is one. Does nothing if {@link RendererUtil#ENABLE_ERROR_CHECKING} * is set to * <code>false</code>. */ public static void checkGLError() { if (!ENABLE_ERROR_CHECKING) { return; } int error = GLES20.glGetError(); if (error != 0) { String message = GLU.gluErrorString(error); if (message == null) { throw new RendererException("An unknown OpenGL error has occurred."); } else { throw new RendererException("An OpenGL error has occurred: " + message); } } } }
@Override public String errorString(int err) { return GLU.gluErrorString(err); }
private void checkGLESError(String where) { int error = GLES20.glGetError(); if (error != GLES20.GL_NO_ERROR) { LogUtil.e(TAG, "checkGLESError: " + GLU.gluErrorString(error)); throw new RuntimeException(where); } }
public void checkGLError(String ex) { int error = GLES20.glGetError(); if (error != GLES20.GL_NO_ERROR) { String description = GLU.gluErrorString(error); RajLog.e(ex + "[" + error + "]: " + description); throw new RuntimeException(ex + "[" + error + "]: " + description); } }
/** * Checks if any of the GL calls since the last time this method was called set an error * condition. Call this method immediately after calling a GL method. Pass the name of the GL * operation. For example: * * <pre> * mColorHandle = GLES20.glGetUniformLocation(mProgram, "uColor"); * MyGLRenderer.checkGlError("glGetUniformLocation");</pre> * * If the operation is not successful, the check throws an exception. * * <p><em>Note</em> This is quite slow so it's best to use it sparingly in production builds. * * @param glOperation name of the OpenGL call to check */ private static void checkGlError(String glOperation) { int error = GLES20.glGetError(); if (error != GLES20.GL_NO_ERROR) { String errorString = GLU.gluErrorString(error); if (errorString == null) { errorString = GLUtils.getEGLErrorString(error); } String message = glOperation + " caused GL error 0x" + Integer.toHexString(error) + ": " + errorString; Log.e(TAG, message); throw new RuntimeException(message); } }
if(error != GL10.GL_NO_ERROR) PLLog.error("PLTexture::loadTexture", "glGetError #1 = (%d) %s ...", error, GLU.gluErrorString(error)); this.recycleImage(); return false; if(error != GL10.GL_NO_ERROR) PLLog.error("PLTexture::loadTexture", "glGetError #2 = (%d) %s ...", error, GLU.gluErrorString(error)); this.recycleImage(); return false; if(error != GL10.GL_NO_ERROR) PLLog.error("PLTexture::loadTexture", "glGetError #3 = (%d) %s ...", error, GLU.gluErrorString(error)); this.recycleImage(); return false;