Skip to content

Commit

Permalink
fixed: bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dinau committed Dec 13, 2024
1 parent b5e0f3c commit c515318
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sdl2_sdl2/
simple/
<<<<<<< HEAD
oldsrc/
Expand Down
6 changes: 4 additions & 2 deletions examples/glfw_opengl3/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions examples/glfw_opengl3_image_load/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions examples/glfw_opengl3_implot/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion examples/glfw_opengl3_jp/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
3 changes: 2 additions & 1 deletion examples/iconFontViewer/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 4 additions & 2 deletions examples/imPlotDemo/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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();
}
Expand Down
6 changes: 4 additions & 2 deletions examples/sdl2_opengl3/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions examples/sdl3_opengl3/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c515318

Please sign in to comment.