MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / initialize

Method initialize

src/host/imgui_layer.cpp:42–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42bool ImGuiLayer::initialize(GLFWwindow* window, const float content_scale) {
43 if (initialized_) {
44 return true;
45 }
46 if (window == nullptr) {
47 return false;
48 }
49
50 window_ = window;
51 content_scale_ = content_scale;
52
53 IMGUI_CHECKVERSION();
54 ImGui::CreateContext();
55 ImGui::StyleColorsDark();
56 setup_ui_fonts(content_scale);
57
58 if (!ImGui_ImplGlfw_InitForOpenGL(window, true)) {
59 ImGui::DestroyContext();
60 return false;
61 }
62
63 oid::platform::install_input_workarounds(window);
64
65 if (!ImGui_ImplOpenGL3_Init(oid::platform::imgui_glsl_version())) {
66 ImGui_ImplGlfw_Shutdown();
67 ImGui::DestroyContext();
68 return false;
69 }
70
71 initialized_ = true;
72 return true;
73}
74
75void ImGuiLayer::begin_frame() {
76 // Size the canvas/GLFW window BEFORE ImGui_ImplGlfw_NewFrame: the

Callers 3

mainFunction · 0.45
get_text_rendererMethod · 0.45
syncMethod · 0.45

Calls 3

setup_ui_fontsFunction · 0.85
imgui_glsl_versionFunction · 0.85

Tested by

no test coverage detected