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
name = "Custom FBO Source";
name = "Scanline Source";
// Allocate our FBO source, decide how big it should be
allocate(500, 500);
@ -19,7 +19,7 @@ void CustomSource::setup(){
}
// Don't do any drawing here
void CustomSource::update(){
void ScanlineSource::update(){
// Move rects
for(int i = 0; i < rects.size(); 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.
// All within draw() is being rendered into fbo;
void CustomSource::draw(){
void ScanlineSource::draw(){
// Fill FBO with our rects
ofClear(0);
//ofBackground(0);
@ -45,4 +45,4 @@ void CustomSource::draw(){
ofRect(rects[i]);
}
#endif
}
}

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

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

4
example_fbo-sources/src/ofApp.h

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

Loading…
Cancel
Save