int FramebufferConfiguration::getNumColorAttachments(){ int numAttachments = 0; for (auto i = fbTextures.begin(); i != fbTextures.end(); ++i) { if(i->second->attachmentInfo >= GL_COLOR_ATTACHMENT0 && i->second->attachmentInfo < GL_COLOR_ATTACHMENT0 + getMaxColorAttachments()) { numAttachments++; } } return numAttachments; }
FrameBufferObject::FrameBufferObject(unsigned int nbColorBuffer) : nbColorAttachement(nbColorBuffer) { if(nbColorAttachement > getMaxColorAttachments()) nbColorAttachement = getMaxColorAttachments(); }