Skip to content

Commit

Permalink
Merge pull request #15 from Angar0Os/master
Browse files Browse the repository at this point in the history
Bugfix on screen_capture_texture and on Imgui tutorials
  • Loading branch information
astrofra authored Nov 19, 2024
2 parents cdb4895 + 7ce17b6 commit 64766bf
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/resources_compiled
/_bin
/assetc-ubuntu-x64-2.3.0
screenshots/.png
1 change: 1 addition & 0 deletions imgui_basic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions imgui_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
1 change: 1 addition & 0 deletions imgui_edit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions imgui_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions imgui_mouse_capture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions imgui_mouse_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion scene_capture_texture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "capture" .. ".png"
hg.SavePNG(picture, png_filename)
state = "none" -- Reset state to none to be able to screenshot again
end
Expand Down
2 changes: 1 addition & 1 deletion scene_capture_texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "capture" + ".png"
hg.SavePNG(picture, png_filename)
state = "none" #Reset state to none to be able to screenshot again

Expand Down

0 comments on commit 64766bf

Please sign in to comment.