Grab OpenGL output of an application from another application

748 Views Asked by At

I would like to know if it's possible, in C/C++, to launch an application and grab its standard video output?

The goal of this would be to grab the buffer of an application, and use it as a texture for a grid of vertex with special texture coordinate (in order to project it in a FullDome)?

I'm developing under Linux.

1

There are 1 best solutions below

0
On

Theoretically, it's possible. Is the other application using OpenGL? Or is just any X11 application?

If is just an X11 app, you need to do what a compositing manager does, which is use the COMPOSITE X extension to get window contents, and then process them.

If is just a OpenGL app, and you can modify it, you can use a FBO to draw everything to a texture, and use shared memory (SHM) to share the texture data with the other application.