From 9e0b6172c55afdac4a818d8da94745df0b873923 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Sat, 29 Oct 2022 23:41:15 +0200 Subject: [PATCH] optimize playtwitch --- scripts/playtwitch/src/main.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/playtwitch/src/main.zig b/scripts/playtwitch/src/main.zig index a68f677..6b85fa6 100644 --- a/scripts/playtwitch/src/main.zig +++ b/scripts/playtwitch/src/main.zig @@ -46,6 +46,9 @@ pub fn main() !void { defer state.deinit(); while (c.glfwWindowShouldClose(win) == 0) { + if (c.glfwGetWindowAttrib(win, c.GLFW_VISIBLE) == 0) + continue; + c.glfwPollEvents(); var win_width: c_int = 0; @@ -75,7 +78,7 @@ pub fn main() !void { c.ImGuiCond_Always, ); - if (win_visible and c.glfwGetWindowAttrib(win, c.GLFW_VISIBLE) != 0) { + if (win_visible) { try gui.winContent(state); }