preview window
in
Integration and Hardware
•
10 months ago
hi there,
im programming something like this:
Screen 1
+---------------------------+
|+-------------------------+| Screen 2
||Main Window || +-------------------------------+
||-------------------------|| |+-----------++----------------+|
|| || ||Preview Win||Control Window ||
|| || ||-----------||----------------||
|| some arbitrary || || ||beat detection *||
|| rendering here || || ||background *****||
|| || || ||other contol ***||
|| || |+-----------++----------------+|
|| || |+Some Console output here-----+|
|+-------------------------+| |+-----------------------------+|
+---------------------------+ +-------------------------------+
so i thought i do it like this:
- public class FullScreenWindow extends PApplet {
- PreviewWindow preview;
- PFrame f;
- PeasyCam cam;
- public FullScreenWindow() {
- preview = new PreviewWindow(this);
- f = new PFrame(preview);
- }
- public void setup() {
- size(1200, 800, <Render Goes Here (P3D I guess)> );
- cam = new PeasyCam(this, 100);
- P
- }
- public void draw() {
- // some drawing here
- }
- }
- public class PreviewWindow() {
- FullScreenWindow parentWin;
- PImage buffer;
- public PreviewWindow(FullScreenWindow f) {
- parentWin = f;
- }
- public void setup() {
- size(200,150, <Renderer goes here>);
- }
- public void draw() {
- buffer = parentWin.get();
- // some scaling maybe, dunno...
- image(buffer, 0,0);
- }
- }
- public class PFrame extends Frame {
- public PFrame(PreviewWindow p) {
- setBounds(100,100,400,400); //dunno what these numbers mean;
- add(p);
- p.init();
- show(); // deprecated
- }
- }
Now, since Processing 2 the solution from
https://forum.processing.org/topic/second-monitor-window-and-optimizing-performance#25080000000382015 doesn't apply no more because GLGraphics is now part of Processing 2. Correct me if i'm wrong
I ask for the best practice to achieve my goal: an applet which performs the rendering (FullScreenWindow) + an applet with a preview of the FullScreenWindow.
btw i want proper java code, because usually in processing sketches classes are defined as inner classes of a PApplet. I don't want having sketchcode, since developing with eclipse.
Any ideas?
Best greetings to all of you!
Jan
1