Examples: Fixed SDL+OpenGL2 and SDL+Vulkan examples not processing SDL_WINDOWEVENT_CLOSE events which tends to be needed in multi-viewport setting.

This commit is contained in:
omar 2020-09-07 12:19:50 +02:00
parent b25756be4a
commit 6461fd40ab
2 changed files with 4 additions and 0 deletions

View File

@ -87,6 +87,8 @@ int main(int, char**)
ImGui_ImplSDL2_ProcessEvent(&event);
if (event.type == SDL_QUIT)
done = true;
if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE && event.window.windowID == SDL_GetWindowID(window))
done = true;
}
// Start the Dear ImGui frame

View File

@ -454,6 +454,8 @@ int main(int, char**)
ImGui_ImplSDL2_ProcessEvent(&event);
if (event.type == SDL_QUIT)
done = true;
if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE && event.window.windowID == SDL_GetWindowID(window))
done = true;
}
// Resize swap chain?