summaryrefslogtreecommitdiff
path: root/src/testApp.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-06-02 01:41:16 +0100
committerTim Redfern <tim@eclectronics.org>2012-06-02 01:41:16 +0100
commit5e3ad78c98cb45bb4f902207d25f4fec6a2bedaa (patch)
tree13cb2e98f33fcad83a74f3abb717bab06e01d2a4 /src/testApp.cpp
parent4ca02e7856d0e660906e2a0f04150fbfce70214d (diff)
streaming from db
Diffstat (limited to 'src/testApp.cpp')
-rw-r--r--src/testApp.cpp19
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());
+ }
}