diff options
Diffstat (limited to 'src/testApp.cpp')
| -rw-r--r-- | src/testApp.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/testApp.cpp b/src/testApp.cpp index 629ffce..3b0b9b1 100644 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -101,29 +101,40 @@ void testApp::setup(){ for (int i=0;i<bgimg.width;i++,fi+=si,ifi-=si){ fj=0.0f; ifj=1.0f; - for (int j=0;j<bgimg.height;j++,fj+=sj,ifj-=sj){ + for (int j=0;j<bgimg.height;j++,fj+=sj,ifj-=sj){ px[(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)))); px[(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)))); px[(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.setUseTexture(true); bgimg.update(); - + icons=new ofImage[3]; + icons[0].loadImage("Phone.png"); icons[1].loadImage("iPhone.png"); icons[2].loadImage("Tablet.png"); + //create the socket and bind to port 7888 + udpConnection.Create(); + udpConnection.Bind(7888); + udpConnection.SetNonBlocking(true); + } //-------------------------------------------------------------- void testApp::update(){ - + char udpMessage[1024]; + udpConnection.Receive(udpMessage,1024); + string message=udpMessage; + if(message!=""){ + printf("%s\n",message.c_str()); + } } |
