[Mesa-users] Give A directFB surface to EGL

刘涛 liutao586 at 163.com
Wed Oct 21 22:35:00 PDT 2015


Hi
   I‘m trying to give a directFB surface to eglCreateWindowSurface(), like below:
    //1 create Directfb Surface
    DFBDisplayLayerConfig dlc;
    DFBSurfaceDescription dsc;
    DFBWindowDescription dsc_w;
    DirectFBInit(0, NULL);
    DirectFBCreate(&_pDFB);
    _pDFB->SetCooperativeLevel(_pDFB, DFSCL_FULLSCREEN);
    memset(&dsc, 0, sizeof(dsc));
    dsc.flags  = (DFBSurfaceDescriptionFlags)(DSDESC_CAPS);
    dsc.caps   = (DFBSurfaceCapabilities)(DSCAPS_PRIMARY | DSCAPS_DOUBLE|DSCAPS_GL);
    DFBCHECK(_pDFB->CreateSurface(_pDFB, &dsc, &_pDFB_surface));

    //2 create egl surface
    EGLDisplay eglDisplay = EGL_NO_DISPLAY;
    EGLint iMajorVersion, iMinorVersion;
     EGLint configAttribs[] =
    {
        EGL_RED_SIZE,          8,
        EGL_GREEN_SIZE,      8,
        EGL_BLUE_SIZE,          8,
        EGL_ALPHA_SIZE,      8,
        EGL_DEPTH_SIZE,      24,
        EGL_STENCIL_SIZE,      8,
        EGL_SAMPLES,          0,
        EGL_SURFACE_TYPE,     EGL_WINDOW_BIT,
        EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
        EGL_NONE
    };
    EGLConfig  eglConfig  = 0;
    EGLint iConfigs = 0;

    eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    eglInitialize(eglDisplay, &iMajorVersion, &iMinorVersion);
    eglBindAPI(EGL_OPENGL_ES_API);
    eglChooseConfig(eglDisplay, configAttribs, &eglConfig, 1, &iConfigs);
    eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, (EGLNativeWindowType)_pDFB_surface, NULL);

   But it failed and got 0x3003 error code.
    Any idea about that? 
Env:
    Ubuntu 14..04.3, Mesa-10.1.3, DirectFB-1.7.6(use system x11)





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-users/attachments/20151022/d716629a/attachment.html>


More information about the mesa-users mailing list