Show offscreen buffer in a new window
in
Programming Questions
•
1 month ago
Hi, I'm rendering a 3D scene from two different points of view into two GLGraphicsOffscreen object. One is show in the main window, but now I need to show the other offscreen buffer in a separate window, then, by using frame.setLocation(), I can place one window in the primary display and the other one on the secondary display of an extended desktop (which is a projector).
My first attemp has been to create another sketch from the main one using PApplet.runSketch(), which receives the resulting image through a setImage() method and displays it. I'm passing the buffer by rendering it into a PImage like this.
- PImage img = createImage(fpsBuffer.width, fpsBuffer.height, RGB);
- fpsBuffer.getTexture().getImage(img);
- fpWindow.setImage(img);
The auxiliary sketch just copys the PImage with get() and displays it. But the result has a frame rate around 5 fps
I guess this is due to all the memory copying involved, as both the PImage and the buffer are 1024x768.
Other methods I have found on the forum rely on creating a new PApplet as well, what I think would lead me to the same problem. Is there any method to draw to a new window by reading directly from the buffer object? Or any other idea on how to resolve this?
BTW, I'm working on Windows 8 and Processing 1.5.1. Thanks!
1