|
@ -8,6 +8,7 @@ FboSource::FboSource() : fbo(0){ |
|
|
loadable = false; |
|
|
loadable = false; |
|
|
loaded = false; |
|
|
loaded = false; |
|
|
type = SourceType::SOURCE_TYPE_FBO; |
|
|
type = SourceType::SOURCE_TYPE_FBO; |
|
|
|
|
|
_disableDraw = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
FboSource::~FboSource(){ |
|
|
FboSource::~FboSource(){ |
|
@ -48,6 +49,11 @@ void FboSource::onAppDraw(ofEventArgs & args){ |
|
|
ofLogWarning("FboSource") << "FBO not allocated"; |
|
|
ofLogWarning("FboSource") << "FBO not allocated"; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(_disableDraw){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
fbo->begin(); |
|
|
fbo->begin(); |
|
|
draw(); |
|
|
draw(); |
|
|
fbo->end(); |
|
|
fbo->end(); |
|
@ -57,6 +63,10 @@ void FboSource::onAppExit(ofEventArgs & args){ |
|
|
exit(); |
|
|
exit(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FboSource::setDisableDraw(bool b){ |
|
|
|
|
|
_disableDraw = b; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void FboSource::allocate(int width, int height){ |
|
|
void FboSource::allocate(int width, int height){ |
|
|
clear(); |
|
|
clear(); |
|
|
fbo = new ofFbo(); |
|
|
fbo = new ofFbo(); |
|
|