MCPcopy Create free account
hub / github.com/christophhart/HISE / perform

Method perform

hi_scripting/scripting/api/ScriptDrawActions.cpp:708–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706 }
707
708 void perform(Graphics& g) override
709 {
710 using namespace juce::gl;
711
712 auto invT = AffineTransform::scale(1.0f / handler->getScaleFactor()).translated(bounds.getX(), bounds.getY());
713
714
715
716 if (obj != nullptr && obj->shader != nullptr)
717 {
718 if (auto lastScreenshot = obj->getScreenshotBuffer())
719 {
720 g.drawImageTransformed(lastScreenshot->data, invT);
721 return;
722 }
723
724 if (obj->dirty)
725 {
726 {
727 obj->makeStatistics();
728
729 }
730
731 auto r = obj->shader->checkCompilation(g.getInternalContext());
732 obj->setCompileResult(r);
733 obj->dirty = false;
734
735#if USE_BACKEND
736 if (!obj->compiledOk())
737 {
738 int safeCount = 0;
739
740 if(OpenGLContext::getCurrentContext() != nullptr)
741 {
742 while (glGetError() != GL_NO_ERROR)
743 {
744 safeCount++;
745
746 if (safeCount > 10000)
747 break;
748 };
749
750 auto s = StringArray::fromLines(obj->getErrorMessage(true));
751 s.removeEmptyStrings();
752
753 for (auto l : s)
754 handler->logError(l);
755 }
756 else
757 {
758 handler->logError("Open GL is not enabled");
759 }
760 }
761#endif
762 }
763
764 if (obj->compiledOk())
765 {

Callers

nothing calls this directly

Calls 15

scaleClass · 0.85
getScreenshotBufferMethod · 0.80
drawImageTransformedMethod · 0.80
makeStatisticsMethod · 0.80
setCompileResultMethod · 0.80
removeEmptyStringsMethod · 0.80
getGlobalBoundsMethod · 0.80
shouldWriteToBufferMethod · 0.80
getScreenshotBoundsMethod · 0.80
renderWasFinishedMethod · 0.80
swapFunction · 0.50
translatedMethod · 0.45

Tested by

no test coverage detected