Hi,
I have looked through the OF examples regarding multiple windows (Win10, VS17). I was able to run the test examples generating one ui window across the display.
Is it possible to have a single program with three windows, each running on a different monitor?
The scenario I have in mind is:
One window (on one monitor) is just for the ui (and for the person controlling it) which controls output to the other two separate windows (monitors).
The second window (monitor) shows one test pattern.
The third window (monitor) shows a different test pattern
The user controlling the first windows (the ui monitor) can dynamically change the patterns on both of the test pattern windows simultaneously.
I know this might also be possible using OSC or other networked methods but I wanted to run it from a single app on a single computer if possible.
I think the provided example windowing/multiWindowOneAppExample might just be what you exactly want.
I’ve made something similar at work with one window for the supervisor and two other windows for the users.
Thanks for this suggestion. I have tried this example (with on UI window and one other window) and it worked fine. One issue is that there was no visible frame surrounding the windows.
I will try to build upon this example to create another window.
There is an option in the code to share the GL resources during window creation. Is there any advantage to doing this (reduced memory?) or is it best to have separate handles to all three windows?
Hi @poly
You can share the resources, and have the window “decorated”
In main.cpp when setting up the windows, notice settings.shareContextWith = mainWindow; and settings.decorated = true;
I haven’t yet managed to get three windows with the “multiWindowOneApp” example but I was able to do it with the “multiWindowExample”. The code is below:
The code runs in VS17 and I will try to hook it up in the following configuration: gui app is main laptop display, left window is monitor 1 and right window is monitor 2. I just need to find the cables…
Whats the problem with the other approach?
Notice that you are instancing two ofApp which I think is probably a bad idea, unless you are aware of what it implies.
essentially with this setup you’ll be seeing the same thing on both, as your parameters are the same, unless you are using randomness or that something different renders based on the id.
The problem I had with the other approach (MultiWindowOneApp) was that after creating both windows with the settings I could only instantiate one of them with the ofRunApp method. I found 3 versions of this method but it appeared to only allow a single window to be passed.
I might be missing something but I couldn’t find it in the documentation.
With the two app method I was giving each app a unique id so that any events sent by the ui would be filtered to show different things on the two output monitors.