MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / drawOverlay

Method drawOverlay

Gui/ViewerGL.cpp:606–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604}
605
606void
607ViewerGL::drawOverlay(unsigned int mipMapLevel)
608{
609 // always running in the main thread
610 assert( qApp && qApp->thread() == QThread::currentThread() );
611 assert( QOpenGLContext::currentContext() == context() );
612
613 glCheckError();
614
615 double screenPixelRatio = getScreenPixelRatio();
616
617 {
618 GLProtectAttrib a(GL_COLOR_BUFFER_BIT | GL_LINE_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT);
619
620 glDisable(GL_BLEND);
621 glLineWidth(1. * screenPixelRatio);
622
623 int activeInputs[2];
624 getInternalNode()->getActiveInputs(activeInputs[0], activeInputs[1]);
625 for (int i = 0; i < 2; ++i) {
626
627 if ( (i == 1) && (_imp->viewerTab->getCompositingOperator() == eViewerCompositingOperatorNone) ) {
628 break;
629 }
630 RectD canonicalFormat = getCanonicalFormat(i);
631
632 // Draw format
633 {
634 assert(_imp->_textFont);
635 renderText(canonicalFormat.right(), canonicalFormat.bottom(), _imp->currentViewerInfo_resolutionOverlay[i], _imp->textRenderingColor, *_imp->_textFont);
636
637
638 QPoint topRight( canonicalFormat.right(), canonicalFormat.top() );
639 QPoint topLeft( canonicalFormat.left(), canonicalFormat.top() );
640 QPoint btmLeft( canonicalFormat.left(), canonicalFormat.bottom() );
641 QPoint btmRight( canonicalFormat.right(), canonicalFormat.bottom() );
642
643 glLineWidth(1. * screenPixelRatio);
644 glBegin(GL_LINES);
645
646 glColor4f( _imp->displayWindowOverlayColor.redF(),
647 _imp->displayWindowOverlayColor.greenF(),
648 _imp->displayWindowOverlayColor.blueF(),
649 _imp->displayWindowOverlayColor.alphaF() );
650 glVertex3f(btmRight.x(), btmRight.y(), 1);
651 glVertex3f(btmLeft.x(), btmLeft.y(), 1);
652
653 glVertex3f(btmLeft.x(), btmLeft.y(), 1);
654 glVertex3f(topLeft.x(), topLeft.y(), 1);
655
656 glVertex3f(topLeft.x(), topLeft.y(), 1);
657 glVertex3f(topRight.x(), topRight.y(), 1);
658
659 glVertex3f(topRight.x(), topRight.y(), 1);
660 glVertex3f(btmRight.x(), btmRight.y(), 1);
661
662 glEnd();
663 glCheckErrorIgnoreOSXBug();

Callers

nothing calls this directly

Calls 12

renderTextFunction · 0.85
operatorIsWipeFunction · 0.85
RenderScaleClass · 0.85
drawOverlaysMethod · 0.80
getActiveInputsMethod · 0.45
rightMethod · 0.45
bottomMethod · 0.45
topMethod · 0.45
leftMethod · 0.45
xMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected