PDA

View Full Version : One FBO for several windows



ggardiner
07-08-2008, 11:45 AM
Hello,

I'm working with Linux and Nvidia drivers, to process videos with OpenGL. I use Glut.
I want to build, in an offscreen buffer, a mosaic composed with images sent by a moving camera.
Then I want to use this buffer as a texture to make different renderings in several independent windows.
This works well with only one window. I use a texture attached to an FBO for the offscreen buffer. Then the texture is rendered with a glQuad and a shader in the output window.

How can I use the same texture to make a rendering in a second window ?

Thank you.

Bruce Wheaton
07-08-2008, 01:56 PM
You need your windows to share contexts (assuming they're on the same graphics card or screen). Then they will have access to the same textures.

I'm not sure how you do that with GLUT, but with GLX you specify a share context when you create a context.

Bruce

ggardiner
07-09-2008, 01:43 AM
I understood that glut encapsulates all the glx primitives and make easier the building of windows.
Can I use only glx for building windows ?
Is it then possible that the windows share contexts and use the same texture ?

Zengar
07-09-2008, 04:00 AM
You can use X API to manage your windows and glx to manage OpenGL.

Bruce Wheaton
07-09-2008, 12:26 PM
It seems like the only way with Glut is to modify the glu sources:

http://www.cg.its.tudelft.nl/~paul/glut.html

GLX and X Windows are a bit of hassle, but certainly work. You can still use some glut stuff, probably primitives, but maybe not the drawing loop etc.

Bruce