From 284c6550447ad4d998ffcc83a2e1acd98022d135 Mon Sep 17 00:00:00 2001 From: Angaros Date: Tue, 19 Nov 2024 10:28:26 +0100 Subject: [PATCH 1/3] Bugfix imgui can now interact on resized window --- imgui_basic.lua | 1 + imgui_basic.py | 1 + imgui_edit.lua | 1 + imgui_edit.py | 1 + imgui_mouse_capture.lua | 1 + imgui_mouse_capture.py | 1 + 6 files changed, 6 insertions(+) diff --git a/imgui_basic.lua b/imgui_basic.lua index 77c6a48..7451cd5 100644 --- a/imgui_basic.lua +++ b/imgui_basic.lua @@ -18,6 +18,7 @@ hg.ImGuiInit(10, imgui_prg, imgui_img_prg) -- main loop while not hg.ReadKeyboard():Key(hg.K_Escape) and hg.IsWindowOpen(win) do + render_was_reset, res_x, res_y = hg.RenderResetToWindow(win, res_x, res_y, hg.RF_VSync) hg.ImGuiBeginFrame(res_x, res_y, hg.TickClock(), hg.ReadMouse(), hg.ReadKeyboard()) if hg.ImGuiBegin('Window') then diff --git a/imgui_basic.py b/imgui_basic.py index 0037e6a..69cac17 100644 --- a/imgui_basic.py +++ b/imgui_basic.py @@ -18,6 +18,7 @@ # main loop while not hg.ReadKeyboard().Key(hg.K_Escape) and hg.IsWindowOpen(win): + render_was_reset, res_x, res_y = hg.RenderResetToWindow(win, res_x, res_y, hg.RF_VSync) hg.ImGuiBeginFrame(res_x, res_y, hg.TickClock(), hg.ReadMouse(), hg.ReadKeyboard()) if hg.ImGuiBegin('Window'): diff --git a/imgui_edit.lua b/imgui_edit.lua index e0c8bf8..950898a 100644 --- a/imgui_edit.lua +++ b/imgui_edit.lua @@ -22,6 +22,7 @@ imgui_clear_color_preset = 0 -- main loop while not hg.ReadKeyboard():Key(hg.K_Escape) and hg.IsWindowOpen(win) do + render_was_reset, res_x, res_y = hg.RenderResetToWindow(win, res_x, res_y, hg.RF_VSync) dt = hg.TickClock() -- ImGui frame diff --git a/imgui_edit.py b/imgui_edit.py index 3d0ad63..c284053 100644 --- a/imgui_edit.py +++ b/imgui_edit.py @@ -22,6 +22,7 @@ # main loop while not hg.ReadKeyboard().Key(hg.K_Escape) and hg.IsWindowOpen(win): + render_was_reset, res_x, res_y = hg.RenderResetToWindow(win, res_x, res_y, hg.RF_VSync) dt = hg.TickClock() # ImGui frame diff --git a/imgui_mouse_capture.lua b/imgui_mouse_capture.lua index d9b9659..97dfb3d 100644 --- a/imgui_mouse_capture.lua +++ b/imgui_mouse_capture.lua @@ -19,6 +19,7 @@ mouse = hg.Mouse() keyboard = hg.Keyboard() while not hg.ReadKeyboard():Key(hg.K_Escape) and hg.IsWindowOpen(win) do + render_was_reset, res_x, res_y = hg.RenderResetToWindow(win, res_x, res_y, hg.RF_VSync) mouse:Update() keyboard:Update() diff --git a/imgui_mouse_capture.py b/imgui_mouse_capture.py index cf5485f..acab877 100644 --- a/imgui_mouse_capture.py +++ b/imgui_mouse_capture.py @@ -19,6 +19,7 @@ keyboard = hg.Keyboard() while not hg.ReadKeyboard().Key(hg.K_Escape) and hg.IsWindowOpen(win): + render_was_reset, res_x, res_y = hg.RenderResetToWindow(win, res_x, res_y, hg.RF_VSync) mouse.Update() keyboard.Update() From 8c7f4bbfb0e9ef9731d8a4b639d01f8922daf87b Mon Sep 17 00:00:00 2001 From: Angaros Date: Tue, 19 Nov 2024 10:35:35 +0100 Subject: [PATCH 2/3] Removed screenshot folder from gitIngore and added file name to screen_capture --- .gitignore | 1 - scene_capture_texture.lua | 2 +- scene_capture_texture.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 23f3fd7..36ec8b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /resources_compiled /_bin /assetc-ubuntu-x64-2.3.0 -screenshots/.png diff --git a/scene_capture_texture.lua b/scene_capture_texture.lua index 208c912..c7c8ec7 100644 --- a/scene_capture_texture.lua +++ b/scene_capture_texture.lua @@ -66,7 +66,7 @@ while not hg.ReadKeyboard():Key(hg.K_Escape) and hg.IsWindowOpen(win) do -- Take screenshot if CaptureTexture is ready and user pressed space elseif (state == "capture" and frame_count_capture <= frame) then - png_filename = "screenshots/" .. ".png" + png_filename = "screen_capture_texture_lua" .. ".png" hg.SavePNG(picture, png_filename) state = "none" -- Reset state to none to be able to screenshot again end diff --git a/scene_capture_texture.py b/scene_capture_texture.py index f87bb09..efab5cb 100644 --- a/scene_capture_texture.py +++ b/scene_capture_texture.py @@ -72,7 +72,7 @@ # Take screenshot if CaptureTexture is ready and user pressed space elif(state == "capture" and frame_count_capture <= frame): - png_filename = "screenshots/" + ".png" + png_filename = "screen_capture_texture_python" + ".png" hg.SavePNG(picture, png_filename) state = "none" #Reset state to none to be able to screenshot again From 7ce17b661aac6c441fe3387b1c4d32bf57464160 Mon Sep 17 00:00:00 2001 From: Angaros Date: Tue, 19 Nov 2024 10:44:47 +0100 Subject: [PATCH 3/3] Capture filename updated to capture.png --- scene_capture_texture.lua | 2 +- scene_capture_texture.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scene_capture_texture.lua b/scene_capture_texture.lua index c7c8ec7..5b52b80 100644 --- a/scene_capture_texture.lua +++ b/scene_capture_texture.lua @@ -66,7 +66,7 @@ while not hg.ReadKeyboard():Key(hg.K_Escape) and hg.IsWindowOpen(win) do -- Take screenshot if CaptureTexture is ready and user pressed space elseif (state == "capture" and frame_count_capture <= frame) then - png_filename = "screen_capture_texture_lua" .. ".png" + png_filename = "capture" .. ".png" hg.SavePNG(picture, png_filename) state = "none" -- Reset state to none to be able to screenshot again end diff --git a/scene_capture_texture.py b/scene_capture_texture.py index efab5cb..0af22c8 100644 --- a/scene_capture_texture.py +++ b/scene_capture_texture.py @@ -72,7 +72,7 @@ # Take screenshot if CaptureTexture is ready and user pressed space elif(state == "capture" and frame_count_capture <= frame): - png_filename = "screen_capture_texture_python" + ".png" + png_filename = "capture" + ".png" hg.SavePNG(picture, png_filename) state = "none" #Reset state to none to be able to screenshot again