Im not sure if this is a me problem or a normal thing.
I don't know if there is a good/normal/best way to get going with sdl3? When I fetch this repo, which seems to have the most stars for sdl3, I dont get autocomplete with neovim/homebrew zig 0.14. (Autocomplete normally works, but here in this example when I then type c. I don't get the autocomplete popup.)
// zig fetch --save git+https://github.com/castholm/SDL.git
const c = @cImport({
@cDefine("SDL_DISABLE_OLD_NAMES", {});
@cInclude("SDL3/SDL.h");
@cInclude("SDL3/SDL_revision.h");
// For programs that provide their own entry points instead of relying on SDL's main function
// macro magic, 'SDL_MAIN_HANDLED' should be defined before including 'SDL_main.h'.
@cDefine("SDL_MAIN_HANDLED", {});
@cInclude("SDL3/SDL_main.h");
});
Is there someting I need to do? Put something extra in the build.zig?
I just added this to the default zig init build file:
const sdl_dep = b.dependency("sdl", .{
.target = target,
.optimize = optimize,
});
const sdl_lib = sdl_dep.artifact("SDL3");
...
...
exe_mod.linkLibrary(sdl_lib);