Share OpenGL frame buffer / render buffer between two applications

后端 未结 2 1861
慢半拍i
慢半拍i 2021-02-07 21:21

Let\'s say I have an application A witch is responsible for painting stuff on screen via OpenGL library. For tight integration purpose I would like to

2条回答
  •  Happy的楠姐
    2021-02-07 22:07

    Framebuffer Objects can not be shared between OpenGL contexts, be it that they belong to the same process or not. But textures can be shared and textures can be used as color buffer attachment to a framebuffer objects.

    Sharing OpenGL contexts between processes it actually possible if the graphics system provides the API for this job. In the case of X11/GLX it is possible to share indirect rendering contexts between multiple processes. It may be possible in Windows by emplyoing a few really, really crude hacks. MacOS X, no idea how to do this.

    So what's probably the easiest to do is using a Pixel Buffer Object to gain performant access to the rendered picture. Then send it over to the other application through shared memory and upload it into a texture there (again through pixel buffer object).

提交回复
热议问题