Skip to content

matthewjberger/wgpu-example-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig / SDL2 / WGPU Triangle

A cross-platform Zig graphics demo using wgpu-native to render a spinning triangle.

Related Projects:

Prerequisites

  • Zig 0.15+
  • just - Command runner
  • PowerShell (Windows)

Quickstart

# Download and setup dependencies (wgpu-native, SDL2, zalgebra)
just setup

# Build and run
just run
image

Commands

Command Description
just setup Download wgpu-native, SDL2, and fetch Zig dependencies
just build Build the triangle executable
just build-release Build with release optimizations
just run Build and run the triangle
just run-release Build and run with release optimizations
just clean Remove build artifacts

Project Structure

wgpu-example-zig/
├── src/
│   └── main.zig        # Main source file
├── build.zig           # Zig build configuration
├── build.zig.zon       # Zig package dependencies
├── justfile            # Build commands
├── README.md           # This file
├── include/            # Headers (created by setup)
│   ├── webgpu/         # wgpu-native headers
│   └── SDL2/           # SDL2 headers
├── lib/                # Libraries (created by setup)
├── SDL2.dll            # SDL2 runtime (created by setup)
└── wgpu_native.dll     # wgpu-native runtime (created by setup)

Dependencies

  • wgpu-native - Native WebGPU implementation
  • SDL2 - Cross-platform windowing and input
  • zalgebra - Linear algebra library for Zig

Controls

  • ESC - Quit the application
  • Window can be resized

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages