本文整理匯總了Java中javax.microedition.khronos.egl.EGL10.eglGetError方法的典型用法代碼示例。如果您正苦於以下問題:Java EGL10.eglGetError方法的具體用法?Java EGL10.eglGetError怎麽用?Java EGL10.eglGetError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.microedition.khronos.egl.EGL10
的用法示例。
在下文中一共展示了EGL10.eglGetError方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: throwEglException
import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
public static void throwEglException(
EGL10 egl,
String function)
{
int error;
StringBuilder sb = new StringBuilder();
while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
sb.append(getErrorString(error)).append("\n");
}
String message = function + " failed";
if (sb.length() > 0) {
message += ": " + sb.toString();
}
Log.e(ConstantsUI.TAG, message);
throw new RuntimeException(message);
}
示例2: checkEglError
import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
protected void checkEglError(
EGL10 egl,
String prompt)
{
int error;
while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
Log.e(ConstantsUI.TAG, String.format("%s: EGL error: %s", prompt, getErrorString(error)));
}
}
示例3: checkEglError
import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
private static void checkEglError(String prompt, EGL10 egl) {
int error;
while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
}
}
示例4: checkEglError
import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
private static void checkEglError(String prompt, EGL10 egl) {
int error;
while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
Log.d(LOG_TAG, String.format(Locale.US, "%s: EGL error: 0x%x", prompt, error));
}
}
示例5: initGL
import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
private void initGL(SurfaceTexture texture) {
egl10 = (EGL10) EGLContext.getEGL();
eglDisplay = egl10.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (eglDisplay == EGL10.EGL_NO_DISPLAY) {
throw new RuntimeException("eglGetDisplay failed " +
android.opengl.GLUtils.getEGLErrorString(egl10.eglGetError()));
}
int[] version = new int[2];
if (!egl10.eglInitialize(eglDisplay, version)) {
throw new RuntimeException("eglInitialize failed " +
android.opengl.GLUtils.getEGLErrorString(egl10.eglGetError()));
}
int[] configsCount = new int[1];
EGLConfig[] configs = new EGLConfig[1];
int[] configSpec = {
EGL10.EGL_RENDERABLE_TYPE,
EGL_OPENGL_ES2_BIT,
EGL10.EGL_RED_SIZE, 8,
EGL10.EGL_GREEN_SIZE, 8,
EGL10.EGL_BLUE_SIZE, 8,
EGL10.EGL_ALPHA_SIZE, 8,
EGL10.EGL_DEPTH_SIZE, 0,
EGL10.EGL_STENCIL_SIZE, 0,
EGL10.EGL_NONE
};
EGLConfig eglConfig = null;
if (!egl10.eglChooseConfig(eglDisplay, configSpec, configs, 1, configsCount)) {
throw new IllegalArgumentException("eglChooseConfig failed " +
android.opengl.GLUtils.getEGLErrorString(egl10.eglGetError()));
} else if (configsCount[0] > 0) {
eglConfig = configs[0];
}
if (eglConfig == null) {
throw new RuntimeException("eglConfig not initialized");
}
int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};
eglContext = egl10.eglCreateContext(eglDisplay, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
eglSurface = egl10.eglCreateWindowSurface(eglDisplay, eglConfig, texture, null);
if (eglSurface == null || eglSurface == EGL10.EGL_NO_SURFACE) {
int error = egl10.eglGetError();
if (error == EGL10.EGL_BAD_NATIVE_WINDOW) {
Log.e(TAG, "eglCreateWindowSurface returned EGL10.EGL_BAD_NATIVE_WINDOW");
return;
}
throw new RuntimeException("eglCreateWindowSurface failed " +
android.opengl.GLUtils.getEGLErrorString(error));
}
if (!egl10.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
throw new RuntimeException("eglMakeCurrent failed " +
android.opengl.GLUtils.getEGLErrorString(egl10.eglGetError()));
}
}