Skip to content

Migrate all the libs #668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@
*.so filter=lfs diff=lfs merge=lfs -text
*.a filter=lfs diff=lfs merge=lfs -text
*.dds filter=lfs diff=lfs merge=lfs -text
libs/zwindows/bin/x64/dxc filter=lfs diff=lfs merge=lfs -text
libs/zwindows/bin/x64/libdxcompiler.so.3.7 filter=lfs diff=lfs merge=lfs -text
.lfs-content-token filter=lfs diff=lfs merge=lfs -text
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
Expand Down
26 changes: 21 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,27 @@
!.vimrc
!.gitkeep

!/libs/system-sdk/**
!/libs/zgpu/libs/**
!/libs/zsdl/libs/**
!/libs/zopenvr/libs/**
!/libs/zwindows/bin/x64/*
!/libs/system_sdk
!/libs/zaudio
!/libs/zbullet
!/libs/zemscripten
!/libs/zflecs
!/libs/zglfw
!/libs/zgpu
!/libs/zgui
!/libs/zjobs
!/libs/zmath
!/libs/zmesh
!/libs/znoise
!/libs/zopengl
!/libs/zopenvr
!/libs/zphysics
!/libs/zpix
!/libs/zpool
!/libs/zsdl
!/libs/zstbi
!/libs/ztracy
!/libs/zwindows

# Ignore some special directories
*zig-cache
Expand Down
63 changes: 63 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[submodule "libs/zaudio"]
path = libs/zaudio
url = git@github.com:zig-gamedev/zaudio.git
[submodule "libs/zbullet"]
path = libs/zbullet
url = git@github.com:zig-gamedev/zbullet.git
[submodule "libs/zflecs"]
path = libs/zflecs
url = git@github.com:zig-gamedev/zflecs.git
[submodule "libs/zemscripten"]
path = libs/zemscripten
url = git@github.com:zig-gamedev/zemscripten.git
[submodule "libs/zglfw"]
path = libs/zglfw
url = git@github.com:zig-gamedev/zglfw.git
[submodule "libs/zgpu"]
path = libs/zgpu
url = git@github.com:zig-gamedev/zgpu.git
[submodule "libs/zgui"]
path = libs/zgui
url = git@github.com:zig-gamedev/zgui.git
[submodule "libs/zjobs"]
path = libs/zjobs
url = git@github.com:zig-gamedev/zjobs.git
[submodule "libs/zmath"]
path = libs/zmath
url = git@github.com:zig-gamedev/zmath.git
[submodule "libs/zmesh"]
path = libs/zmesh
url = git@github.com:zig-gamedev/zmesh.git
[submodule "libs/znoise"]
path = libs/znoise
url = git@github.com:zig-gamedev/znoise.git
[submodule "libs/zopengl"]
path = libs/zopengl
url = git@github.com:zig-gamedev/zopengl.git
[submodule "libs/zopenvr"]
path = libs/zopenvr
url = git@github.com:zig-gamedev/zopenvr.git
[submodule "libs/zphysics"]
path = libs/zphysics
url = git@github.com:zig-gamedev/zphysics.git
[submodule "libs/zpix"]
path = libs/zpix
url = git@github.com:zig-gamedev/zpix.git
[submodule "libs/zpool"]
path = libs/zpool
url = git@github.com:zig-gamedev/zpool.git
[submodule "libs/zsdl"]
path = libs/zsdl
url = git@github.com:zig-gamedev/zsdl.git
[submodule "libs/zstbi"]
path = libs/zstbi
url = git@github.com:zig-gamedev/zstbi.git
[submodule "libs/ztracy"]
path = libs/ztracy
url = git@github.com:zig-gamedev/ztracy.git
[submodule "libs/zwindows"]
path = libs/zwindows
url = git@github.com:zig-gamedev/zwindows.git
[submodule "libs/system_sdk"]
path = libs/system_sdk
url = git@github.com:zig-gamedev/system_sdk.git
2 changes: 1 addition & 1 deletion .ignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
*.hiplc
.gitkeep
/libs/zgpu/libs/mach-gpu-dawn/libs/*
/libs/system-sdk/*
/libs/system_sdk/*
78 changes: 3 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,10 @@
[Libraries](#libraries) - [Getting Started](#getting-started) - [Sample applications](#sample-applications-native-wgpu) - [Others using zig-gamedev](#others-using-zig-gamedev)

# [zig-gamedev](https://github.com/zig-gamedev) dev repo

We build game development ecosystem for [Zig programming language](https://ziglang.org/), every day since July 2021. Please consider [supporting the project](https://github.com/sponsors/hazeycode). We create:

* Cross-platform and composable [libraries](#libraries)
* Cross-platform [sample applications](#sample-applications-native-wgpu)
* DirectX 12 [sample applications](#sample-applications-directx-12)

### Vision
* Very modular "toolbox of libraries", user can use only the components she needs
* Just [Zig](https://ziglang.org) is required to build on Windows, macOS and Linux - no Visual Studio, Build Tools, Windows SDK, gcc, dev packages, system headers/libs, cmake, ninja, etc. is needed
* Building is as easy as `zig build`
* Libraries are written from scratch in Zig *or* provide Ziggified bindings for carefully selected C/C++ libraries
* Uses native wgpu implementation ([Dawn](https://github.com/michal-z/dawn-bin)) or OpenGL for cross-platform graphics and DirectX 12 for low-level graphics on Windows

The original repo spawned in July 2021 by [Michal Ziulek](https://github.com/michal-z). This is the main development repo for the [zig-gamedev libraries](https://github.com/zig-gamedev#libraries) and [sample applications](#sample-applications-native-wgpu).

## Getting Started
Zig is still in development. This repo aims to track zig nightly.

Download the [latest archive](https://github.com/zig-gamedev/zig-gamedev/archive/refs/heads/main.zip) or clone/submodule with Git.

Note: If using Git then you will need [Git LFS](https://git-lfs.github.com/) to be installed.

### Get Zig

Our [main](https://github.com/zig-gamedev/zig-gamedev/tree/main) branch is currenly tracking Zig **0.14.0-dev.1911+8ee52f99c**. Or you can use the **unstable** [zig-0.14.0 branch](https://github.com/zig-gamedev/zig-gamedev/tree/zig-0.14.0) for newer versions.

[zigup](https://github.com/marler8997/zigup) is recommended for managing compiler versions. To switch to the compiler version after branch checkout:
```sh
zigup $(< .zigversion)
```

Alternatively, you can download and install manually using the links below:

| OS/Arch | Download link |
| --------------- | --------------------------- |
| Windows x86_64 | [zig-windows-x86_64-0.14.0-dev.1911+8ee52f99c.zip](https://pkg.machengine.org/zig/zig-windows-x86_64-0.14.0-dev.1911+8ee52f99c.zip) |
| Linux x86_64 | [zig-linux-x86_64-0.14.0-dev.1911+8ee52f99c.tar.xz](https://pkg.machengine.org/zig/zig-linux-x86_64-0.14.0-dev.1911+8ee52f99c.tar.xz) |
| macOS x86_64 | [zig-macos-x86_64-0.14.0-dev.1911+8ee52f99c.tar.xz](https://pkg.machengine.org/zig/zig-macos-x86_64-0.14.0-dev.1911+8ee52f99c.tar.xz) |
| macOS aarch64 | [zig-macos-aarch64-0.14.0-dev.1911+8ee52f99c.tar.xz](https://pkg.machengine.org/zig/zig-macos-aarch64-0.14.0-dev.1911+8ee52f99c.tar.xz) |
Libraries now live in their own repositories and are included in this repo as git submodules for developer convenience.

### Build and run the [Samples](#sample-applications-native-wgpu)

Expand All @@ -52,32 +18,6 @@ To get a list of all available build steps:
zig build -l
```

## Libraries
Note: Libs are being migrated from [libs/](libs/) folder in this repo to each their own repository under the [zig-gamedev GitHub organisation](https://github.com/zig-gamedev). See [migration tracking PR](https://github.com/zig-gamedev/zig-gamedev/pull/668).

| Library | Description |
|-------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| **[zaudio](libs/zaudio)** | Cross-platform audio using [miniaudio](https://github.com/mackron/miniaudio) |
| **[zbullet](libs/zbullet)** | Build package, [C API](https://github.com/zig-gamedev/zig-gamedev/tree/main/libs/zbullet/libs/cbullet) and bindings for [Bullet physics](https://github.com/bulletphysics/bullet3) |
| **[zflecs](libs/zflecs)** | Build package and bindings for [flecs](https://github.com/SanderMertens/flecs) ECS |
| **[zemscripten](libs/zemscripten)** | Build package and shims for [Emscripten](https://emscripten.org) emsdk |
| **[zglfw](libs/zglfw)** | Build package & bindings for [GLFW](https://github.com/glfw/glfw) |
| **[zgpu](libs/zgpu)** | Small helper library built on top of [Dawn](https://github.com/zig-gamedev/dawn) native WebGPU implementation |
| **[zgui](libs/zgui)** | Build package and bindings for [Dear Imgui](https://github.com/ocornut/imgui), [Test engine](https://github.com/ocornut/imgui_test_engine), [ImPlot](https://github.com/epezent/implot), [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) and [imgui-node-editor](https://github.com/thedmd/imgui-node-editor) |
| **[zjobs](libs/zjobs)** | Generic job queue implementation |
| **[zmath](libs/zmath)** | SIMD math library for game developers |
| **[zmesh](libs/zmesh)** | Loading, generating, processing and optimizing triangle meshes |
| **[znoise](libs/znoise)** | Build package & bindings for [FastNoiseLite](https://github.com/Auburn/FastNoiseLite) |
| **[zopengl](libs/zopengl)** | OpenGL loader (supports 4.2 Core Profile and ES 2.0 Profile) |
| **[zopenvr](libs/zopenvr)** | Bindings for [OpenVR](https://github.com/ValveSoftware/openvr) |
| **[zphysics](libs/zphysics)** | Build package, [C API](libs/zphysics/libs/JoltC) and bindings for [Jolt Physics](https://github.com/jrouwe/JoltPhysics) |
| **[zpix](libs/zpix)** | Support for GPU profiling with PIX for Windows |
| **[zpool](libs/zpool)** | Generic pool & handle implementation |
| **[zsdl](libs/zsdl)** | Bindings for SDL2 and SDL3 |
| **[zstbi](libs/zstbi)** | Image reading, writing and resizing with [stb](https://github.com/nothings/stb) libraries |
| **[ztracy](libs/ztracy)** | Support for CPU profiling with [Tracy](https://github.com/wolfpld/tracy) |
| **[zwindows](libs/zwindows)** | Windows development SDK for Zig game developers |

## Sample applications (native wgpu)

Some of the sample applications are listed below. More can be found in [samples](samples/) directory.
Expand Down Expand Up @@ -121,15 +61,3 @@ Some of the sample applications are listed below. More can be found in [samples]
1. [mesh shader test](samples/mesh_shader_test): This sample shows how to use DirectX 12 Mesh Shader.<br />`zig build mesh_shader_test-run`

<a href="samples/mesh_shader_test"><img src="samples/mesh_shader_test/screenshot.png" alt="mesh shader test" height="200"></a>


## Others using zig-gamedev

* [Tides of Revival](https://github.com/Srekel/tides-of-revival) - First-person, open-world, fantasy RPG being developed in the open
* [Markets](https://github.com/ckrowland/markets) - Visually simulate markets of basic consumers and producers
* [krateroid](https://github.com/kussakaa/krateroid) - 3D strategy game
* [blokens](https://github.com/btipling/blockens) - Voxel game
* [Delve Framework](https://github.com/Interrupt/delve-framework) - Simple game framework for making games with Lua
* [jok](https://github.com/jack-ji/jok) - A minimal 2D/3D game framework for Zig
* [Aftersun](https://github.com/foxnne/aftersun) - Top-down 2D RPG
* [Pixi](https://github.com/foxnne/pixi) - Pixel art editor made with Zig
122 changes: 101 additions & 21 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,44 @@
"LICENSE",
},
.dependencies = .{
.system_sdk = .{ .path = "libs/system-sdk" },
.zaudio = .{ .path = "libs/zaudio" },
.zbullet = .{ .path = "libs/zbullet" },
.zflecs = .{ .path = "libs/zflecs" },
.zglfw = .{ .path = "libs/zglfw" },
.zgui = .{ .path = "libs/zgui" },
.zjobs = .{ .path = "libs/zjobs" },
.zmath = .{ .path = "libs/zmath" },
.zmesh = .{ .path = "libs/zmesh" },
.znoise = .{ .path = "libs/znoise" },
.zopengl = .{ .path = "libs/zopengl" },
.zopenvr = .{ .path = "libs/zopenvr" },
.zphysics = .{ .path = "libs/zphysics" },
.zpix = .{ .path = "libs/zpix" },
.zpool = .{ .path = "libs/zpool" },
.zstbi = .{ .path = "libs/zstbi" },
.ztracy = .{ .path = "libs/ztracy" },
.zwindows = .{ .path = "libs/zwindows" },
.system_sdk = .{
.url = "https://github.com/zig-gamedev/system_sdk/archive/bf49d627a191e339f70e72668c8333717fb969b0.tar.gz",
.hash = "122047a9298c4c9dd43389d418d6826d469b192246ba0944102964cdc57f94c562df",
},

.zaudio = .{
.url = "https://github.com/zig-gamedev/zaudio/archive/7c8a86c1b7a44b906e5de5f3ee18cdd0b8de018b.tar.gz",
.hash = "1220423c756c4d6f58d9465a597c2b9f982d929a56fa5ceab4b7626d0ea2685bcd6c",
},

.zbullet = .{
.url = "https://github.com/zig-gamedev/zbullet/archive/80ca865c4d1de4805e012576f796de034564d553.tar.gz",
.hash = "1220b67a8c68334fb1c0dc13cbc1b72777a5abb81640a9639f58017e520a48deb325",
},

.zflecs = .{
.url = "https://github.com/zig-gamedev/zflecs/archive/db76fc7177377bb3f9eadb860ee3f07f4641004f.tar.gz",
.hash = "12201bcd78d8301929e3f1a029c6f418340b4f540b885c685fde51e4b34ead27a4a5",
},

.zemscripten = .{
.url = "https://github.com/zig-gamedev/zemscripten/archive/06d3040173ecf329373cfbc1396be95c35894475.tar.gz",
.hash = "122032fe722a72ad86286c32654d75e4253a9023ddd45c8a93b34be5e1cbd09d61d1",
},
.emsdk = .{
.url = "https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.52.tar.gz",
.hash = "12202192726bf983ec243c7eea956d6107baf6f49d50b62f6a91f5d7471bc6daf53b",
},
.zemscripten = .{ .path = "libs/zemscripten" },

.zgpu = .{ .path = "libs/zgpu" },
.zglfw = .{
.url = "https://github.com/zig-gamedev/zglfw/archive/d18b30438d630d44e50aa30e2300a96c4f4ff67d.tar.gz",
.hash = "1220074231fcf6556b27e0ac6a3b22a19062c0c4bc3fd77c6fdcede15303af824c27",
},

.zgpu = .{
.url = "https://github.com/zig-gamedev/zgpu/archive/44061500651ea5ef6d708527fe322e2e69e2e631.tar.gz",
.hash = "1220af0752814ec0a3438aa3ca3e33661885ec134c5e7b794247381b0fbe90c21012",
},
.dawn_x86_64_windows_gnu = .{
.url = "https://github.com/michal-z/webgpu_dawn-x86_64-windows-gnu/archive/d3a68014e6b6b53fd330a0ccba99e4dcfffddae5.tar.gz",
.hash = "1220f9448cde02ef3cd51bde2e0850d4489daa0541571d748154e89c6eb46c76a267",
Expand All @@ -64,7 +76,60 @@
.lazy = true,
},

.zsdl = .{ .path = "libs/zsdl" },
.zgui = .{
.url = "https://github.com/zig-gamedev/zgui/archive/d23ed60a659d8c9c6d664b2e9bd78fae1675154e.tar.gz",
.hash = "1220ffffdf1d0d2aca86a1ea31ba17ee48090b38cefb2a8487d2d801eb1fdd78becb",
},

.zjobs = .{
.url = "https://github.com/zig-gamedev/zjobs/archive/9a8a42e1de4b37d223cb5f44bc266c961e868cc8.tar.gz",
.hash = "12203322a6cbf36b797c78833fae7391b736f3808ee59d7ce092981d02bbde941a07",
},

.zmath = .{
.url = "https://github.com/zig-gamedev/zmath/archive/fb075f0f2f90d6d938a5959a3a79700cdec155c2.tar.gz",
.hash = "1220081d55b58b968d953db1afc2fb01b2f5733929144e69522461ce25fa6450d84e",
},

.zmesh = .{
.url = "https://github.com/zig-gamedev/zmesh/archive/c3e96a6858714290384ce33a99a3a2baa851acca.tar.gz",
.hash = "1220f914e117966d9d2fc5aca141859a3ebf94b4f1c36b881f201958699568a75f70",
},

.znoise = .{
.url = "https://github.com/zig-gamedev/znoise/archive/e53e144e41dcd3f7a1c2986715addb973b8baf55.tar.gz",
.hash = "12208e16c80366e2a2f8bd3f1c676b09bf47c157f4d0f0d6440555f9b74d8a9d79f7",
},

.zopengl = .{
.url = "https://github.com/zig-gamedev/zopengl/archive/14e69429d004013d806076317a350d43a27f036f.tar.gz",
.hash = "12203720546b5ed015b90f788d57d41ef86b09595f9450ee67ce8aca43dac00ed8a1",
},

.zopenvr = .{
.url = "https://github.com/zig-gamedev/zopenvr/archive/d25bb7c2f14702194d91a519bf8cbe6a12456d92.tar.gz",
.hash = "12203870e1bb1971e4d2e1c64f437485f918d5c384ca0c25d15089b9b7d035a2bced",
},

.zphysics = .{
.url = "https://github.com/zig-gamedev/zphysics/archive/05e39c0d32bf0b9cea8fc05907176a5175df39c4.tar.gz",
.hash = "12206d54e74d842a149aae4c0123a1fd5950d0cb6eece826a55d3df46bfee8d2e28f",
},

.zpix = .{
.url = "https://github.com/zig-gamedev/zpix/archive/c1ae879173a8dff7d9ac55f8d3cdde7edc3ccb08.tar.gz",
.hash = "12208392e8408979936c9ae229ef49a68128d00744b4081d740beff79a65b914b9cf",
},

.zpool = .{
.url = "https://github.com/zig-gamedev/zpool/archive/b3d91a939f6738b7beec41d9fada07bc9cc01eaf.tar.gz",
.hash = "1220e600a92d73dc8c3b5303351dcc67352114c975e59ae55de11b637ec173e75455",
},

.zsdl = .{
.url = "https://github.com/zig-gamedev/zsdl/archive/87245f0c4173bc07e39e1b464bda2fe89ad2ba81.tar.gz",
.hash = "1220f3189435fc5abab1ad22bd317f90384c82fb8d4a7acf82535f89823e1c6d66b3",
},
.@"sdl2-prebuilt-macos" = .{
.url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/f14773fa3de719b3a399b854c31eb4139d63842f.tar.gz",
.hash = "12205cb2da6fb4a7fcf28b9cd27b60aaf12f4d4a55be0260b1ae36eaf93ca5a99f03",
Expand All @@ -80,5 +145,20 @@
.hash = "12200ecb91c0596d0356ff39d573af83abcd44fecb27943589f11c2cd172763fea39",
.lazy = true,
},

.zstbi = .{
.url = "https://github.com/zig-gamedev/zstbi/archive/3f3f6b21e369666f089a4a328986ad7d0414fb11.tar.gz",
.hash = "122009ea2ff8496071dbe447731a62e6c7c731b6aca5ac3a01992a8d3330d4482a88",
},

.ztracy = .{
.url = "https://github.com/zig-gamedev/ztracy/archive/4990324a1a724b59b8a561e521ab944e99ac6c28.tar.gz",
.hash = "122058b9caf1299bcb723b8567999154b18d82e0e896471e10ef56b0e60c6dda59c2",
},

.zwindows = .{
.url = "https://github.com/zig-gamedev/zwindows/archive/511794cb06f5f2b7a2be8346e7312f54d0adb820.tar.gz",
.hash = "12204948283efd34140a20dfdc36b2bcd57fc1d52e18d37ca7d5ef7077142d768d02",
},
},
}
22 changes: 0 additions & 22 deletions libs/system-sdk/LICENSE

This file was deleted.

Loading
Loading