From 49d0fa5130941b2e7854e8e14b21140f9f99a8a9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 7 Sep 2023 21:26:26 +0800 Subject: [PATCH] add update button --- main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index dcf8a85..bb5698f 100644 --- a/main.cpp +++ b/main.cpp @@ -168,6 +168,7 @@ int main(int argc, char* argv[]) std::atexit(TerminateDSP); bool exit = false; + bool update = true; while(!exit && !glfwWindowShouldClose(window)) { glfwPollEvents(); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); @@ -177,7 +178,7 @@ int main(int argc, char* argv[]) #if defined(GL_UNPACK_ROW_LENGTH) && !defined(__EMSCRIPTEN__) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); #endif - { + if(update) { std::lock_guard guard(waterfall_data_mutex); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, waterfall_width, waterfall_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, waterfall_data); } @@ -195,6 +196,7 @@ int main(int argc, char* argv[]) ImGui::TableSetupColumn("", 0, 280.0); ImGui::TableSetupColumn("", 0, 1000.0); ImGui::TableNextColumn(); + ImGui::Checkbox("Update", &update); if(ImGui::Button("Exit")) exit = true; ImGui::Text("FPS: %d", (int)fps);