Archived
2
20
Fork
You've already forked zeppelin
0
(Moved to https://codeberg.org/ssmid/aer) 2D graphics and window library in pure Zig
This repository has been archived on 2026年02月21日. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Zig 99.8%
  • GLSL 0.2%
2025年11月30日 02:19:17 +01:00
examples make default font global 2025年11月24日 20:17:58 +01:00
src minor 2025年11月30日 02:19:17 +01:00
build.zig - update for zig 0.16 (nightly) 2025年11月18日 17:10:33 +01:00
build.zig.zon - update for zig 0.16 (nightly) 2025年11月18日 17:10:33 +01:00
hello.jpg init 2025年04月04日 20:36:57 +02:00
LICENSE init 2025年04月04日 20:36:57 +02:00
NotoSans-Regular.ttf init 2025年04月04日 20:36:57 +02:00
README.md readme update 2025年09月19日 22:12:53 +02:00
zeppelin.jpg uncapped fps screenshot 2025年04月05日 08:09:02 +02:00

Zeppelin

Zeppelin is a cross-platform 2D graphics and window library in pure zig*. It features:

  • Vulkan-based vector graphics
  • window handling
  • input handling (including an xkb parser on wayland!)
  • built-in text rendering using either Andrew's TrueType or harfbuzz
  • clipboard support

While zeppelin was written to enable pure-Zig GUI development, it is also suitable for:

  • 2D games
  • 2D off-screen rendering
  • as a convenient but very incomplete Vulkan abstraction layer

Zeppelin tries to be as self-contained as possible to keep complexity low and to prepare for a future free from C and C++. Therefore, it does not have any hard dependency on C/C++ libraries besides libc. No sdl, glfw, libwayland, libxkbcommon, or freetype. At the same time, this is also the reason why zeppelin can't just give you an OpenGL or Vulkan graphics context, as both EGL and Vulkan depend on libwayland.

Currently, Linux (Wayland) and Windows are supported. Android support is planned. MacOS/iOS support is not planned at the moment but contributions in that direction are welcome!

Zeppelin is in an alpha stage but with a decent feature set. API will change.


*Libc is currently required to load a vulkan driver; optionally depends on harfbuzz for non-latin text shaping.


Try the nanovg demo in zeppelin:

git clone https://codeberg.org/ssmid/zeppelin
cd zeppelin
zig build demo

nanovg-demo

Example

Drawing a triangle:

pubfnmain()!void{varcontext=tryzeppelin.Zeppelin.create("hello",1,false,allocator);defercontext.destroy();constrenderer=trycontext.createWindowRenderer(800,600,"Hello",null,null);deferrenderer.destroy();constwindow=renderer.getWindow();outer:while(true){constevents=trywindow.getEvents();for(events)|*event|{switch(event.*){.window_close=>break:outer,else=>{},}}constready=tryrenderer.nextFrame();if(!ready)continue;tryrenderer.moveTo(400,100);tryrenderer.lineTo(600,400);tryrenderer.lineTo(200,400);tryrenderer.close();tryrenderer.fill(&zeppelin.color(255,0,0,255),null);tryrenderer.text("Hello, triangle!",400,450,.{.horizontal=.center},null,48);tryrenderer.fill(&zeppelin.color(230,230,230,255),null);_=tryrenderer.render();}}

hello-triangle

See the full example at https://codeberg.org/ssmid/zeppelin/src/branch/main/examples/hello.zig

Usage

Just like any other zig library:

zig fetch --save https://codeberg.org/ssmid/zeppelin/archive/0.3.0.tar.gz

Releases will always target the latest zig version. If you target zig nightly builds, please try the main branch. https://codeberg.org/ssmid/zeppelin/archive/{commit-or-tag}.tar.gz

Documentation: https://ssmid.de/zeppelin/doc/

Roadmap

  • clipboard
  • DPI scaling
  • simple software renderer (as fallback)
  • drag and drop
  • touch input
  • android support
    • packager
    • api integration
    • soft keyboard / input method support
  • better anti-aliasing

Contributing

Build some cool stuff and show it to me!

Bug reports, feature requests, and pull requests are welcome as well, just make sure to check with me before you start any serious effort.