| 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 |
no test coverage detected