Browse Source

Clean up `FboSource`

Remove obsolete ofApp setup event registration. Only the FboSource base class setup()
function was called and thus it was not working properly.
master
Krisjanis Rijnieks 9 years ago
parent
commit
f671a27d72
  1. 17
      src/Sources/FboSource.cpp
  2. 2
      src/Sources/FboSource.h

17
src/Sources/FboSource.cpp

@ -8,8 +8,6 @@ FboSource::FboSource() : fbo(0){
loadable = false; loadable = false;
loaded = false; loaded = false;
type = SourceType::SOURCE_TYPE_FBO; type = SourceType::SOURCE_TYPE_FBO;
ofAddListener(ofEvents().setup, this,
&FboSource::onAppSetup, OF_EVENT_ORDER_BEFORE_APP);
} }
FboSource::~FboSource(){ FboSource::~FboSource(){
@ -37,21 +35,6 @@ void FboSource::removeAppListeners(){
&FboSource::onAppExit, OF_EVENT_ORDER_AFTER_APP); &FboSource::onAppExit, OF_EVENT_ORDER_AFTER_APP);
} }
void FboSource::onAppSetup(ofEventArgs & args){
ofRemoveListener(ofEvents().setup, this,
&FboSource::onAppSetup, OF_EVENT_ORDER_BEFORE_APP);
setup();
// Check if FBO was allocated in user defined setup
// If not, show warning and alocate to avoid panic
if(!fbo->isAllocated()){
ofLogWarning("FboSource::onAppSetup")
<< "FBO not allocated, allocating with default values";
allocate(PIMAPPER_FBO_SOURCE_DEF_WIDTH,
PIMAPPER_FBO_SOURCE_DEF_HEIGHT);
}
}
void FboSource::onAppUpdate(ofEventArgs & args){ void FboSource::onAppUpdate(ofEventArgs & args){
if(fbo == 0 || !fbo->isAllocated()){ if(fbo == 0 || !fbo->isAllocated()){
ofLogWarning("FboSource") << "FBO not allocated"; ofLogWarning("FboSource") << "FBO not allocated";

2
src/Sources/FboSource.h

@ -4,8 +4,6 @@
#include "BaseSource.h" #include "BaseSource.h"
#define PIMAPPER_FBO_SOURCE_DEF_NAME "FBO Source" #define PIMAPPER_FBO_SOURCE_DEF_NAME "FBO Source"
#define PIMAPPER_FBO_SOURCE_DEF_WIDTH 500
#define PIMAPPER_FBO_SOURCE_DEF_HEIGHT 500
namespace ofx { namespace ofx {
namespace piMapper { namespace piMapper {

Loading…
Cancel
Save