From f671a27d7245a7c5d348ab112fcb431436dfeceb Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Thu, 9 Jun 2016 21:13:53 +0200 Subject: [PATCH] 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. --- src/Sources/FboSource.cpp | 17 ----------------- src/Sources/FboSource.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/src/Sources/FboSource.cpp b/src/Sources/FboSource.cpp index 55bafde..d21f1c9 100644 --- a/src/Sources/FboSource.cpp +++ b/src/Sources/FboSource.cpp @@ -8,8 +8,6 @@ FboSource::FboSource() : fbo(0){ loadable = false; loaded = false; type = SourceType::SOURCE_TYPE_FBO; - ofAddListener(ofEvents().setup, this, - &FboSource::onAppSetup, OF_EVENT_ORDER_BEFORE_APP); } FboSource::~FboSource(){ @@ -37,21 +35,6 @@ void FboSource::removeAppListeners(){ &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){ if(fbo == 0 || !fbo->isAllocated()){ ofLogWarning("FboSource") << "FBO not allocated"; diff --git a/src/Sources/FboSource.h b/src/Sources/FboSource.h index 819529c..54aed6a 100644 --- a/src/Sources/FboSource.h +++ b/src/Sources/FboSource.h @@ -4,8 +4,6 @@ #include "BaseSource.h" #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 piMapper {