i working on processing (http://processing.org/) , hoping find out whether there library me create 2 different windows rendering 2 views of same scene. there way directly switch 1 another.
i don't know if such library exists processing, can create 2 windows using following code based on a recent processing forum thread
import java.awt.frame; import java.awt.mouseinfo; import java.awt.point; pframe f; secondapplet s; void setup () { size(500, 500); pframe f = new pframe(); frame.settitle("first window"); } void draw () { background(255); s.background(0); // second window background method // .... // } public class pframe extends frame { public pframe() { setbounds(0, 0, 500, 500); s = new secondapplet(); setresizable(false); add(s); s.init(); show(); settitle("second window"); } } public class secondapplet extends papplet { public void setup() { size(500, 500); } public void draw() { } }
then create drawing in each window based on common source of data , methods. i'm no expert, hope helps started project.
note gui libraries such g4p support creation of multiple windows too.
edit: comment related code:
//...// int x=50; void draw () { rect(width/2,0,x,x); s.rect(s.width/2,0,x+10,x+10); } //...//
Comments
Post a Comment