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

Building game development ecosystem for@ziglang!

License

NotificationsYou must be signed in to change notification settings

coderonion/zig-gamedev

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Please note that the project requires latest Zig compiler (master/nightly). It can be downloadedhere.

Libraries -Sample applications -Vision -Others using zig-gamedev -Monthly reports -Roadmap

zig-gamedev project

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

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

git clone https://github.com/michal-z/zig-gamedev.gitcd zig-gamedevzig build physically_based_rendering_wgpu-run

Libraries

LibraryLatest versionDescription
zphysics0.0.5Zig API and C API forJolt Physics
zflecs0.0.1Zig bindings forflecs ECS
zopengl0.1.0OpenGL loader (supports 3.3 Core Profile and ES 2.0 Profile)
zsdl0.0.1Bindings for SDL2 (wip)
zgpu0.9.0Small helper library built on top of native wgpu implementation (Dawn)
zgui0.9.6Easy to usedear imgui bindings (includesImPlot)
zaudio0.9.3Fully-featured audio library built on top ofminiaudio
zmath0.9.6SIMD math library for game developers
zstbi0.9.3Image reading, writing and resizing withstb libraries
zmesh0.9.0Loading, generating, processing and optimizing triangle meshes
ztracy0.9.0Support for CPU profiling withTracy
zpool0.9.0Generic pool & handle implementation
zglfw0.5.2MinimalisticGLFW bindings with no translate-c dependency
znoise0.1.0Zig bindings forFastNoiseLite
zjobs0.1.0Generic job queue implementation
zbullet0.2.0Zig bindings and C API forBullet physics library
zwin320.9.0Zig bindings for Win32 API (d3d12, d3d11, xaudio2, directml, wasapi and more)
zd3d120.9.0Helper library for DirectX 12
zxaudio20.9.0Helper library for XAudio2
zpix0.9.0Support for GPU profiling with PIX for Windows

Vision

  • Very modular "toolbox of libraries", user can use only the components she needs
  • Works on Windows, macOS and Linux
  • Has zero dependency exceptZig compiler (master) andgit withGit LFS - no Visual Studio, Build Tools, Windows SDK, gcc, dev packages, system headers/libs, cmake, ninja, etc. is needed
  • Building is as easy as runningzig build (see:Building)
  • 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-platfrom graphics and DirectX 12 for low-level graphics on Windows

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 to 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 achive 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

  • Aftersun - Top-down 2D RPG
  • Pixi - Pixel art editor made with Zig
  • Simulations - GPU Accelerated agent-based modeling to visualize and simulate complex systems
  • elvengroin legacy - TBD
  • jok - A minimal 2D/3D game framework for Zig

Building sample applications

To build all sample applications (assumingzig is in the PATH andGit LFS is installed):

  1. git clone https://github.com/michal-z/zig-gamedev.git
  2. cd zig-gamedev
  3. zig build

Build artifacts will show up inzig-out/bin folder.

zig build <sample_name> will build sample application named<sample_name>.

zig build <sample_name>-run will build and run sample application named<sample_name>.

To list all available sample names runzig build --help and navigate toSteps section.

Build options

Options for Windows applications:

  • -Dzd3d12-enable-debug-layer=[bool] - Direct3D 12, Direct2D, DXGI debug layers enabled
  • -Dzd3d12-enable-gbv=[bool] - Direct3D 12 GPU-Based Validation (GBV) enabled
  • -Dzpix-enable=[bool] - PIX markers and events enabled

GitHub Sponsors

Thanks to all people who sponsor zig-gamedev project! In particular, these fine folks sponsor zig-gamedev for $25/month or more:

About

Building game development ecosystem for@ziglang!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C57.2%
  • C++28.2%
  • Objective-C10.2%
  • Zig3.4%
  • R1.0%
  • CMake0.0%

[8]ページ先頭

©2009-2025 Movatter.jp