From f3401ce1532938fec63d22095ca8b14affcfdce3 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Tue, 5 Mar 2024 19:16:25 +0100 Subject: exit button working --- src/main_windows.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main_windows.cpp') diff --git a/src/main_windows.cpp b/src/main_windows.cpp index f657042..1f64642 100644 --- a/src/main_windows.cpp +++ b/src/main_windows.cpp @@ -34,6 +34,7 @@ static WGL_WindowData g_MainWindow; static int g_Width; static int g_Height; LARGE_INTEGER Frequency; +bool program_running = true; bool CreateDeviceWGL(HWND hWnd, WGL_WindowData* data); void CleanupDeviceWGL(HWND hWnd, WGL_WindowData* data); @@ -44,7 +45,6 @@ static const char* _ts_platform_get_config_file_path(char* buffer) { if(SUCCEEDED(SHGetFolderPathA(0, CSIDL_LOCAL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0, buffer))) { strcat_s(buffer, MAX_INPUT_LENGTH, "\\text-search\\config.ini"); - printf("%s\n", buffer); return buffer; } @@ -110,7 +110,7 @@ int main(int, char**) ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f); bool done = false; - while (!done) + while (program_running) { MSG msg; while (::PeekMessage(&msg, nullptr, 0U, 0U, PM_REMOVE)) @@ -118,9 +118,9 @@ int main(int, char**) ::TranslateMessage(&msg); ::DispatchMessage(&msg); if (msg.message == WM_QUIT) - done = true; + program_running = false; } - if (done) + if (!program_running) break; ImGui_ImplOpenGL3_NewFrame(); -- cgit v1.2.3-70-g09d2