Skip to content

silbinarywolf/sdl-zig-demo-emscripten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDL2 Zig Demo

⚠️ WARNING: This repository is not actively maintained and may not work in later Zig versions. Raise a PR if you're willing to fix it.

Here's a basic window with SDL2 in Zig.

screenshot

How to build and run it for web

zig build run -Doptimize=Debug -Dtarget=wasm32-emscripten

How to build and run it for desktop

zig build run

Cross-Compiling

Pass a -Dtarget option. For example:

zig build -Dtarget=x86_64-windows

Credits

  • Sokol Zig for having a nice Emscripten install / build setup that I was able to mostly copy for this project.
  • Raylib-Zig for giving for their Emscripten setup which is how I initially got up and running.
  • Andrew Kelley for Zig itself, their SDL demo code and everything!

About

Same as https://github.com/andrewrk/sdl-zig-demo with Emscripten support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages