From 65cf7b27e9d2f9e59da322b4fbad1ed1df27eb8d Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 2 Sep 2012 12:18:44 +0100 Subject: v 0.1 --- liveengine/src/testApp.cpp | 54 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 14 deletions(-) (limited to 'liveengine/src/testApp.cpp') diff --git a/liveengine/src/testApp.cpp b/liveengine/src/testApp.cpp index 0d8ec28..c23ec86 100755 --- a/liveengine/src/testApp.cpp +++ b/liveengine/src/testApp.cpp @@ -28,8 +28,9 @@ void testApp::setup(){ memset(controllers,NUM_CONTROLLERS,0); note=0; - controller_colours=new ofColor[NUM_CONTROLLERS]; - for (int i=0;iupdate(); @@ -60,10 +73,14 @@ void testApp::update(){ void testApp::draw(){ ofSetColor(255,255,255); grab.loadScreenData( 0, 0, ofGetWidth(), ofGetHeight() ); - //grab.update(); - //grab.reloadTexture(); - //ofBackground(0,0,0); - grab.draw( xshift,yshift); + + /* can this work? + grab.setAnchorPoint(xshift,yshift); + grab.setTextureWrap( GL_WRAP_BORDER, GL_WRAP_BORDER); + grab.draw(0,0); // xshift,yshift); + */ + int startx=(xshift>0?xshift-ofGetWidth():xshift); + int starty=(yshift>0?yshift-ofGetHeight():yshift); float notewidth=ofGetWidth()/NUM_NOTES; float noteheight=ofGetHeight()/NUM_CONTROLLERS; @@ -82,7 +99,10 @@ void testApp::draw(){ if (list.lock()) { //if playlist is loaded ofPushMatrix(); //ofScale(sin(ofGetElapsedTimef())+1.1,sin(ofGetElapsedTimef())+1.1); - if (list.layers.find(note)!=list.layers.end()) list.layers[note]->draw(lamda); + if (list.layers.find(note)!=list.layers.end()) { + if (controlColours) list.layers[note]->draw(lamda,controllers); + else list.layers[note]->draw(lamda); + } ofPopMatrix(); list.unlock(); } @@ -121,18 +141,24 @@ void testApp::keyPressed (int key){ mode=key-'0'; } if(key == OF_KEY_LEFT){ - xshift--; + xshift++; + } if(key == OF_KEY_RIGHT){ - xshift++; + xshift--; } if(key == OF_KEY_DOWN){ yshift--; } if(key == OF_KEY_UP){ - yshift++; + yshift++; } - + if(key == '='){ + makeColours(); + } + if(key == '-'){ + controlColours=!controlColours; + } } //-------------------------------------------------------------- -- cgit v1.2.3