Java Code Examples for android.opengl.GLES20#GL_NO_ERROR

The following examples show how to use android.opengl.GLES20#GL_NO_ERROR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PointsMatrix.java    From MegviiFacepp-Android-SDK with Apache License 2.0 5 votes vote down vote up
public static void checkGlError(String glOperation) {
	int error;
	while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
		Log.e("ceshi", glOperation + ": glError " + error);
		throw new RuntimeException(glOperation + ": glError " + error);
	}
}
 
Example 2
Source File: GlUtil.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 lastError = GLES20.GL_NO_ERROR;
  int error;
  while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
    Log.e(TAG, "glError " + gluErrorString(error));
    lastError = error;
  }
  if (ExoPlayerLibraryInfo.GL_ASSERTIONS_ENABLED && lastError != GLES20.GL_NO_ERROR) {
    throw new RuntimeException("glError " + gluErrorString(lastError));
  }
}
 
Example 3
Source File: EglUtil.java    From media-for-mobile with Apache License 2.0 5 votes vote down vote up
@Override
public void checkEglError(String operation) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        throw new RuntimeException(operation + ": glError " + error);
    }
}
 
Example 4
Source File: ShaderLoader.java    From unity-ads-android with Apache License 2.0 5 votes vote down vote up
public static boolean checkGLError(String label) {
	int lastError = GLES20.GL_NO_ERROR;
	int error;
	while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
		DeviceLog.error(label + ": glError " + error);
		lastError = error;
	}

	return lastError != GLES20.GL_NO_ERROR;
}
 
Example 5
Source File: VideoSurfaceView.java    From VideoChatHeads with The Unlicense 5 votes vote down vote up
private void checkGlError(String op) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, op + ": glError " + error);
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 6
Source File: ExtractMpegFramesTest.java    From Android-MediaCodec-Examples with Apache License 2.0 5 votes vote down vote up
public void checkGlError(String op) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, op + ": glError " + error);
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 7
Source File: ShaderUtil.java    From poly-sample-android with Apache License 2.0 5 votes vote down vote up
/**
 * 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.
 * @throws RuntimeException If an OpenGL error is detected.
 */
public static void checkGLError(String tag, String label) {
  int lastError = GLES20.GL_NO_ERROR;
  // Drain the queue of all errors.
  int error;
  while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
    Log.e(tag, label + ": glError " + error);
    lastError = error;
  }
  if (lastError != GLES20.GL_NO_ERROR) {
    throw new RuntimeException(label + ": glError " + lastError);
  }
}
 
Example 8
Source File: EglUtil.java    From SimpleVideoEdit with Apache License 2.0 5 votes vote down vote up
public static void checkEglError(String operation) {
    if (!BuildConfig.DEBUG) return;
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        throw new RuntimeException(operation + ": glError " + error);
    }
}
 
Example 9
Source File: BayerShader.java    From retroboy with MIT License 5 votes vote down vote up
private void checkGlError(String op) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, op + ": glError " + error);
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 10
Source File: PreviewShader.java    From retroboy with MIT License 5 votes vote down vote up
private void checkGlError(String op) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, op + ": glError " + error);
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 11
Source File: GlRenderUtils.java    From LiTr with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Check for GL errors
 * @param op GL operation to check for error for
 */
public static void checkGlError(@NonNull String op) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, op + ": glError " + error);
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 12
Source File: GLProgram.java    From AndroidDemo with MIT License 5 votes vote down vote up
private void checkGlError(String op) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, "***** " + op + ": glError " + error, null);
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 13
Source File: GlFilter.java    From SimpleVideoEdit with Apache License 2.0 5 votes vote down vote up
public void checkGlError(String op) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e("GlFilter", op + ": glError " + error);
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 14
Source File: GLHelper.java    From libcommon with Apache License 2.0 5 votes vote down vote up
/**
	 * OpenGL|ESのエラーをチェックしてlogCatに出力する
	 * @param op
	 */
    public static void checkGlError(final String op) {
        final int error = GLES20.glGetError();
        if (error != GLES20.GL_NO_ERROR) {
            final String msg = op + ": glError 0x" + Integer.toHexString(error);
			Log.e(TAG, msg);
			Stacktrace.print();
//         	if (DEBUG) {
//	            throw new RuntimeException(msg);
//       	}
        }
    }
 
Example 15
Source File: OpenGLHelper.java    From myMediaCodecPlayer-for-FPV with MIT License 4 votes vote down vote up
public static void checkGlError(String op) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 16
Source File: TextureRenderer.java    From SiliCompressor with Apache License 2.0 4 votes vote down vote up
public void checkGlError(String op) {
    int error;
    if ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 17
Source File: TextureRenderer.java    From VideoCompressor with Apache License 2.0 4 votes vote down vote up
public void checkGlError(String op) {
    int error;
    if ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        throw new RuntimeException(op + ": glError " + error);
    }
}
 
Example 18
Source File: MyGLRenderer.java    From opengl with Apache License 2.0 3 votes vote down vote up
/**
* Utility method for debugging OpenGL calls. Provide the name of the call
* just after making it:
*
* <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);
    }
}
 
Example 19
Source File: GLUtil.java    From android-3D-model-viewer with GNU Lesser General Public License v3.0 3 votes vote down vote up
/**
 * Utility method for debugging OpenGL calls. Provide the name of the call just after making it:
 * 
 * <pre>
 * mColorHandle = GLES20.glGetUniformLocation(mProgram, &quot;vColor&quot;);
 * MyGLRenderer.checkGlError(&quot;glGetUniformLocation&quot;);
 * </pre>
 * 
 * If the operation is not successful, the check throws an error.
 * 
 * @param glOperation
 *            - Name of the OpenGL call to check.
 */
public static boolean checkGlError(String glOperation) {
	int glError;
	boolean error = false;
	while ((glError = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
		Log.e(TAG, glOperation + ": glError " + glError);
		error = true;
		// throw new RuntimeException(glOperation + ": glError " + error);
	}
	return error;
}
 
Example 20
Source File: ShaderUtil.java    From augmentedreality with Apache License 2.0 3 votes vote down vote up
/**
 * Utility method for debugging OpenGL calls. Provide the name of the call
 * just after making it:
 *
 * <pre>
 * mColorHandle = GLES30.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;
  String TAG = " CheckGlError";
  while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
    Log.e(TAG, glOperation + ": glError " + error);
    throw new RuntimeException(glOperation + ": glError " + error);
  }
}