Skip to content

Commit 13b8a20

Browse files
committed
Update README
1 parent 6c5861b commit 13b8a20

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Zig bindings for SDL libs.
44

5-
## Getting started
5+
## Getting started (SDL2)
66

77
Example `build.zig`:
88

@@ -13,17 +13,27 @@ pub fn build(b: *std.Build) !void {
1313
exe.linkLibC();
1414
1515
const zsdl = b.dependency("zsdl", .{});
16+
1617
exe.root_module.addImport("zsdl2", zsdl.module("zsdl2"));
17-
1818
@import("zsdl").link_SDL2(exe);
1919
20-
// Optionally use prebuilt libs instead of relying on system installed SDL...
20+
exe.root_module.addImport("zsdl2_ttf", zsdl.module("zsdl2_ttf"));
21+
@import("zsdl").link_SDL2_ttf(exe);
22+
23+
exe.root_module.addImport("zsdl2_image", zsdl.module("zsdl2_image"));
24+
@imporT("zsdl").link_SDL2_image(exe);
2125
26+
// Optionally use prebuilt libs instead of relying on system installed SDL...
2227
@import("zsdl").prebuilt.addLibraryPathsTo(exe);
23-
2428
if (@import("zsdl").prebuilt.install_SDL2(b, target.result, .bin)) |install_sdl2_step| {
2529
b.getInstallStep().dependOn(install_sdl2_step);
2630
}
31+
if (@import("zsdl").prebuilt.install_SDL2_ttf(b, target.result, .bin)) |install_sdl2_ttf_step| {
32+
b.getInstallStep().dependOn(install_sdl2_ttf_step);
33+
}
34+
if (@import("zsdl").prebuilt.install_SDL2_image(b, target.result, .bin)) |install_sdl2_image_step| {
35+
b.getInstallStep().dependOn(install_sdl2_image_step);
36+
}
2737
}
2838
```
2939

@@ -39,6 +49,11 @@ NOTE: If you want to use our prebuilt libraries also add the following to your `
3949
.hash = "1220ade6b84d06d73bf83cef22c73ec4abc21a6d50b9f48875f348b7942c80dde11b",
4050
.lazy = true,
4151
},
52+
.@"sdl2-prebuilt-x86_64-linux-gnu" = .{
53+
.url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/2eccc574ad909b0d00b694b10c217a95145c47af.tar.gz",
54+
.hash = "12200ecb91c0596d0356ff39d573af83abcd44fecb27943589f11c2cd172763fea39",
55+
.lazy = true,
56+
},
4257
```
4358

4459
Now in your code you may import and use `zsdl2`:
@@ -64,3 +79,6 @@ pub fn main() !void {
6479
...
6580
}
6681
```
82+
83+
## Getting started (SDL3)
84+
TODO

0 commit comments

Comments
 (0)