Skip to content

Commit 41e9b0a

Browse files
Fix deprecated 0.9.0 functions in all examples
1 parent 718a873 commit 41e9b0a

File tree

12 files changed

+28
-28
lines changed

12 files changed

+28
-28
lines changed

example_client_blob/src/ofApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void ofApp::onMessage( ofxLibwebsockets::Event& args ){
6060
// need to load this next frame!
6161
if ( args.isBinary ){
6262
buff.clear();
63-
buff.set(args.data.getBinaryBuffer(), args.data.size());
63+
buff.set(args.data.getData(), args.data.size());
6464
locked = true;
6565
needToLoad = true;
6666
} else {

example_particles_client/src/ofApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ void ofApp::update(){
2323
int size = buff.size();
2424

2525
float * incoming = new float[size ];
26-
memcpy(incoming, buff.getBinaryBuffer(), buff.size());
26+
memcpy(incoming, buff.getData(), buff.size());
2727

28-
posFBO.getTextureReference().loadData(incoming, textureRes, textureRes, GL_RGB);
28+
posFBO.getTexture().loadData(incoming, textureRes, textureRes, GL_RGB);
2929
mutex.unlock();
3030
updateGPUParticles();
3131
}

example_particles_server/src/ofApp.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void ofApp::update(){
1919

2020
// now, send position texture to clients
2121
posPingPong.src->readToPixels(sendPixels);
22-
server.sendBinary((char *)sendPixels.getPixels(), sendPixels.size() * sendPixels.getBytesPerChannel() );
22+
server.sendBinary((char *)sendPixels.getData(), sendPixels.size() * sendPixels.getBytesPerChannel() );
2323
}
2424

2525
//--------------------------------------------------------------
@@ -79,8 +79,8 @@ void ofApp::setupGPUParticles(){
7979
}
8080
// Load this information in to the FBO's texture
8181
posPingPong.allocate(textureRes, textureRes,GL_RGB32F);
82-
posPingPong.src->getTextureReference().loadData(pos, textureRes, textureRes, GL_RGB);
83-
posPingPong.dst->getTextureReference().loadData(pos, textureRes, textureRes, GL_RGB);
82+
posPingPong.src->getTexture().loadData(pos, textureRes, textureRes, GL_RGB);
83+
posPingPong.dst->getTexture().loadData(pos, textureRes, textureRes, GL_RGB);
8484
delete [] pos; // Delete the array
8585

8686

@@ -93,12 +93,12 @@ void ofApp::setupGPUParticles(){
9393
}
9494
// Load this information in to the FBO's texture
9595
velPingPong.allocate(textureRes, textureRes,GL_RGB32F);
96-
velPingPong.src->getTextureReference().loadData(vel, textureRes, textureRes, GL_RGB);
97-
velPingPong.dst->getTextureReference().loadData(vel, textureRes, textureRes, GL_RGB);
96+
velPingPong.src->getTexture().loadData(vel, textureRes, textureRes, GL_RGB);
97+
velPingPong.dst->getTexture().loadData(vel, textureRes, textureRes, GL_RGB);
9898
delete [] vel; // Delete the array
9999

100100
// Loading and setings of the variables of the textures of the particles
101-
sparkImg.loadImage("spark.png");
101+
sparkImg.load("spark.png");
102102
imgWidth = sparkImg.getWidth();
103103
imgHeight = sparkImg.getHeight();
104104

@@ -137,8 +137,8 @@ void ofApp::updateGPUParticles(){
137137
velPingPong.dst->begin();
138138
ofClear(0);
139139
updateVel.begin();
140-
updateVel.setUniformTexture("backbuffer", velPingPong.src->getTextureReference(), 0); // passing the previus velocity information
141-
updateVel.setUniformTexture("posData", posPingPong.src->getTextureReference(), 1); // passing the position information
140+
updateVel.setUniformTexture("backbuffer", velPingPong.src->getTexture(), 0); // passing the previus velocity information
141+
updateVel.setUniformTexture("posData", posPingPong.src->getTexture(), 1); // passing the position information
142142
updateVel.setUniform1i("resolution", (int)textureRes);
143143
updateVel.setUniform2f("screen", (float)width, (float)height);
144144
updateVel.setUniform1f("timestep", (float)timeStep);
@@ -159,8 +159,8 @@ void ofApp::updateGPUParticles(){
159159
posPingPong.dst->begin();
160160
ofClear(0);
161161
updatePos.begin();
162-
updatePos.setUniformTexture("prevPosData", posPingPong.src->getTextureReference(), 0); // Previus position
163-
updatePos.setUniformTexture("velData", velPingPong.src->getTextureReference(), 1); // Velocity
162+
updatePos.setUniformTexture("prevPosData", posPingPong.src->getTexture(), 0); // Previus position
163+
updatePos.setUniformTexture("velData", velPingPong.src->getTexture(), 1); // Velocity
164164
updatePos.setUniform1f("timestep",(float) timeStep );
165165

166166
// draw the source position texture to be updated
@@ -184,8 +184,8 @@ void ofApp::updateGPUParticles(){
184184
renderFBO.begin();
185185
ofClear(0,0,0,0);
186186
updateRender.begin();
187-
updateRender.setUniformTexture("posTex", posPingPong.dst->getTextureReference(), 0);
188-
updateRender.setUniformTexture("sparkTex", sparkImg.getTextureReference() , 1);
187+
updateRender.setUniformTexture("posTex", posPingPong.dst->getTexture(), 0);
188+
updateRender.setUniformTexture("sparkTex", sparkImg.getTexture() , 1);
189189
updateRender.setUniform1i("resolution", (float)textureRes);
190190
updateRender.setUniform2f("screen", (float)width, (float)height);
191191
updateRender.setUniform1f("size", (float)particleSize);

example_particles_server/src/ofApp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct pingPongBuffer {
2121
// Allocate
2222
for(int i = 0; i < 2; i++){
2323
FBOs[i].allocate(_width,_height, _internalformat );
24-
FBOs[i].getTextureReference().setTextureMinMagFilter(GL_NEAREST, GL_NEAREST);
24+
FBOs[i].getTexture().setTextureMinMagFilter(GL_NEAREST, GL_NEAREST);
2525
}
2626

2727
// Clean

example_server_binary/src/ofApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void ofApp::setup(){
2121

2222
// setup message queue
2323

24-
font.loadFont("myriad.ttf", 20);
24+
font.load("myriad.ttf", 20);
2525
messages.push_back("WebSocket server setup at "+ofToString( server.getPort() ) + ( server.usingSSL() ? " with SSL" : " without SSL") );
2626

2727
ofBackground(0);
@@ -32,7 +32,7 @@ void ofApp::setup(){
3232
//--------------------------------------------------------------
3333
void ofApp::update(){
3434
if ( bSendImage && toLoad != "" ){
35-
currentImage.loadImage( toLoad );
35+
currentImage.load( toLoad );
3636
server.send( ofToString(currentImage.width) +":"+ ofToString( currentImage.height ) +":"+ ofToString( currentImage.type ) );
3737
server.sendBinary( currentImage );
3838
messages.push_back( "Sending image" );

example_server_binary_video/src/ofApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void ofApp::setup(){
2323
server.addListener(this);
2424

2525
// setup message queue
26-
font.loadFont("myriad.ttf", 20);
26+
font.load("myriad.ttf", 20);
2727
messages.push_back("WebSocket server setup at "+ofToString( server.getPort() ) + ( server.usingSSL() ? " with SSL" : " without SSL") );
2828

2929
ofBackground(0);

example_server_blob/src/ofApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void ofApp::setup(){
2929

3030
// setup message queue
3131

32-
font.loadFont("myriad.ttf", 20);
32+
font.load("myriad.ttf", 20);
3333
messages.push_back("WebSocket server setup at "+ofToString( server.getPort() ) + ( server.usingSSL() ? " with SSL" : " without SSL") );
3434

3535
ofBackground(0);
@@ -178,7 +178,7 @@ void ofApp::onMessage( ofxLibwebsockets::Event& args ){
178178
if ( locked ) return;
179179
// need to load this next frame!
180180
buff.clear();
181-
buff.set(args.data.getBinaryBuffer(), args.data.size());
181+
buff.set(args.data.getData(), args.data.size());
182182
locked = true;
183183
needToLoad = true;
184184
} else {

example_server_blobvideo/src/ofApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void ofApp::setup(){
1818
server.addListener(this);
1919

2020
// setup message queue
21-
font.loadFont("myriad.ttf", 20);
21+
font.load("myriad.ttf", 20);
2222
messages.push_back("WebSocket server setup at "+ofToString( server.getPort() ) + ( server.usingSSL() ? " with SSL" : " without SSL") );
2323

2424
ofBackground(0);
@@ -31,7 +31,7 @@ void ofApp::update(){
3131
if ( bVideoSetup && video.isFrameNew() ){
3232
static unsigned long size;
3333
static ofImage currentImage;
34-
currentImage.setFromPixels(video.getPixelsRef());
34+
currentImage.setFromPixels(video.getPixels());
3535

3636
// compress video into image via turbojpg
3737
// the second param == quality. play with this to get a better framerate

libs/ofxLibwebsockets/include/ofxLibwebsockets/Connection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ namespace ofxLibwebsockets {
4141

4242
template <class T>
4343
void sendBinary( T& image ){
44-
int size = image.width * image.height * image.getPixelsRef().getNumChannels();
45-
sendBinary( (char *) image.getPixels(), size );
44+
int size = image.width * image.height * image.getPixels().getNumChannels();
45+
sendBinary( (char *) image.getPixels().getData(), size );
4646
}
4747

4848
void sendBinary( ofBuffer buffer );

libs/ofxLibwebsockets/src/Connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ namespace ofxLibwebsockets {
9191

9292
//--------------------------------------------------------------
9393
void Connection::sendBinary( ofBuffer buffer ){
94-
sendBinary(buffer.getBinaryBuffer(), buffer.size());
94+
sendBinary(buffer.getData(), buffer.size());
9595
}
9696

9797
//--------------------------------------------------------------

0 commit comments

Comments
 (0)