GLFW 3.0 which is now included in the latest core supports multiple windows. Is there any way to take advantage of this in OF yet? I’ve had a look at the code and it’s looks very much oriented towards just a single window, but I could be wrong.
If it’s possible, it would be great to include an example of this.
Who is working on the multiple window stuff for the post-0.8.0 version, now that GLFW is in place? Does someone have a Git branch somewhere I could test out and/or contribute to? The closest I’ve seen is underdoeg’s stuff (underdoeg:multiwindow) that was closed/postponed for 0.8.0.
I am curious about this too; I’ve just realized that Windows7 can’t keep a single openGL context in Vertical Sync if it’s spanned across different monitors (you get random tearing). I think a solution could be to have 3 different fullscreen windows, each in its own monitor, under GLFW. Cinder allows that, and on a quick test, it seemed to solve the tearing issue.
Having a reliable and sufficiently easy/efficient way to create multiple windows is a great feature (think for example rendering the GUI or debug stuff onto a separate window - maybe even position in on a second monitor - and avoid cluttering the actual app).
I have made a series of multi-windows apps, but they were in straight OpenGL / GLFW. I have been quickly looking at the structure used in OF but it’s pretty convoluted and Im pretty stacked at the moment. If someone is working on this (with a clear understanding of the windowing workflow in OF) I will also be happy to give a hand on this …
PS: Im mostly interested in a solution that can work on Windows
Sorry to be a nuisance, but any update on the status of GLFW multi-window support? Will it be in 0.8.1, or is it likely to be postponed again? It would be great to make the move to OF 0.8, but in the meantime, we’ll (have to) remain on ofxFenster and OF 0.7.4.
I made multiwindow with GLFW work yesterday. It was a very straight-forward hack, using GLFW functions directly. It’s really easy to do it, even with shared context.
Does anyone knows if this feature will be soon added to oF? I can make a simple example of what I’ve done if anyone is interested.
It shows two windows side by side playing the same video.
on the setup method I get the GLFWwindow and I use it to create the auxiliar window, sharing the context this way.
We need to store the GLFWwindow pointers so we switch to the desired window when drawing.
Well done genekogan! When I run the example I only see one window. I’ll take a look at it during the weekend.
Also, you can change the code on the ofxSecondWindow::draw method to:
to have the coordinate system in pixels, just like a regular oF window.
Also, I would create a method with only this code, call it something like: ofxSecondWindow::begin(). it would start by switching to this window. then I would create another method called ofxSecondWindow::end() that would send to the primary window.
the reason you don’t see it is that the example makes a second window and offsets it by the width of your screen (to a second monitor or projector). if you comment that out and run instead something like: