diff options
| author | git@eclectronics.org <git@eclectronics.org@eclectronics.org> | 2012-05-22 11:22:46 +0100 |
|---|---|---|
| committer | git@eclectronics.org <git@eclectronics.org@eclectronics.org> | 2012-05-22 11:22:46 +0100 |
| commit | e410b99203100c47674c92b910f6e0422b39ccdf (patch) | |
| tree | c702cdaa3831d5e10a73840dd25b6922f9d1e3bb /src | |
| parent | 6cb91ded1e6dfb6089954019638419b1e4332dc3 (diff) | |
abandon windows
Diffstat (limited to 'src')
| -rw-r--r-- | src/testApp.cpp | 35 | ||||
| -rw-r--r-- | src/testApp.h | 5 |
2 files changed, 31 insertions, 9 deletions
diff --git a/src/testApp.cpp b/src/testApp.cpp index ea03c54..6091759 100644 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -18,7 +18,7 @@ represents a handset how to deal with time/ range being limited -exponential --choose VP carefully- perspective +-choose VP carefully- perspective -just decide the longest time that it will be active scalability @@ -82,11 +82,32 @@ void testApp::setup(){ imeis[i]+=(char)(ofRandom(10)+48); } } -<<<<<<< HEAD - - //bgimg.allocate( -======= ->>>>>>> 02635c7127b158a2821ce1f2e9fde20407d81037 + + + //bgimg.allocate(256,256,OF_IMAGE_COLOR); + // + /* + cols=new ofColor[4]; + cols[0]=ofColor(80,80,80); + cols[1]=ofColor(80,80,80); + cols[2]=ofColor(0,0,0); + cols[3]=ofColor(0,0,0); + float fi,fj,ifi,ifj; + float si=1.0f/bgimg.width; + float sj=1.0f/bgimg.height; + for (int i=0,fi=0.0f,ifi=1.0f;i<bgimg.width;i++,fi+=si,ifi-=si){ + for (int j=0,fj=0.0f,ifj=1.0f;j<bgimg.width;j++,fj+=sj,ifj-=sj){ + bgimg.getPixels()[(j*bgimg.width+i)*3]=(unsigned char)((ifj*((ifi*cols[0].r)+(fi*cols[1].r)))+(fj*((ifi*cols[2].r)+(fi*cols[3].r)))); + bgimg.getPixels()[(j*bgimg.width+i)*3+1]=(unsigned char)((ifj*((ifi*cols[0].g)+(fi*cols[1].g)))+(fj*((ifi*cols[2].g)+(fi*cols[3].g)))); + bgimg.getPixels()[(j*bgimg.width+i)*3+2]=(unsigned char)((ifj*((ifi*cols[0].b)+(fi*cols[1].b)))+(fj*((ifi*cols[2].b)+(fi*cols[3].b)))); + } + } + + */ + bgimg.loadImage("TextureTrapdoor.jpg"); + bgimg.setUseTexture(true); + bgimg.update(); + } @@ -101,7 +122,7 @@ void testApp::update(){ void testApp::draw(){ glDisable(GL_LIGHTING); - ofBackground(0,0,0); + bgimg.draw(0,0,256,256); //windowWidth,windowHeight); camera.begin(); diff --git a/src/testApp.h b/src/testApp.h index 6f64416..3b6d4ba 100644 --- a/src/testApp.h +++ b/src/testApp.h @@ -22,12 +22,13 @@ class testApp : public ofBaseApp{ int windowWidth, windowHeight; ofCamera camera; - + int numLines; ofPoint *lines; string *imeis; - + ofImage bgimg; + ofColor *cols; }; |
