EGL mixed rendering of 2d/3d on Brew

Incase of Brew, the EGLNativeWindowType is pMe->pDIB (applet’s Device Independent Bitmap pointer). I had passed this pointer in the eglCreateWindowSurface() call. When eglSwapBuffers() is called, I’m able to see all the 3d rendering by the gl library.

But I would like to integrate the native BREW 2d renderign along with EGL 3d rendering(for example to display a red-filled square using native 2d and display a small green colour cube rotating(using egl lib) on top of the red square.

In my device , Pixmap surface is not supported as per the config I got through eglgetConfig() call.

Is it feasible to achieve the above using window surface ? Or should I go for Pixmap or Pbuffer surface ?

That’s a complicated enough topic, even more so if you want it to perform well.

With the core EGL spec, your options are limited.

You should be able to use native 2d rendering to render to the window using the pDIB. But you need to keep flushing/finishing when doing mixed rendering, especially if the native 2d rendering is accelerated also.

You could also create a pbuffer and render 3d offscreen. You can then try using eglCopyBuffer to copy it to a native pixmap, which you could then use as a target for native 2d rendering, once again using the native method. But this would incur a performance penalty of full-screen copy possibly every frame.

If 2d rendering is purely software, a good way of doing everything in EGL is to use the EGL_KHR_lock_surface extension if you’re platform supports it.

This is more of an issue for your platforms vendors to worry about, even more so if 2d is accelerated. They should be able to tell you the recommended method for mix rendering.

Thanks for the response .

I shall post the query to the vendor.