Skip to content

Commit 9e81f9b

Browse files
committed
GPU OpenGL Display: remove broken functionality to draw text via ImGui
1 parent c056422 commit 9e81f9b

File tree

2 files changed

+9
-49
lines changed

2 files changed

+9
-49
lines changed

GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.cxx

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,7 @@ extern "C" int32_t gl3wInit();
3131
#include <unistd.h>
3232

3333
#ifdef GPUCA_O2_LIB
34-
#if __has_include("../src/imgui.h")
35-
#include "../src/imgui.h"
36-
#include "../src/imgui_impl_glfw_gl3.h"
37-
#else
38-
#include "DebugGUI/imgui.h"
39-
#include "DebugGUI/imgui_impl_glfw_gl3.h"
40-
#endif
34+
#include <DebugGUI/imgui.h>
4135
#include <DebugGUI/DebugGUI.h>
4236
#endif
4337

@@ -270,9 +264,6 @@ int32_t GPUDisplayFrontendGlfw::FrontendMain()
270264
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, GL_MIN_VERSION_MINOR);
271265
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, 0);
272266
glfwWindowHint(GLFW_OPENGL_PROFILE, mBackend->CoreProfile() ? GLFW_OPENGL_CORE_PROFILE : GLFW_OPENGL_COMPAT_PROFILE);
273-
#ifdef GPUCA_O2_LIB
274-
mUseIMGui = true;
275-
#endif
276267
}
277268
mWindow = glfwCreateWindow(INIT_WIDTH, INIT_HEIGHT, DISPLAY_WINDOW_NAME, nullptr, nullptr);
278269
if (!mWindow) {
@@ -303,56 +294,26 @@ int32_t GPUDisplayFrontendGlfw::FrontendMain()
303294
return (-1);
304295
}
305296

306-
#if defined(GPUCA_O2_LIB) && !defined(GPUCA_DISPLAY_GL3W)
307-
if (mUseIMGui && gl3wInit()) {
308-
fprintf(stderr, "Error initializing gl3w (2)\n");
309-
return (-1); // Hack: We have to initialize gl3w as well, as the DebugGUI uses it.
310-
}
311-
#endif
312-
313-
#ifdef GPUCA_O2_LIB
314-
if (mUseIMGui) {
315-
mCanDrawText = 2;
316-
if (drawTextFontSize() == 0) {
317-
drawTextFontSize() = 12;
318-
}
319-
}
320-
#endif
321-
322297
if (InitDisplay()) {
323298
fprintf(stderr, "Error in GLFW display initialization\n");
324299
return (1);
325300
}
326301

327-
#ifdef GPUCA_O2_LIB
328-
if (mUseIMGui) {
329-
ImGui_ImplGlfwGL3_Init(mWindow, false);
330-
while (o2::framework::pollGUI(mWindow, DisplayLoop)) {
302+
while (!glfwWindowShouldClose(mWindow)) {
303+
HandleSendKey();
304+
if (DrawGLScene()) {
305+
fprintf(stderr, "Error drawing GL scene\n");
306+
return (1);
331307
}
332-
} else
333-
#endif
334-
{
335-
while (!glfwWindowShouldClose(mWindow)) {
336-
HandleSendKey();
337-
if (DrawGLScene()) {
338-
fprintf(stderr, "Error drawing GL scene\n");
339-
return (1);
340-
}
341-
if (backend()->backendType() == GPUDisplayBackend::TYPE_OPENGL) {
342-
glfwSwapBuffers(mWindow);
343-
}
344-
glfwPollEvents();
308+
if (backend()->backendType() == GPUDisplayBackend::TYPE_OPENGL) {
309+
glfwSwapBuffers(mWindow);
345310
}
311+
glfwPollEvents();
346312
}
347313

348314
ExitDisplay();
349315
mDisplayControl = 2;
350316
pthread_mutex_lock(&mSemLockExit);
351-
#ifdef GPUCA_O2_LIB
352-
if (mUseIMGui) {
353-
ImGui_ImplGlfwGL3_Shutdown();
354-
}
355-
#endif
356317
glfwDestroyWindow(mWindow);
357318
glfwTerminate();
358319
mGlfwRunning = false;

GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class GPUDisplayFrontendGlfw : public GPUDisplayFrontend
6262
int32_t mWindowHeight = INIT_HEIGHT;
6363
uint8_t mKeyDownMap[256] = {0};
6464
uint8_t mLastKeyDown = 0;
65-
bool mUseIMGui = false;
6665
};
6766
} // namespace o2::gpu
6867

0 commit comments

Comments
 (0)