English 中文(简体)
2. 在2 GLSurface之间分享EGL2.0环境 意见导致EGL_BAD_ACCESS在安乐木板上出现
原标题:Sharing the EGL2.0 context between 2 GLSurfaceViews caused EGL_BAD_ACCESS on Android tablets

我试图通过下列法典来分享欧洲劳工联盟的背景。

createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
    EGLContext shared = ...; // a cached egl context
    int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
    EGLContext context = egl.eglCreateContext(display, eglConfig, shared == null ? EGL10.EGL_NO_CONTEXT : shared,
        attrib_list);
    return context;
  }
}

该代码大多数和海底电话(OS>=2.2)但在所有测试片上都失败。

01-12 18:33:35.381:E/AndroidRuntime(12171):FATAL EXCEPTION: GLThread 11

01-12 18:33:35.381: E/AndroidRuntime(12171): java.lang.RuntimeException: eglMakeCurrent failed: EGL_BAD_ACCESS

01-12 18:33:35.381: E/AndroidRuntime(12171): at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1146)

由于我宣布了LOCAL_LDLIBS:=-lGLESv2,EGL是2.0个背景。

为什么在桌上失败(xoom, galaxy, lg, sony, 等)

任何见解都会受到赞赏。

问题回答

造成这种失败的两种可能原因(从欧洲工兵联盟的光谱中):

  • If ctx is current to some other thread, or if either draw or read are bound to contexts in another thread, an EGL_BAD_ACCESS error is generated.
  • If binding ctx would exceed the number of current contexts of that client API type supported by the implementation, an EGL_BAD_ACCESS error is generated.

或许也可以是,你在桌旁使用的万国邮联不支持共同的环境。

很可能遵循的是GLSurface 意见中的错误。

public GL createSurface(SurfaceHolder holder) {
    ....

    /*
     * Before we can issue GL commands, we need to make sure
     * the context is current and bound to a surface.
     */
    if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
         throwEglException("eglMakeCurrent");
    }

}




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签