// TODO: default destruction, resize void FBO::destroy() { if(0 == name_) return; glBindFramebuffer(GL_FRAMEBUFFER, name_); // MacOSX has many attachments, OpenGL ES only 1 GLint maxColorAttachments = 1; #if !ESSENTIAL_GL_PRACTICES_IPHONE_OS glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); #endif for(unsigned i = 0; i < maxColorAttachments; i++) { deleteAttachment(GL_COLOR_ATTACHMENT0+i); } deleteAttachment(GL_DEPTH_ATTACHMENT); deleteAttachment(GL_STENCIL_ATTACHMENT); glDeleteFramebuffers(1,&name_); name_=0; isTexture_=false; for(unsigned i=0;i<eBufferTypeSize;i++) { buffers_[i]=0; } size_ = UInt2(); }
void XFE_ComposeAttachFolderView::deleteAttach() { int pos=_attachPanel->currentSelectionPos(); if (pos>=0) deleteAttachment(pos); }