| 880 | } |
| 881 | |
| 882 | void vtkOpenGLFramebufferObject::AddColorAttachment(unsigned int index, vtkTextureObject* tex, |
| 883 | unsigned int zslice, unsigned int format, unsigned int mipmapLevel) |
| 884 | { |
| 885 | // is the fbo size is not set do it here |
| 886 | if (this->LastSize[0] == -1) |
| 887 | { |
| 888 | this->LastSize[0] = tex->GetWidth(); |
| 889 | this->LastSize[1] = tex->GetHeight(); |
| 890 | } |
| 891 | |
| 892 | foIter i = this->ColorBuffers.find(index); |
| 893 | if (i == this->ColorBuffers.end()) |
| 894 | { |
| 895 | vtkFOInfo* foinfo = new vtkFOInfo; |
| 896 | i = this->ColorBuffers.insert(std::make_pair(index, foinfo)).first; |
| 897 | } |
| 898 | i->second->SetTexture(tex, GL_COLOR_ATTACHMENT0 + index, format, mipmapLevel); |
| 899 | i->second->ZSlice = zslice; |
| 900 | this->AttachColorBuffer(index); |
| 901 | } |
| 902 | |
| 903 | void vtkOpenGLFramebufferObject::AddColorAttachment(unsigned int index, vtkRenderbuffer* rb) |
| 904 | { |
no test coverage detected