Browse Source

Fix deprecations for oF v0.9.0 in example

master
Krisjanis Rijnieks 10 years ago
parent
commit
26c428a46e
  1. 20
      example/src/CrossSource.cpp
  2. 12
      example/src/CustomSource.cpp

20
example/src/CrossSource.cpp

@ -8,8 +8,11 @@ CrossSource::CrossSource(){
void CrossSource::draw(){
ofClear(0);
ofSetColor(255, 255, 0, 255);
ofRect(0, 0, getWidth(), getHeight());
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
ofDrawRectangle(0, 0, getWidth(), getHeight());
#else
ofRect(0, 0, getWidth(), getHeight());
#endif
ofSetColor(0, 0, 0, 255);
ofSetLineWidth(5);
@ -17,10 +20,17 @@ void CrossSource::draw(){
ofPoint startPoint = ofPoint(10, y);
ofPoint endPoint = ofPoint(getWidth() - 10, getHeight() - y);
ofLine(startPoint, endPoint);
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
ofDrawLine(startPoint, endPoint);
#else
ofLine(startPoint, endPoint);
#endif
float tempY = startPoint.y;
startPoint.y = endPoint.y;
endPoint.y = tempY;
ofLine(startPoint, endPoint);
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
ofDrawLine(startPoint, endPoint);
#else
ofLine(startPoint, endPoint);
#endif
}

12
example/src/CustomSource.cpp

@ -36,7 +36,13 @@ void CustomSource::draw(){
ofClear(0);
//ofBackground(0);
ofSetColor(255);
for(int i = 0; i < rects.size(); i++){
ofRect(rects[i]);
}
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
for(int i = 0; i < rects.size(); i++){
ofDrawRectangle(rects[i]);
}
#else
for(int i = 0; i < rects.size(); i++){
ofRect(rects[i]);
}
#endif
}
Loading…
Cancel
Save