X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fapp.cc;h=46b0152aa84b9883885b3f9c9b083cd618c1af19;hp=a03fd34f9bb703a80ad76ea5ac86dd5555fa6007;hb=e12a327cc0b4f1e59f4a66a80b170ec41ce97be6;hpb=512acaa2427ffa2ff19079f999bc2fcd7cd33925 diff --git a/src/app.cc b/src/app.cc index a03fd34..46b0152 100644 --- a/src/app.cc +++ b/src/app.cc @@ -71,8 +71,6 @@ static bool show_blobs; static Renderer *rend; -static bool show_debug_gui; - bool app_init(int argc, char **argv) { @@ -347,11 +345,9 @@ void app_display() float dt = (float)(time_msec - prev_msec) / 1000.0f; prev_msec = time_msec; - if(show_debug_gui) { + if(debug_gui) { ImGui::GetIOPtr()->DeltaTime = dt; ImGui::NewFrame(); - - ImGui::ShowTestWindow(); } if(opt.vr) { @@ -378,7 +374,7 @@ void app_display() draw_vrhands(); } - if(show_debug_gui) { + if(debug_gui) { ImGui::Render(); } } @@ -408,7 +404,7 @@ void app_display() glUseProgram(0); } - if(show_debug_gui) { + if(debug_gui) { ImGui::Render(); } app_swap_buffers(); @@ -500,7 +496,7 @@ void app_keyboard(int key, bool pressed) { unsigned int mod = app_get_modifiers(); - if(show_debug_gui && !(pressed && (key == '`' || key == 27))) { + if(debug_gui && !(pressed && (key == '`' || key == 27))) { debug_gui_key(key, pressed, mod); return; // ignore all keystrokes when GUI is visible } @@ -519,8 +515,8 @@ void app_keyboard(int key, bool pressed) break; case '`': - show_debug_gui = !show_debug_gui; - show_message("debug gui %s", show_debug_gui ? "enabled" : "disabled"); + debug_gui = !debug_gui; + show_message("debug gui %s", debug_gui ? "enabled" : "disabled"); break; case 'm': @@ -592,7 +588,7 @@ void app_keyboard(int key, bool pressed) void app_mouse_button(int bn, bool pressed, int x, int y) { - if(show_debug_gui) { + if(debug_gui) { debug_gui_mbutton(bn, pressed, x, y); return; // ignore mouse events while GUI is visible } @@ -620,7 +616,7 @@ static void mouse_zoom(float dx, float dy) void app_mouse_motion(int x, int y) { - if(show_debug_gui) { + if(debug_gui) { debug_gui_mmotion(x, y); return; // ignore mouse events while GUI is visible } @@ -651,7 +647,7 @@ void app_mouse_delta(int dx, int dy) void app_mouse_wheel(int dir) { - if(show_debug_gui) { + if(debug_gui) { debug_gui_wheel(dir); } }