MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / draw

Function draw

TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp:586–1006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584 }
585
586 void draw(bool drawFrontEnd, bool noGameData, bool setDefaults, bool showFps)
587 {
588 const u32 windowInvisFlags = ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoSavedSettings;
589
590 DisplayInfo display;
591 TFE_RenderBackend::getDisplayInfo(&display);
592 u32 w = display.width;
593 u32 h = display.height;
594 u32 menuWidth = 156;
595 u32 menuHeight = 306;
596
597 if (TFE_Console::isOpen())
598 {
599 TFE_Console::update();
600 }
601 if (TFE_ProfilerView::isEnabled())
602 {
603 TFE_ProfilerView::update();
604 }
605 if (noGameData)
606 {
607 s_subUI = FEUI_CONFIG;
608 s_configTab = CONFIG_GAME;
609 s_appState = APP_STATE_MENU;
610 s_drawNoGameDataMsg = true;
611 pickCurrentResolution();
612 }
613 else if (setDefaults)
614 {
615 s_subUI = FEUI_NONE;
616 s_appState = APP_STATE_SET_DEFAULTS;
617 pickCurrentResolution();
618 }
619 if (!drawFrontEnd)
620 {
621 if (showFps) { drawFps(w); }
622 return;
623 }
624
625 if (s_subUI == FEUI_NONE)
626 {
627 s_menuRetState = APP_STATE_MENU;
628 s_relativeMode = false;
629
630 const f32 windowPadding = 16.0f; // required padding so that a window completely holds a control without clipping.
631
632 const s32 logoScale = 2160; // logo and title are authored for 2160p so it looks good at high resolutions, such as 1440p and 4k.
633 const s32 posScale = 1080; // positions are at 1080p so must be scaled for different resolutions.
634 const s32 titlePosY = 100;
635
636 const s32 logoHeight = s_logoGpuImage.height * h / logoScale;
637 const s32 logoWidth = s_logoGpuImage.width * h / logoScale;
638 const s32 titleHeight = s_titleGpuImage.height * h / logoScale;
639 const s32 titleWidth = s_titleGpuImage.width * h / logoScale;
640 const s32 textHeight = s_buttonNormal[0].height * h / logoScale;
641 const s32 textWidth = s_buttonNormal[0].width * h / logoScale;
642 const s32 topOffset = titlePosY * h / posScale;
643

Callers 3

manualFunction · 0.70
creditsFunction · 0.70
configAboutFunction · 0.70

Calls 15

getDisplayInfoFunction · 0.85
isOpenFunction · 0.85
isEnabledFunction · 0.85
pickCurrentResolutionFunction · 0.85
drawFpsFunction · 0.85
ImVec2Function · 0.85
ImageClass · 0.85
getVersionStringFunction · 0.85
maxFunction · 0.85
inputMapping_getFunction · 0.85
getGameSettingsFunction · 0.85
getGraphicsSettingsFunction · 0.85

Tested by

no test coverage detected