本文整理汇总了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()));
}
}