From c5153188c671840e171a093759b6f782f9295ded Mon Sep 17 00:00:00 2001 From: dinau Date: Fri, 13 Dec 2024 23:05:22 +0900 Subject: [PATCH] fixed: bugs --- .gitignore | 1 + examples/glfw_opengl3/src/main.zig | 6 ++++-- examples/glfw_opengl3_image_load/src/main.zig | 6 ++++-- examples/glfw_opengl3_implot/src/main.zig | 9 ++++++--- examples/glfw_opengl3_jp/src/main.zig | 3 ++- examples/iconFontViewer/src/main.zig | 3 ++- examples/imPlotDemo/src/main.zig | 6 ++++-- examples/sdl2_opengl3/src/main.zig | 6 ++++-- examples/sdl3_opengl3/src/main.zig | 6 ++++-- 9 files changed, 31 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 913119b..abc11b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +sdl2_sdl2/ simple/ <<<<<<< HEAD oldsrc/ diff --git a/examples/glfw_opengl3/src/main.zig b/examples/glfw_opengl3/src/main.zig index 52ed926..e55bb10 100644 --- a/examples/glfw_opengl3/src/main.zig +++ b/examples/glfw_opengl3/src/main.zig @@ -163,7 +163,8 @@ pub fn main () !void { //------------------ // Show main window //------------------ - if ( ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0)) { + { + _ = ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0); defer ig.igEnd (); ig.igText (fonts.ICON_FA_COMMENT ++ " GLFW v"); ig.igSameLine (0, -1.0); ig.igText (ig.glfwGetVersionString()); @@ -217,7 +218,8 @@ pub fn main () !void { //------------------------ // Show image load window //------------------------ - if (ig.igBegin("Image load test", null, 0)) { + { + _ = ig.igBegin("Image load test", null, 0); defer ig.igEnd(); var imageBoxPosTop:ig.ImVec2 = undefined; var imageBoxPosEnd:ig.ImVec2 = undefined; diff --git a/examples/glfw_opengl3_image_load/src/main.zig b/examples/glfw_opengl3_image_load/src/main.zig index 0c224c0..2c25814 100644 --- a/examples/glfw_opengl3_image_load/src/main.zig +++ b/examples/glfw_opengl3_image_load/src/main.zig @@ -183,7 +183,8 @@ pub fn main () !void { //------------------ // Show main window //------------------ - if ( ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0)) { + { + _ = ig.igBegin(fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0); defer ig.igEnd (); ig.igText (fonts.ICON_FA_COMMENT ++ " GLFW v"); ig.igSameLine (0, -1.0); ig.igText (ig.glfwGetVersionString()); @@ -279,7 +280,8 @@ pub fn main () !void { //------------------------ // Show image load window //------------------------ - if (ig.igBegin("Image load test", null, 0)) { + { + _ = ig.igBegin("Image load test", null, 0); defer ig.igEnd(); var imageBoxPosTop:ig.ImVec2 = undefined; var imageBoxPosEnd:ig.ImVec2 = undefined; diff --git a/examples/glfw_opengl3_implot/src/main.zig b/examples/glfw_opengl3_implot/src/main.zig index 43c828f..b179fc1 100644 --- a/examples/glfw_opengl3_implot/src/main.zig +++ b/examples/glfw_opengl3_implot/src/main.zig @@ -166,7 +166,8 @@ pub fn main() !void { //------------------ // Show main window //------------------ - if (ig.igBegin(fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0)) { + { + _ = ig.igBegin(fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0); defer ig.igEnd(); ig.igText(fonts.ICON_FA_COMMENT ++ " GLFW v"); ig.igSameLine(0, -1.0); ig.igText(ig.glfwGetVersionString()); @@ -276,7 +277,8 @@ fn imPlotWindow(fshow: *bool) !void { st.y_data[i] = @intCast(i * i); } } - if (ig.igBegin("Plot Window", fshow, 0)) { + { + _ = ig.igBegin("Plot Window", fshow, 0); defer ig.igEnd(); if (ip.ImPlot_BeginPlot("My Plot", .{ .x = 0, .y = 0 }, 0)) { defer ip.ImPlot_EndPlot(); @@ -306,7 +308,8 @@ fn imPlotWindow2(fshow: *bool) !void { st.y_data[i] = @intCast(i * i); } } - if (ig.igBegin("Plot Window2", fshow, 0)) { + { + _ = ig.igBegin("Plot Window2", fshow, 0); defer ig.igEnd(); if (ip.ImPlot_BeginPlot("My Plot", .{ .x = 0, .y = 0 }, 0)) { defer ip.ImPlot_EndPlot(); diff --git a/examples/glfw_opengl3_jp/src/main.zig b/examples/glfw_opengl3_jp/src/main.zig index 1b3fff3..dbdce02 100644 --- a/examples/glfw_opengl3_jp/src/main.zig +++ b/examples/glfw_opengl3_jp/src/main.zig @@ -150,7 +150,8 @@ pub fn main () !void { //------------------ // Show main window //------------------ - if ( ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0)) { + { + _ = ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0); defer ig.igEnd (); ig.igText (fonts.ICON_FA_COMMENT ++ " GLFW v"); ig.igSameLine (0, -1.0); ig.igText (ig.glfwGetVersionString()); diff --git a/examples/iconFontViewer/src/main.zig b/examples/iconFontViewer/src/main.zig index 24359c0..d566e3c 100644 --- a/examples/iconFontViewer/src/main.zig +++ b/examples/iconFontViewer/src/main.zig @@ -152,7 +152,8 @@ pub fn main () !void { //------------------ // Show info window //------------------ - if (ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0)) { + { + _ = ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0); defer ig.igEnd(); ig.igText (fonts.ICON_FA_COMMENT ++ " GLFW v"); ig.igSameLine (0, -1.0); ig.igText (ig.glfwGetVersionString()); diff --git a/examples/imPlotDemo/src/main.zig b/examples/imPlotDemo/src/main.zig index 93bfe4c..63603fa 100644 --- a/examples/imPlotDemo/src/main.zig +++ b/examples/imPlotDemo/src/main.zig @@ -167,7 +167,8 @@ pub fn main () !void { //------------------ // Show main window //------------------ - if ( ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0)) { + { + _ = ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " Dear ImGui", null, 0); defer ig.igEnd (); ig.igText (fonts.ICON_FA_COMMENT ++ " GLFW v"); ig.igSameLine (0, -1.0); ig.igText (ig.glfwGetVersionString()); @@ -258,7 +259,8 @@ pub fn main () !void { // imPlotDemoWindow //------------------- fn imPlotDemoWindow() !void { - if (ig.igBegin(fonts.ICON_FA_SIGNAL ++ " ImPlot demo: All demos have been written in Zig lang.", null, 0)) { + { + _ = ig.igBegin(fonts.ICON_FA_SIGNAL ++ " ImPlot demo: All demos have been written in Zig lang.", null, 0); defer ig.igEnd(); try demo.imPlotDemoTabs(); } diff --git a/examples/sdl2_opengl3/src/main.zig b/examples/sdl2_opengl3/src/main.zig index 74a17f0..21aafc2 100644 --- a/examples/sdl2_opengl3/src/main.zig +++ b/examples/sdl2_opengl3/src/main.zig @@ -143,7 +143,8 @@ pub fn main () !void { //------------------ // Show main window //------------------ - if (ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " ImGui: Dear Bindings", null, 0)) { + { + _ = ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " ImGui: Dear Bindings", null, 0); defer ig.igEnd (); var ver:ig.SDL_version = undefined; ig.SDL_GetVersion(&ver); @@ -199,7 +200,8 @@ pub fn main () !void { //------------------------ // Show image load window //------------------------ - if (ig.igBegin("Image load test", null, 0)) { + { + _ = ig.igBegin("Image load test", null, 0); defer ig.igEnd(); var imageBoxPosTop:ig.ImVec2 = undefined; var imageBoxPosEnd:ig.ImVec2 = undefined; diff --git a/examples/sdl3_opengl3/src/main.zig b/examples/sdl3_opengl3/src/main.zig index b1bf48b..82000ae 100644 --- a/examples/sdl3_opengl3/src/main.zig +++ b/examples/sdl3_opengl3/src/main.zig @@ -141,7 +141,8 @@ pub fn main () !void { //------------------ // Show main window //------------------ - if (ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " ImGui: Dear Bindings", null, 0)) { + { + _ = ig.igBegin (fonts.ICON_FA_THUMBS_UP ++ " ImGui: Dear Bindings", null, 0); defer ig.igEnd (); ig.igText (fonts.ICON_FA_COMMENT ++ " SDL3 v"); ig.igSameLine (0, -1.0); ig.igText ("[%d],[%s]", ig.SDL_GetVersion(), ig.SDL_GetRevision()); @@ -195,7 +196,8 @@ pub fn main () !void { //------------------------ // Show image load window //------------------------ - if (ig.igBegin("Image load test", null, 0)) { + { + _ = ig.igBegin("Image load test", null, 0); defer ig.igEnd(); var imageBoxPosTop:ig.ImVec2 = undefined; var imageBoxPosEnd:ig.ImVec2 = undefined;