Multiwindow and texture problems in Linux

I’m trying to draw with multiple windows on Linux. My problem is that drawing things like FBOs works only in one window.

Please see the example code (a slight modification of examples/events/multiWindowExample) at https://gist.github.com/mruegenberg/510f607560285b781808acb42f9cc56d

The square in the right window should be red as well.

I seems to work in OS X and using settings.shareContextWith = mainWindow; doesn’t help.

I tried to get this to work using the explicitRenderExample, but no luck:

(I also only get a black square where the FBO should render.)

Do you mind uploading the entire example? I’ll have to do something very similar in the next few days. So I hope we can find a solution :confused:

Sure: explicitRendererExample-fbos.tar.bz2 (4.3 KB)

Jep. Same thing over here. Also interesting is that the release version crashes immediately…

I seems to work (ie not crash, but still no drawing) for me in 0.9.3 (Arch Linux with an Nvidia GPU).

I also tested this on a different Windows machine, with the same result.

(Luckily, I could work around this issue there by using a huge fullscreen window with settings.multiMonitorFullScreen = true; (which in turn currently doesn’t work on Linux for me)).

if you want to share resources between different windows you need to have shared context between them. just set it for the second window using:

settings.shareContextWith = mainWindow;

Yes this is what I am doing in my app. And it seems like everything is working except my fbo is black. But it might be some other issue. I’ll recheck.

you can’t share an fbo. you can share the texture it holds but the fbo itself can only be used in the window it was created

Ok. Did not know that yet. So I’ll have to exchange the pixels. No biggie…

Oops, I just found out that the FBO in the second window was black due to a previous ofSetColor(0) call.

Now, my main problem is that I drawing a VBO in a different window doesn’t work…
(Right now, it works for me to draw things with an ofMesh, but switching it to an ofVboMesh immediately results in no drawing, even with a shared context.)

yes vao is another thing you can’t share, you could upload the mesh to a buffer and your that buffer in 2 different ofVbo