コード例 #1
0
void ofFbo::destroy() {
	if(fbo){
		releaseFB(fbo);
		fbo=0;
	}
	if(depthBuffer){
		releaseRB(depthBuffer);
		depthBuffer = 0;
	}
	if(depthBufferTex.isAllocated()){
		depthBufferTex.clear();
	}
	if(stencilBuffer){
		releaseRB(stencilBuffer);
		stencilBuffer = 0;
	}

	if(settings.numSamples && fboTextures){
		releaseFB(fboTextures);
		fboTextures = 0;
	}

	textures.clear();

	for(int i=0; i<(int)colorBuffers.size(); i++) releaseRB(colorBuffers[i]);
	colorBuffers.clear();

	isBound = 0;
	bIsAllocated = false;
}
コード例 #2
0
ファイル: ofFbo.cpp プロジェクト: jvcleave/compare
//--------------------------------------------------------------
void ofFbo::clear() {
	if(fbo){
		releaseFB(fbo);
		fbo=0;
	}
	if(depthBuffer){
		releaseRB(depthBuffer);
		depthBuffer = 0;
	}
	if(depthBufferTex.isAllocated()){
		depthBufferTex.clear();
	}
	if(stencilBuffer){
		releaseRB(stencilBuffer);
		stencilBuffer = 0;
	}
	if(settings.numSamples && fboTextures){
		releaseFB(fboTextures);
		fboTextures = 0;
	}
	textures.clear();
	for (int i=0; i < (int)colorBuffers.size(); i++) {
		releaseRB(colorBuffers[i]);
	}
	colorBuffers.clear();
	activeDrawBuffers.clear();
	bIsAllocated = false;
#ifdef TARGET_ANDROID
	ofRemoveListener(ofxAndroidEvents().reloadGL,this,&ofFbo::reloadFbo);
#endif
}