SDL_net_zig

SDL_net_zig

This is a port of SDL3_net to the Zig build system. It does not provide any Zig bindings.

How to use it

As a library

First, fetch this repository:

zig fetch --save git+https://github.com/JurMax/SDL_net_zig

Next, add it to your build.zig:

const sdl_net_dependency = b.dependency("sdl_net", .{
    .target = target,
    .optimize = optimize,
    .build_sdl = false, // Set to true to also build SDL3 itself.
});
exe.root_module.linkLibrary(sdl_net_dependency.artifact("SDL3_net"));

This will add the SDL_net library and header to exe.

Running the examples

You can run the SDL_net examples by running any of the following commands.

zig build voipchat
zig build simple-http-get
zig build resolve-hostnames
zig build get-local-addrs
zig build echo-server