Zig bindings for Impeller's standalone impeller.h API.
Standalone SDK artifacts are packaged in impeller-sdk.
Examples here.
- Linux + Vulkan
- macOS + Metal
- Windows + Vulkan
- Zig wrappers for contexts, surfaces, paints, paths, textures, display lists, typography, and basic geometry
zig fetch --save git+https://github.com/impeller-interop/impeller-zig#mainAdd the dependency in build.zig:
// ...
const impeller_dep = b.dependency("zig_impeller", .{
.target = target,
.optimize = optimize,
});
const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "impeller", .module = impeller_dep.module("impeller") },
},
});
const exe = b.addExecutable(.{
.name = "app",
.root_module = exe_mod,
});
exe.root_module.linkLibrary(impeller_dep.artifact("impeller"));
// ...Then import it:
const impeller = @import("impeller");Core drawing code:
var builder = try impeller.DisplayListBuilder.init(null);
defer builder.deinit();
var paint = try impeller.Paint.init();
defer paint.deinit();
paint.setColor(impeller.srgb(1.0, 1.0, 1.0, 1.0));
builder.drawPaint(paint);
paint.setColor(impeller.srgb(0.2, 0.4, 1.0, 1.0));
builder.drawRect(impeller.rect(120.0, 100.0, 240.0, 160.0), paint);
var list = try builder.build();
defer list.deinit();
try surface.draw(list);
try surface.present();Runnable examples now live in the separate impeller-zig-examples repository so this package stays a pure library dependency with no windowing requirement.
- All of
impeller.his wrapped zig build testruns unit testsFragmentProgramis wrapped, but shader packaging is not documented here yet
Fetch the current pinned header:
python3 tools/fetch_h.py --currentThis updates tools/impeller.h, which is committed alongside build.zig.zon.
Fetch the latest stable header for comparison:
python3 tools/fetch_h.pyUse --sha <engine-sha> to fetch a specific Flutter engine header into tools/impeller_<sha8>.h.
Export the current SDK header surface:
python3 tools/export_h.pyCompare the current SDK header with another SDK:
python3 tools/diff_h.py --new tools/impeller_<sha8>.hBy default diff_h.py compares against tools/impeller.h. Use --old /path/to/old/impeller.h to compare against a specific header.

