diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 826275d..ea31ba1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,4 +55,4 @@ jobs: - name: (Zig) Build Native run: zig build -Dimgui --summary all - name: (Zig + emsdk) Build Wasm - run: zig build -Dimgui -DzigCC --summary all -Dtarget=wasm32-emscripten-none -Doptimize=ReleaseSmall -DbetterC + run: zig build -Dimgui -DzigCC --summary all -Dtarget=wasm32-emscripten-none -Doptimize=ReleaseSmall diff --git a/build.zig b/build.zig index 472ca8c..3005b28 100644 --- a/build.zig +++ b/build.zig @@ -193,17 +193,17 @@ pub fn buildLibSokol(b: *Build, options: LibSokolOptions) !*CompileStep { .file = b.path(csrc_root ++ "sokol_imgui.c"), .flags = cflags, }); - const cimgui = try buildImgui(b, .{ + const imgui = try buildImgui(b, .{ .target = options.target, .optimize = options.optimize, .emsdk = options.emsdk, .use_tsan = lib.root_module.sanitize_thread orelse false, .use_ubsan = lib.root_module.sanitize_c orelse false, }); - for (cimgui.root_module.include_dirs.items) |dir| { + for (imgui.root_module.include_dirs.items) |dir| { try lib.root_module.include_dirs.append(b.allocator, dir); } - lib.linkLibrary(cimgui); + lib.linkLibrary(imgui); } return lib; } @@ -422,7 +422,7 @@ pub fn ldcBuildStep(b: *Build, options: DCompileStep) !*std.Build.Step.InstallDi "-i=sokol", "-i=shaders", "-i=handmade", - "-i=cimgui", + "-i=imgui", }); // sokol include path @@ -1149,8 +1149,8 @@ fn buildImgui(b: *Build, options: libImGuiOptions) !*CompileStep { libimgui.root_module.sanitize_thread = options.use_tsan; if (b.lazyDependency("imgui", .{})) |dep| { - const cimgui = dep.path(imguiver_path); - libimgui.addIncludePath(cimgui); + const imgui = dep.path(imguiver_path); + libimgui.addIncludePath(imgui); if (options.emsdk) |emsdk| { if (libimgui.rootModuleTarget().isWasm()) { @@ -1168,13 +1168,13 @@ fn buildImgui(b: *Build, options: libImGuiOptions) !*CompileStep { } } libimgui.addCSourceFiles(.{ - .root = cimgui, + .root = imgui, .files = &.{ "cimgui.cpp", }, }); libimgui.addCSourceFiles(.{ - .root = cimgui, + .root = imgui, .files = &.{ "imgui.cpp", "imgui_draw.cpp", diff --git a/dub.sdl b/dub.sdl index 03405df..344354f 100644 --- a/dub.sdl +++ b/dub.sdl @@ -48,7 +48,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -64,7 +64,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/clear.d" "src/examples/instancing.d" "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/clear.d" "src/examples/instancing.d" "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -80,7 +80,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -96,7 +96,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/triangle.d" "src/examples/sgl_context.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/triangle.d" "src/examples/sgl_context.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -112,7 +112,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/clear.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/clear.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -128,7 +128,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/sgl_points.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -144,7 +144,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/texcube.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/texcube.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -160,7 +160,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/debugtext.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -176,7 +176,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -192,7 +192,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/user_data.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/user_data.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -208,7 +208,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/user_data.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/cube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/user_data.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/cube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -224,7 +224,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/noninterleaved.d" "src/examples/debugtext.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -240,7 +240,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/vertexpull.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/vertexpull.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -256,7 +256,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -272,7 +272,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/quad.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/saudio.d" "src/examples/quad.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -288,7 +288,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/clear.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/shapes.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shapes.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/clear.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/shapes.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shapes.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -304,7 +304,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/shapes.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/shapes.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -320,7 +320,7 @@ subPackage { libs "user32" "gdi32" "kernel32" "dxgi" "d3d11" "ole32" platform="windows" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" - excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/cimgui/cimgui.d" "src/examples/shaders/*.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/bufferoffsets.d" "src/examples/instancing.d" "src/examples/offscreen.d" "src/examples/clear.d" "src/examples/vertexpull.d" "src/examples/quad.d" "src/examples/saudio.d" "src/examples/debugtext.d" "src/examples/noninterleaved.d" "src/examples/user_data.d" "src/examples/triangle.d" "src/examples/sgl_points.d" "src/examples/cube.d" "src/examples/mrt.d" "src/examples/blend.d" "src/examples/texcube.d" "src/examples/imgui.d" "src/examples/droptest.d" "src/imgui/package.d" "src/examples/shaders/*.d" preBuildCommands "zig build -Doptimize=ReleaseFast -Dartifact" } @@ -330,7 +330,7 @@ subPackage { targetPath "build" sourceFiles "src/examples/imgui.d" libs "sokol" - dflags "-preview=all" "-i=sokol" "-i=shaders" "-i=handmade" "-i=cimgui" + dflags "-preview=all" "-i=sokol" "-i=shaders" "-i=handmade" "-i=imgui" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" dflags "-P-I$HOME/.cache/zig/p/1220c640ad23d8800437166865e54f172c612fcfe6e000149a2b2af631c37b605f50/src" platform="posix" @@ -345,7 +345,7 @@ subPackage { targetPath "build" sourceFiles "src/examples/droptest.d" libs "sokol" - dflags "-preview=all" "-i=sokol" "-i=shaders" "-i=handmade" "-i=cimgui" + dflags "-preview=all" "-i=sokol" "-i=shaders" "-i=handmade" "-i=imgui" lflags "-Lzig-out/lib" platform="posix" lflags "/LIBPATH:zig-out/lib" platform="windows" dflags "-P-I$HOME/.cache/zig/p/1220c640ad23d8800437166865e54f172c612fcfe6e000149a2b2af631c37b605f50/src" platform="posix" diff --git a/src/examples/droptest.d b/src/examples/droptest.d index 522c66b..1a1e58a 100644 --- a/src/examples/droptest.d +++ b/src/examples/droptest.d @@ -11,9 +11,9 @@ import sg = sokol.gfx; import sgapp = sokol.glue; import sapp = sokol.app; import sfetch = sokol.fetch; -import imgui = sokol.imgui; +import simgui = sokol.imgui; import log = sokol.log; -import cimgui.cimgui; +import imgui; enum MAX_FILE_SIZE = 1024 * 1024; @@ -41,8 +41,8 @@ extern (C) void init() @safe @nogc nothrow logger: {func: &log.slog_func} }; sg.setup(gfx); - imgui.Desc imgui_desc = {0}; - imgui.setup(imgui_desc); + simgui.Desc imgui_desc = {0}; + simgui.setup(imgui_desc); // ifndef emscripten // dfmt off @@ -66,14 +66,14 @@ extern (C) void frame() @trusted { sfetch.dowork; } - imgui.FrameDesc imgui_desc = { + simgui.FrameDesc imgui_desc = { width: sapp.width(), height: sapp.height(), delta_time: sapp.frameDuration(), dpi_scale: sapp.dpiScale(), }; // dfmt on - imgui.newFrame(imgui_desc); + simgui.newFrame(imgui_desc); // /*=== UI CODE STARTS HERE ===*/ const ImVec2 window_pos = {10, 10}; @@ -105,14 +105,14 @@ extern (C) void frame() @trusted sg.Pass pass = {swapchain: sgapp.swapchain}; sg.beginPass(pass); - imgui.render; + simgui.render; sg.endPass; sg.commit; } extern (C) void event(const(sapp.Event)* ev) @trusted @nogc nothrow { - imgui.simgui_handle_event(ev); + simgui.simgui_handle_event(ev); if (ev.type == sapp.EventType.Files_dropped) { version (Emscripten) @@ -146,7 +146,7 @@ extern (C) void cleanup() @safe @nogc nothrow sfetch.shutdown; } // dfmt on - imgui.shutdown; + simgui.shutdown; sg.shutdown; } diff --git a/src/examples/imgui.d b/src/examples/imgui.d index 626ca97..2126c8f 100644 --- a/src/examples/imgui.d +++ b/src/examples/imgui.d @@ -11,9 +11,9 @@ private: import sg = sokol.gfx; import sgapp = sokol.glue; import sapp = sokol.app; -import imgui = sokol.imgui; +import simgui = sokol.imgui; import log = sokol.log; -import cimgui.cimgui; +import imgui; extern (C): @safe: @@ -39,19 +39,19 @@ void init() nothrow logger: {func: &log.slog_func} }; sg.setup(gfx); - imgui.Desc imgui_desc = {0}; - imgui.setup(imgui_desc); + simgui.Desc imgui_desc = {0}; + simgui.setup(imgui_desc); } void frame() @trusted { - imgui.FrameDesc imgui_desc = { + simgui.FrameDesc imgui_desc = { width: sapp.width(), height: sapp.height(), delta_time: sapp.frameDuration(), dpi_scale: sapp.dpiScale(), }; - imgui.newFrame(imgui_desc); + simgui.newFrame(imgui_desc); /*=== UI CODE STARTS HERE ===*/ const ImVec2 window_pos = {10, 10}; @@ -71,19 +71,19 @@ void frame() @trusted sg.Pass pass = {action: state.pass_action, swapchain: sgapp.swapchain}; sg.beginPass(pass); - imgui.render; + simgui.render; sg.endPass; sg.commit; } void event(const(sapp.Event)* ev) @trusted nothrow { - imgui.simgui_handle_event(ev); + simgui.simgui_handle_event(ev); } void cleanup() @safe nothrow { - imgui.shutdown; + simgui.shutdown; sg.shutdown; } diff --git a/src/cimgui/dcimgui.c b/src/imgui/dcimgui.c similarity index 99% rename from src/cimgui/dcimgui.c rename to src/imgui/dcimgui.c index c9674fb..2a9a5ba 100644 --- a/src/cimgui/dcimgui.c +++ b/src/imgui/dcimgui.c @@ -1,5 +1,4 @@ // Use importC to import the C header files. - #ifndef DCIMGUI_H #define DCIMGUI_H #pragma attribute(push, nogc, nothrow) // dmd-2.110.x feature diff --git a/src/cimgui/cimgui.d b/src/imgui/package.d similarity index 91% rename from src/cimgui/cimgui.d rename to src/imgui/package.d index 37e6d3e..df58d0d 100644 --- a/src/cimgui/cimgui.d +++ b/src/imgui/package.d @@ -1,8 +1,45 @@ -module cimgui.cimgui; - -// get dcimgui headers to module - @system (unsafe) functions by default -public import cimgui.dcimgui; - +/++ +This is a D wrapper around the C cimgui library (Dear ImGui). +It provides D bindings for the Dear ImGui immediate mode GUI library. +The bindings are generated using importC and manually curated. + +Features: +- Full ImGui API coverage +- @trusted (unsafe/user-checked) wrapper functions +- Uses importC to directly interface with C code - @system (unsafe) functions by default +- Preserves ImGui's original style and naming conventions +- Handles memory management and context safety ++/ + +module imgui; +public import imgui.dcimgui; + +/++ + +Index of this file: +// [SECTION] Header mess +// [SECTION] Forward declarations and basic types +// [SECTION] Dear ImGui end-user API functions +// [SECTION] Flags & Enumerations +// [SECTION] Tables API flags and structures (ImGuiTableFlags, ImGuiTableColumnFlags, ImGuiTableRowFlags, ImGuiTableBgTarget, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs) +// [SECTION] Helpers: Debug log, Memory allocations macros, ImVector<> +// [SECTION] ImGuiStyle +// [SECTION] ImGuiIO +// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload) +// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor) +// [SECTION] Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiMultiSelectIO, ImGuiSelectionRequest, ImGuiSelectionBasicStorage, ImGuiSelectionExternalStorage) +// [SECTION] Drawing API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawFlags, ImDrawListFlags, ImDrawList, ImDrawData) +// [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont) +// [SECTION] Viewports (ImGuiViewportFlags, ImGuiViewport) +// [SECTION] ImGuiPlatformIO + other Platform Dependent Interfaces (ImGuiPlatformImeData) +// [SECTION] Obsolete functions and types + ++/ + +/// Context creation and access +/// - Each context create its own ImFontAtlas by default. You may instance one yourself and pass it to CreateContext() to share a font atlas between contexts. +/// - DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions() +/// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for details. scope ImGuiContext_t* CreateContext(scope const(ImFontAtlas_t)* shared_font_atlas) @trusted { return igCreateContext(cast(ImFontAtlas_t*) shared_font_atlas); @@ -23,111 +60,134 @@ void SetCurrentContext(scope ImGuiContext_t* ctx) @trusted igSetCurrentContext(ctx); } +/// Main + +/// access the ImGuiIO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags) scope ImGuiIO_t* GetIO() @trusted { return igGetIO(); } - +/// access the ImGuiPlatformIO structure (mostly hooks/functions to connect to platform/renderer and OS Clipboard, IME etc.) scope ImGuiPlatformIO_t* GetPlatformIO() @trusted { return igGetPlatformIO(); } - +/// access the Style structure (colors, sizes). Always use PushStyleColor(), PushStyleVar() to modify style mid-frame! scope ImGuiStyle_t* GetStyle() @trusted { return igGetStyle(); } - +/// start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame(). void NewFrame() @trusted { igNewFrame(); } - +/// ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... +/// but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all! void EndFrame() @trusted { igEndFrame(); } - +/// ends the Dear ImGui frame, finalize the draw data. You can then get call GetDrawData(). void Render() @trusted { igRender(); } - +/// valid after Render() and until the next call to NewFrame(). this is what you have to render. scope ImDrawData_t* GetDrawData() @trusted { return igGetDrawData(); } +/// Demo, Debug, Information + +/// create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application! void ShowDemoWindow(scope bool* p_open) @trusted { igShowDemoWindow(p_open); } - +/// create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc. void ShowMetricsWindow(scope bool* p_open) @trusted { igShowMetricsWindow(p_open); } - +/// create Debug Log window. display a simplified log of important dear imgui events. void ShowDebugLogWindow(scope bool* p_open) @trusted { igShowDebugLogWindow(p_open); } - +/// Implied p_open = null void ShowIDStackToolWindow() @trusted { igShowIDStackToolWindow(); } - +/// create Stack Tool window. hover items with mouse to query information about the source of their unique ID. void ShowIDStackToolWindowEx(scope bool* p_open) @trusted { igShowIDStackToolWindowEx(p_open); } - +/// create About window. display Dear ImGui version, credits and build/system information. void ShowAboutWindow(scope bool* p_open) @trusted { igShowAboutWindow(p_open); } - +/// add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style) void ShowStyleEditor(scope ImGuiStyle_t* reference) @trusted { igShowStyleEditor(reference); } - +/// add style selector block (not a window), essentially a combo listing the default styles. bool ShowStyleSelector(scope const(char)* label) @trusted { return igShowStyleSelector(label); } - +/// add font selector block (not a window), essentially a combo listing the loaded fonts. void ShowFontSelector(scope const(char)* label) @trusted { igShowFontSelector(label); } - +/// add basic help/info block (not a window): how to manipulate ImGui as an end-user (mouse/keyboard controls). void ShowUserGuide() @trusted { igShowUserGuide(); } - +/// get the compiled version string e.g. "1.90" (essentially the value for IMGUI_VERSION from the compiled version of imgui.cpp) scope const(char)* GetVersion() @trusted { return igGetVersion(); } +/// Styles + +/// new, recommended style (default) void StyleColorsDark(scope ImGuiStyle_t* dst) @trusted { igStyleColorsDark(dst); } - +/// best used with borders and a custom, thicker font void StyleColorsLight(scope ImGuiStyle_t* dst) @trusted { igStyleColorsLight(dst); } - +/// classic imgui style void StyleColorsClassic(scope ImGuiStyle_t* dst) @trusted { igStyleColorsClassic(dst); } +/// Windows + +/// - Begin() = push window to the stack and start appending to it. End() = pop window from the stack. +/// - Passing 'bool* p_open != NULL' shows a window-closing widget in the upper-right corner of the window, +/// which clicking will set the boolean to false when clicked. +/// - You may append multiple times to the same window during the same frame by calling Begin()/End() pairs multiple times. +/// Some information such as 'flags' or 'p_open' will only be considered by the first call to Begin(). +/// - Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting +/// anything to the window. Always call a matching End() for each Begin() call, regardless of its return value! +/// [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions +/// such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding +/// BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.] +/// - Note that the bottom of window stack always contains a window called "Debug". bool Begin(scope const(char)* name, scope bool* p_open, int flags) @trusted { return igBegin(name, p_open, flags); @@ -138,6 +198,25 @@ void End() @trusted igEnd(); } +/// Child Windows + +/// - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child. +/// - Before 1.90 (November 2023), the "ImGuiChildFlags child_flags = 0" parameter was "bool border = false". +/// This API is backward compatible with old code, as we guarantee that ImGuiChildFlags_Borders == true. +/// Consider updating your old code: +/// BeginChild("Name", size, false) -> Begin("Name", size, 0); or Begin("Name", size, ImGuiChildFlags_None); +/// BeginChild("Name", size, true) -> Begin("Name", size, ImGuiChildFlags_Borders); +/// - Manual sizing (each axis can use a different setting e.g. ImVec2(0.0f, 400.0f)): +/// == 0.0f: use remaining parent window size for this axis. +/// > 0.0f: use specified size for this axis. +/// < 0.0f: right/bottom-align to specified distance from available content boundaries. +/// - Specifying ImGuiChildFlags_AutoResizeX or ImGuiChildFlags_AutoResizeY makes the sizing automatic based on child contents. +/// Combining both ImGuiChildFlags_AutoResizeX _and_ ImGuiChildFlags_AutoResizeY defeats purpose of a scrolling region and is NOT recommended. +/// - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting +/// anything to the window. Always call a matching EndChild() for each BeginChild() call, regardless of its return value. +/// [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions +/// such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding +/// BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.] bool BeginChild(scope const(char)* str_id, const ImVec2_t size, int child_flags, int window_flags) @trusted { return igBeginChild(str_id, size, child_flags, window_flags); @@ -153,6 +232,9 @@ void EndChild() @trusted igEndChild(); } +/// Windows Utilities +/// - 'current window' = the window we are appending into while inside a Begin()/End() block. 'next window' = next window we will Begin() into. + bool IsWindowAppearing() @trusted { return igIsWindowAppearing(); @@ -197,7 +279,8 @@ float GetWindowHeight() @trusted { return igGetWindowHeight(); } - +/// Window manipulation +/// - Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin). void SetNextWindowPos(const(ImVec2_t) pos, int cond) @trusted { igSetNextWindowPos(pos, cond); @@ -359,6 +442,17 @@ void PushStyleColorImVec4(int idx, const ImVec4_t col) @trusted igPushStyleColorImVec4(idx, col); } +/// Layout cursor positioning +/// - By "cursor" we mean the current output position. +/// - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down. +/// - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceding widget. +/// - YOU CAN DO 99% OF WHAT YOU NEED WITH ONLY GetCursorScreenPos() and GetContentRegionAvail(). +/// - Attention! We currently have inconsistencies between window-local and absolute positions we will aim to fix with future API: +/// - Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. -> this is the preferred way forward. +/// - Window-local coordinates: SameLine(offset), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), PushTextWrapPos() +/// - Window-local coordinates: GetContentRegionMax(), GetWindowContentRegionMin(), GetWindowContentRegionMax() --> all obsoleted. YOU DON'T NEED THEM. +/// - GetCursorScreenPos() = GetCursorPos() + GetWindowPos(). GetWindowPos() is almost only ever useful to convert from window-local to absolute coordinates. Try not to use it. + void PopStyleColor() @trusted { igPopStyleColor();