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

Method UpdateSize

Rendering/OpenGL2/vtkOpenGLFramebufferObject.cxx:459–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459void vtkOpenGLFramebufferObject::UpdateSize()
460{
461 bool foundSize = false;
462 int size[2];
463 int aSize[2];
464 bool mismatch = false;
465
466 size[0] = 0;
467 size[1] = 0;
468 aSize[0] = 0;
469 aSize[1] = 0;
470
471 // loop through all attachments and
472 // verify they are of the same size.
473 for (foIter i = this->ColorBuffers.begin(); i != this->ColorBuffers.end(); ++i)
474 {
475 if (!i->second->CreatedByFO && i->second->IsSet())
476 {
477 i->second->GetSize(aSize);
478 if (!foundSize)
479 {
480 size[0] = aSize[0];
481 size[1] = aSize[1];
482 foundSize = true;
483 }
484 else
485 {
486 if (aSize[0] != size[0] || aSize[1] != size[1])
487 {
488 mismatch = true;
489 }
490 }
491 }
492 }
493
494 if (!this->DepthBuffer->CreatedByFO && this->DepthBuffer->IsSet())
495 {
496 this->DepthBuffer->GetSize(aSize);
497 if (!foundSize)
498 {
499 size[0] = aSize[0];
500 size[1] = aSize[1];
501 foundSize = true;
502 }
503 else
504 {
505 if (aSize[0] != size[0] || aSize[1] != size[1])
506 {
507 mismatch = true;
508 }
509 }
510 }
511
512 if (mismatch)
513 {
514 vtkErrorMacro("The framebuffer has mismatched attachments.");
515 }
516

Callers 1

StartNonOrthoMethod · 0.95

Calls 5

IsSetMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetSizeMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected