From 69e9ed62bbc899117550d7b9c888e71dd9ede0e2 Mon Sep 17 00:00:00 2001 From: Comment Date: Wed, 29 May 2013 09:52:49 +0100 Subject: nearly done --- src/viewport.cpp | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'src/viewport.cpp') diff --git a/src/viewport.cpp b/src/viewport.cpp index c660ede..5a246e0 100755 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -13,11 +13,13 @@ viewport::viewport(int _w,int _h,int _ox,int _oy,int _num) { void viewport::setup(int _w,int _h,int _ox,int _oy,int _num) { w=_w; h=_h; + bw=w*oversample; + bh=h*oversample; ox=_ox; oy=_oy; num=_num; - rb1.allocate(w,h,GL_RGB); - rb2.allocate(w,h,GL_RGB); + rb1.allocate(bw,bh,GL_RGB); + rb2.allocate(bw,bh,GL_RGB); seed=ofRandom(1.0f); } @@ -27,17 +29,24 @@ void viewport::drawport(vpcontrol &control){ //can be done with texture offset? - int startx=((w-(w*control.fscale))/2)+control.xshift; - while (startx>0) startx-=(w*control.fscale); - int starty=((h-(h*control.fscale))/2)+control.yshift; - while (starty>0) starty-=(h*control.fscale); + int startx=((bw-(bw*control.fscale))/2)+control.xshift; + while (startx>0) startx-=(bw*control.fscale); + int starty=((bh-(bh*control.fscale))/2)+control.yshift; + while (starty>0) starty-=(bh*control.fscale); - for (int i=startx;i0){ + ofEnableAlphaBlending(); + ofSetColor(0,0,0,control.fade); + ofRect(0,0,bw,bh); + ofDisableAlphaBlending(); + } + //do whatever with feedback //set draw colour from palette @@ -51,7 +60,7 @@ void viewport::drawport(vpcontrol &control){ } if (control.fill){ - ofRect(0,0,w,h); + ofRect(0,0,bw,bh); } ofSetLineWidth(3); //control.thickness); @@ -59,15 +68,15 @@ void viewport::drawport(vpcontrol &control){ if(control.wave){ if (h>w){ ofBeginShape(); - for (int i = 0; i < h; i++){ - ofVertex((w/2) -(control.right[i+(num*h)]*w),i); + for (int i = 0; i < bh; i++){ + ofVertex((bw/2) -(control.right[i+(num*bh)]*bw),i); } ofEndShape(false); } else { ofBeginShape(); - for (int i = 0; i < w; i++){ - ofVertex(i, (h/2) -(control.right[i+(num*w)]*h) ); + for (int i = 0; i < bw; i++){ + ofVertex(i, (bh/2) -(control.right[i+(num*bw)]*bh) ); } ofEndShape(false); } -- cgit v1.2.3