當前位置: 首頁>>代碼示例>>Java>>正文


Java EGL10.eglGetError方法代碼示例

本文整理匯總了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);
}
 
開發者ID:nextgis,項目名稱:android_nextgis_mobile,代碼行數:19,代碼來源:MapGlView.java

示例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)));
    }
}
 
開發者ID:nextgis,項目名稱:android_nextgis_mobile,代碼行數:10,代碼來源:MapGlView.java

示例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));
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:7,代碼來源:ViEAndroidGLES20.java

示例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));
    }
}
 
開發者ID:AgoraIO,項目名稱:Agora-Video-Source-Android,代碼行數:7,代碼來源:CustomizedCameraRenderer.java

示例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()));
    }
}
 
開發者ID:SimonCherryGZ,項目名稱:face-landmark-android,代碼行數:60,代碼來源:MyCameraRenderer.java


注:本文中的javax.microedition.khronos.egl.EGL10.eglGetError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。