Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Main monorepo for@zig-gamedev libs and example applications

License

NotificationsYou must be signed in to change notification settings

Xan5/zig-gamedev

 
 

Repository files navigation

Libraries -Getting Started -Sample applications -Others using zig-gamedev

zig-gamedev project

We build game development ecosystem forZig programming language, every day since July 2021. Please considersupporting the project. We create:

Vision

  • Very modular "toolbox of libraries", user can use only the components she needs
  • JustZig 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 aszig build
  • Libraries are written from scratch in Zigor provide Ziggified bindings for carefully selected C/C++ libraries
  • Uses native wgpu implementation (Dawn) or OpenGL for cross-platform graphics and DirectX 12 for low-level graphics on Windows

Getting Started

Download thelatest archive or clone/submodule with Git.

Note: If using Git then you will needGit LFS to be installed.

Get Zig

Ourmain branch is currenly tracking Zig0.12.0-dev.2063+804cee3b9 asnominated by the Mach engine project to maintain compatibilty for users of both projects.

zigup is recommended for managing compiler versions. Alternatively, you can download and install manually using the links below:

OS/ArchDownload link
Windows x86_64zig-windows-x86_64-0.12.0-dev.2063+804cee3b9.zip
Linux x86_64zig-linux-x86_64-0.12.0-dev.2063+804cee3b9.tar.xz
macOS x86_64zig-macos-x86_64-0.12.0-dev.2063+804cee3b9.tar.xz
macOS aarch64zig-macos-aarch64-0.12.0-dev.2063+804cee3b9.tar.xz

If you need to use a more recent version of Zig, you can try ourunstable branch. But this is not generally recommended.

Build and run theSamples

To get started on Windows/Linux/macOS try outphysically based rendering (wgpu) sample:

zig build physically_based_rendering_wgpu-run

To get a list of all available build steps:

zig build -l

Using theLibraries

Copy each library to a subdirectory in your project and add them as local package dependencies. For example:

build.zig.zon

.{    .name="MyGame",    .version="0.0.0",    .dependencies= .{        .zglfw= .{ .path="libs/zglfw" },        .system_sdk= .{ .path="libs/system-sdk" },    },    .paths="",}

build.zig

pubfnbuild(b:*std.Build)void {constexe=b.addExecutable(.{... });constzglfw=b.dependency("zglfw", .{});exe.root_module.addImport("zglfw",zglfw.module("root"));exe.linkLibrary(zglfw.artifact("glfw"));}

Refer to each lib's README.md for further usage intructions.

Option to download packages using Zig Package Managercoming soon!

Libraries

LibraryDescription
zaudioCross-platform audio usingminiaudio
zbulletBuild package,C API and bindings forBullet physics
zd3d12Helper library for DirectX 12
zflecsBuild package and bindings forflecs ECS
zglfwBuild package & bindings forGLFW
zgpuSmall helper library built on top ofDawn native WebGPU implementation
zguiBuild package and bindings forDear Imgui (includesImPlot)
zjobsGeneric job queue implementation
zmathSIMD math library for game developers
zmeshLoading, generating, processing and optimizing triangle meshes
znoiseBuild pacakge & bindings forFastNoiseLite
zopenglOpenGL loader (supports 4.2 Core Profile and ES 2.0 Profile)
zphysicsBuild package,C API and bindings forJolt Physics
zpixSupport for GPU profiling with PIX for Windows
zpoolGeneric pool & handle implementation
zsdlBindings for SDL2 and SDL3
zstbiImage reading, writing and resizing withstb libraries
ztracySupport for CPU profiling withTracy
zwin32Bindings for Win32 API (d3d12, d3d11, xaudio2, directml, wasapi and more)
zxaudio2Helper library for XAudio2

Sample applications (native wgpu)

Some of the sample applications are listed below. More can be found insamples directory.

  1. physically based rendering (wgpu): This sample implements physically-based rendering (PBR) and image-based lighting (IBL) to achive realistic looking rendering results.
    zig build physically_based_rendering_wgpu-run

    physically based rendering (wgpu)

  2. audio experiments (wgpu): This sample lets the user experiment with audio and observe data that feeds the hardware.
    zig build audio_experiments_wgpu-run

    audio experiments (wgpu)

  3. bullet physics test (wgpu): This sample application demonstrates how to use full 3D physics engine in your Zig programs.
    zig build bullet_physics_test_wgpu-run

    bullet physics test (wgpu)

  4. procedural mesh (wgpu): This sample shows how to efficiently draw several procedurally generated meshes.
    zig build procedural_mesh_wgpu-run

    procedural mesh (wgpu)

  5. gui test (wgpu): This sample shows how to use ourzgui library.
    zig build gui_test_wgpu-run

    gui test (wgpu)

Sample applications (DirectX 12)

Some of the sample applications are listed below. More can be found insamples directory. They can be built and run on Windows and Linux (Wine + VKD3D-Proton 2.8+):

  1. bindless: This sample implements physically based shading and image based lighting to achieve realistic looking rendering results. It uses bindless textures and HLSL 6.6 dynamic resources.
    zig build bindless-run

    bindless

  2. rasterization: This sample application shows how GPU rasterizes triangles in slow motion.
    zig build rasterization-run

    rasterization

  3. simple raytracer: This sample implements basic hybrid renderer. It uses rasterization to resolve primary rays and raytracing (DXR) for shadow rays.
    zig build simple_raytracer-run

    simple raytracer

  4. mesh shader test: This sample shows how to use DirectX 12 Mesh Shader.
    zig build mesh_shader_test-run

    mesh shader test

Others using zig-gamedev

  • Tides of Revival - First-person, open-world, fantasy RPG being developed in the open
  • Simulations - GPU Accelerated agent-based modeling to visualize and simulate complex systems
  • krateroid - 3D strategy game
  • blokens - Voxel game
  • Delve Framework - Simple game framework for making games with Lua
  • jok - A minimal 2D/3D game framework for Zig
  • Aftersun - Top-down 2D RPG
  • Pixi - Pixel art editor made with Zig

About

Main monorepo for@zig-gamedev libs and example applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C54.5%
  • C++29.7%
  • Objective-C10.5%
  • Zig4.3%
  • R0.7%
  • Rez0.3%

[8]ページ先頭

©2009-2025 Movatter.jp