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

Method Render

Source/IDrawableModule.cpp:401–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401void IDrawableModule::Render()
402{
403 if (!mShowing)
404 return;
405
406 PreDrawModule();
407
408 if (mMinimized)
409 mMinimizeAnimation += ofGetLastFrameTime() * 5;
410 else
411 mMinimizeAnimation -= ofGetLastFrameTime() * 5;
412 mMinimizeAnimation = ofClamp(mMinimizeAnimation, 0, 1);
413
414 float w, h;
415 GetDimensions(w, h);
416
417 ofPushMatrix();
418 ofPushStyle();
419
420 float titleBarHeight;
421 float highlight;
422 DrawFrame(w, h, true, titleBarHeight, highlight);
423
424 if (Minimized() || IsVisible() == false)
425 DrawBeacon(30, -titleBarHeight / 2);
426
427 ofPushStyle();
428 const float kPipWidth = 8;
429 const float kPipSpacing = 2;
430 float receiveIndicatorX = w - (kPipWidth + kPipSpacing);
431 ofFill();
432
433 if (CanReceiveAudio())
434 {
435 ofSetColor(GetColor(kModuleCategory_Audio));
436 ofRect(receiveIndicatorX, -titleBarHeight - 2, kPipWidth, 3, 1.0f);
437 receiveIndicatorX -= kPipWidth + kPipSpacing;
438 }
439 if (CanReceiveNotes())
440 {
441 ofSetColor(GetColor(kModuleCategory_Note));
442 ofRect(receiveIndicatorX, -titleBarHeight - 2, kPipWidth, 3, 1.0f);
443 receiveIndicatorX -= kPipWidth + kPipSpacing;
444 }
445 if (CanReceivePulses())
446 {
447 ofSetColor(GetColor(kModuleCategory_Pulse));
448 ofRect(receiveIndicatorX, -titleBarHeight - 2, kPipWidth, 3, 1.0f);
449 receiveIndicatorX -= kPipWidth + kPipSpacing;
450 }
451 ofPopStyle();
452
453 if (IsResizable() && !Minimized())
454 {
455 ofColor color = GetColor(mModuleCategory);
456 ofSetColor(color, 255);
457 if (mHoveringOverResizeHandle)
458 ofSetLineWidth(4);

Callers

nothing calls this directly

Calls 15

ofGetLastFrameTimeFunction · 0.85
ofClampFunction · 0.85
ofPushMatrixFunction · 0.85
ofPushStyleFunction · 0.85
ofFillFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
ofSetLineWidthFunction · 0.85
ofLineFunction · 0.85
ofMapFunction · 0.85
ofPopMatrixFunction · 0.85

Tested by

no test coverage detected