MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / initImGui

Method initImGui

src/gui2/imhex_overrides/splash_window.cpp:459–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457 }
458
459 void WindowSplash::initImGui() {
460 // Initialize ImGui
461 IMGUI_CHECKVERSION();
462 GImGui = ImGui::CreateContext();
463 ImGui::StyleColorsDark();
464
465 ImGui_ImplGlfw_InitForOpenGL(m_window, true);
466
467 #if defined(OS_MACOS)
468 ImGui_ImplOpenGL3_Init("#version 150");
469 #elif defined(OS_WEB)
470 ImGui_ImplOpenGL3_Init();
471 ImGui_ImplGlfw_InstallEmscriptenCallbacks(m_window, "#canvas");
472 #else
473 ImGui_ImplOpenGL3_Init("#version 130");
474 #endif
475
476 auto &io = ImGui::GetIO();
477
478 ImGui::GetStyle().ScaleAllSizes(ImHexApi::System::getGlobalScale());
479
480 // Load fonts necessary for the splash screen
481 {
482 io.Fonts->Clear();
483
484 ImFontConfig cfg;
485 cfg.OversampleH = cfg.OversampleV = 1, cfg.PixelSnapH = true;
486 io.Fonts->AddFontDefault(&cfg);
487 }
488
489 // Don't save window settings for the splash screen
490 io.IniFilename = nullptr;
491 }
492
493 /**
494 * @brief Initialize resources for the splash window

Callers 1

WindowSplashMethod · 0.95

Calls 1

ClearMethod · 0.45

Tested by

no test coverage detected