@@ -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 ;
0 commit comments