MCPcopy Create free account
hub / github.com/Kitware/VTK / ActivateDrawBuffers

Method ActivateDrawBuffers

Rendering/OpenGL2/vtkOpenGLFramebufferObject.cxx:594–616  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

592
593//------------------------------------------------------------------------------
594void vtkOpenGLFramebufferObject::ActivateDrawBuffers(unsigned int num)
595{
596 GLint maxbuffers;
597 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxbuffers);
598
599 GLenum* buffers = new GLenum[maxbuffers];
600 GLint count = 0;
601 for (unsigned int cc = 0; cc < num && count < maxbuffers; cc++)
602 {
603 buffers[cc] = GL_COLOR_ATTACHMENT0 + cc;
604 count++;
605 }
606
607 this->Context->GetState()->vtkDrawBuffers(count, buffers, this);
608 delete[] buffers;
609
610 this->ActiveBuffers.clear();
611 for (unsigned int cc = 0; cc < num; cc++)
612 {
613 this->ActiveBuffers.push_back(cc);
614 }
615 this->Modified();
616}
617
618unsigned int vtkOpenGLFramebufferObject::GetActiveDrawBuffer(unsigned int id)
619{

Callers 1

ActivateDrawBufferMethod · 0.95

Calls 5

vtkDrawBuffersMethod · 0.80
GetStateMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected