MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Draw

Method Draw

Source/ModularSynth.cpp:501–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501void ModularSynth::Draw(void* vg)
502{
503 gNanoVG = (NVGcontext*)vg;
504
505 ofNoFill();
506
507 //DrawTextNormal("fps: "+ofToString(ofGetFrameRate(),4)+" "+ofToString(ofGetWidth()*ofGetHeight()), 100, 100,50);
508 //return;
509
510 mModuleContainer.SetDrawScale(gDrawScale);
511 mDrawRect.set(-GetDrawOffset().x, -GetDrawOffset().y, ofGetWidth() / gDrawScale, ofGetHeight() / gDrawScale);
512
513 if (mFatalError != "")
514 {
515 ofSetColor(255, 255, 255, 255);
516 DrawFallbackText(("bespoke " + GetBuildInfoString()).c_str(), 100, 50);
517
518 if (gFont.IsLoaded())
519 DrawTextNormal(mFatalError, 100, 100, 18);
520 else
521 DrawFallbackText(mFatalError.c_str(), 100, 100);
522 }
523
524 if (ScriptModule::sBackgroundTextString != "")
525 {
526 ofPushStyle();
527 ofSetColor(ScriptModule::sBackgroundTextColor);
528 DrawTextBold(ScriptModule::sBackgroundTextString, ScriptModule::sBackgroundTextPos.x, ScriptModule::sBackgroundTextPos.y + ScriptModule::sBackgroundTextSize, ScriptModule::sBackgroundTextSize);
529 ofPopStyle();
530 }
531
532 if (UserPrefs.draw_background_lissajous.Get())
533 DrawLissajous(mGlobalRecordBuffer, 0, 0, ofGetWidth(), ofGetHeight(), sBackgroundLissajousR, sBackgroundLissajousG, sBackgroundLissajousB, UserPrefs.background_lissajous_autocorrelate.Get());
534
535 if (gTime == 1 && mFatalError == "")
536 {
537 std::string loading("Bespoke is initializing audio...");
538 DrawTextNormal(loading, ofGetWidth() / 2 - GetStringWidth(loading, 28) / 2, ofGetHeight() / 2 - 6, 28);
539 return;
540 }
541
542 if (!mInitialized && mFatalError == "")
543 {
544 std::string loading("Bespoke is loading...");
545 DrawTextNormal(loading, ofGetWidth() / 2 - GetStringWidth(loading, 28) / 2, ofGetHeight() / 2 - 6, 28);
546 return;
547 }
548
549 ofPushMatrix();
550
551 ofScale(gDrawScale, gDrawScale, gDrawScale);
552
553 ofPushMatrix();
554
555 ofTranslate(GetDrawOffset().x, GetDrawOffset().y);
556
557 if (ShouldShowGridSnap())
558 {

Callers 1

DrawConsoleMethod · 0.45

Calls 15

ofNoFillFunction · 0.85
ofGetWidthFunction · 0.85
ofGetHeightFunction · 0.85
ofSetColorFunction · 0.85
DrawFallbackTextFunction · 0.85
GetBuildInfoStringFunction · 0.85
DrawTextNormalFunction · 0.85
ofPushStyleFunction · 0.85
DrawTextBoldFunction · 0.85
ofPopStyleFunction · 0.85
DrawLissajousFunction · 0.85
GetStringWidthFunction · 0.85

Tested by

no test coverage detected