简体   繁体   中英

Is there any method for integrating OpenGLES and OpenWFD API?

I am developing an C++ application on QNX 7.0. In the application, I want to render a basic cube via OpenGL ES 3 and display it using OpenWFD API. For QNX, native windowing system is provided via screen API, however, in my case, I am not able to use it. I have access to OpenWFD API and can display content on my screen. I can also draw a cube via OpenGLES. However, I cannot find an efficienty way to pass the OpenGLES rendering output to OpenWFD api for displaying the rendered content.

Is there any way for this kind of architecture to work?

Up to now, I tried some methods listed below.

  1. I created an EGLImage via OpenWFD API ( wfdCreateWFDEGLImages(...) ), then feed the EGLImageHandle to OpenGLES as Renderbuffer storage using glEGLImageTargetRenderbufferStorageOES(...) funtion. However, it returns GL_INVALID_OPERATION.
  2. I created a framebuffer and renderbuffer(for off-screen rendering in OpenGLES), create an EGLImage from renderbuffer using EGL API ( eglCreateImage(...) ). Then try to create WFDSource from this EGLImage to be able to bind it to WFD Pipeline. However, wfdCreateSourceFromImage(...) function returns NULL for WFDSource.
  3. I tried to create a wfdwindow using the following struct definitions, and try to create an EGL surface by using this wfdWindow. However, eglCreateWindowSurface(...) gives error and does not accept the wfdWindow I provided.
typedef struct wfd_buffer {  
    WFD_EGLImageType*   image;  
    WFDSource           source;  
} wfd_buffer_t;  

typedef struct wfd_window {  
    WFDDevice       dev;  
    WFDPort         port;  
    WFDPipeline     pipeline;  
    unsigned int    numBuffers;  
    wfd_buffer_t    buffers[MAX_NUM_OF_WFD_BUFFERS];  
} wfd_window_t; 
  1. I tried to query wfd devices via EGL API ( eglQueryDevicesEXT(..) ), however this extension is not available for me to use. Right now, I am stuck, I am not sure this is the right place to ask this, but I appriciate any help

Thanks

Ideally on QNX you'd use QNX Screen for displaying any OpenGL/GLES related content but IIUC you're not able to use QNX Screen in your usecase.

The OpenWFD drivers on QNX are primarily meant to be used solely by QNX Screen and may support creating WFDSource handles only from QNX Screen specific image objects and not from EGLimages.

The exact details of which buffer objects are supported for creating WFDSource handles from depends on the vendor of the OpenWFD driver so I'd suggest contacting the vendor of the OpenWFD driver you're using for inputs here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM