From 02dbff4e82603279a0b0c5062d20067b2614a15e Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 5 Sep 2012 13:37:00 +0100 Subject: first show --- liveengine/src/testApp.cpp | 72 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 12 deletions(-) (limited to 'liveengine/src/testApp.cpp') diff --git a/liveengine/src/testApp.cpp b/liveengine/src/testApp.cpp index c23ec86..52a9cc3 100755 --- a/liveengine/src/testApp.cpp +++ b/liveengine/src/testApp.cpp @@ -32,7 +32,7 @@ void testApp::setup(){ controlColours=false; - grab.allocate(ofGetWidth(), ofGetHeight(),GL_RGB); + grab.allocate(1024,768,GL_RGB); //ofGetWidth(), ofGetHeight(),GL_RGB); //grab.setUseTexture(true); showFPS=false; @@ -43,6 +43,7 @@ void testApp::setup(){ xshift=-1; yshift=-1; + fadetime=0; mode=BLOCKS; @@ -57,7 +58,10 @@ void testApp::setup(){ printf("hue of green is %f\n",ofColor(0,255,0).getHue()); printf("hue of blue is %f\n",ofColor(0,0,255).getHue()); hue is float from 0.0-255.0 - */ + */ + ofSetFrameRate(60); + rotate=0; + scale=1.0f; } void testApp::makeColours() { @@ -71,7 +75,7 @@ void testApp::update(){ //-------------------------------------------------------------- void testApp::draw(){ - ofSetColor(255,255,255); + grab.loadScreenData( 0, 0, ofGetWidth(), ofGetHeight() ); /* can this work? @@ -79,8 +83,13 @@ void testApp::draw(){ 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); + ofSetColor(255-fadetime,255-fadetime,255-fadetime); + for (int i=(xshift>0?xshift-ofGetWidth():xshift);i0?yshift-ofGetHeight():yshift);jdraw(lamda,controllers); else list.layers[note]->draw(lamda); @@ -122,7 +134,7 @@ void testApp::keyPressed (int key){ list.load("insects.xml"); } if(key == 'w'){ - list.load("barcelona.xml"); + list.load("women_ethnic.xml"); } if(key == 'e'){ list.load("organs.xml"); @@ -130,6 +142,24 @@ void testApp::keyPressed (int key){ if(key == 'r'){ list.load("tai_chi.xml"); } + if(key == 't'){ + list.load("reptiles.xml"); + } + if(key == 'y'){ + list.load("military_ladies.xml"); + } + if(key == 'u'){ + list.load("knights.xml"); + } + if(key == 'i'){ + list.load("mil_historic.xml"); + } + if(key == 'o'){ + list.load("yoga.xml"); + } + if(key == 'p'){ + list.load("dancing.xml"); + } if(key == 's'){ XML.saveFile("settings.xml"); printf("settings saved!\n"); @@ -141,17 +171,17 @@ void testApp::keyPressed (int key){ mode=key-'0'; } if(key == OF_KEY_LEFT){ - xshift++; + yshift++; } if(key == OF_KEY_RIGHT){ - xshift--; + yshift--; } if(key == OF_KEY_DOWN){ - yshift--; + xshift--; } if(key == OF_KEY_UP){ - yshift++; + xshift++; } if(key == '='){ makeColours(); @@ -159,6 +189,24 @@ void testApp::keyPressed (int key){ if(key == '-'){ controlColours=!controlColours; } + if(key == '+'){ + fadetime=min(128,fadetime+1); + } + if(key == '_'){ + fadetime=max(0,fadetime-1); + } + if(key == ']'){ + scale*=1.01; + } + if(key == '['){ + scale/=1.01; + } + if(key == '}'){ + rotate+=90; + } + if(key == '{'){ + rotate-=90; + } } //-------------------------------------------------------------- -- cgit v1.2.3