Browse Source

Rename CustomSource to ScanlineSource

master
Krisjanis Rijnieks 7 years ago
parent
commit
232e5f34e1
  1. 12
      example_fbo-sources/src/ScanLineSource/ScanlineSource.cpp
  2. 4
      example_fbo-sources/src/ScanLineSource/ScanlineSource.h
  3. 4
      example_fbo-sources/src/ofApp.h

12
example_fbo-sources/src/CustomSource.cpp → example_fbo-sources/src/ScanLineSource/ScanlineSource.cpp

@ -1,8 +1,8 @@
#include "CustomSource.h" #include "ScanlineSource.h"
void CustomSource::setup(){ void ScanlineSource::setup(){
// Give our source a decent name // Give our source a decent name
name = "Custom FBO Source"; name = "Scanline Source";
// Allocate our FBO source, decide how big it should be // Allocate our FBO source, decide how big it should be
allocate(500, 500); allocate(500, 500);
@ -19,7 +19,7 @@ void CustomSource::setup(){
} }
// Don't do any drawing here // Don't do any drawing here
void CustomSource::update(){ void ScanlineSource::update(){
// Move rects // Move rects
for(int i = 0; i < rects.size(); i++){ for(int i = 0; i < rects.size(); i++){
rects[i].y += rectSpeeds[i]; rects[i].y += rectSpeeds[i];
@ -31,7 +31,7 @@ void CustomSource::update(){
// No need to take care of fbo.begin() and fbo.end() here. // No need to take care of fbo.begin() and fbo.end() here.
// All within draw() is being rendered into fbo; // All within draw() is being rendered into fbo;
void CustomSource::draw(){ void ScanlineSource::draw(){
// Fill FBO with our rects // Fill FBO with our rects
ofClear(0); ofClear(0);
//ofBackground(0); //ofBackground(0);
@ -45,4 +45,4 @@ void CustomSource::draw(){
ofRect(rects[i]); ofRect(rects[i]);
} }
#endif #endif
} }

4
example_fbo-sources/src/CustomSource.h → example_fbo-sources/src/ScanLineSource/ScanlineSource.h

@ -3,7 +3,7 @@
#include "ofMain.h" #include "ofMain.h"
#include "FboSource.h" #include "FboSource.h"
class CustomSource : public ofx::piMapper::FboSource { class ScanlineSource : public ofx::piMapper::FboSource {
public: public:
void setup(); void setup();
void update(); void update();
@ -11,4 +11,4 @@ class CustomSource : public ofx::piMapper::FboSource {
std::vector<ofRectangle> rects; std::vector<ofRectangle> rects;
std::vector<float> rectSpeeds; std::vector<float> rectSpeeds;
}; };

4
example_fbo-sources/src/ofApp.h

@ -2,8 +2,8 @@
#include "ofMain.h" #include "ofMain.h"
#include "ofxPiMapper.h" #include "ofxPiMapper.h"
#include "CustomSource.h"
#include "VideoSource.h" #include "VideoSource.h"
#include "ScanlineSource.h"
#include "magSlideShowSource.h" #include "magSlideShowSource.h"
class ofApp : public ofBaseApp{ class ofApp : public ofBaseApp{
@ -23,7 +23,7 @@ public:
// By using a custom source that is derived from FboSource // By using a custom source that is derived from FboSource
// you will be able to see the source listed in sources editor // you will be able to see the source listed in sources editor
CustomSource customSource; ScanlineSource customSource;
magSlideShowSource slideShowSource; magSlideShowSource slideShowSource;
}; };

Loading…
Cancel
Save