# Is there a Zig library for creating a framebuffer and window (sort of like minifb for Rust)?

**URL:** <https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979>\
**Category:** Help\
**Tags:** game\
**Created:** [January 19, 2025, 12:03am UTC](https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979 "2025-01-19T00:03:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![code](https://ziggit.dev/user_avatar/ziggit.dev/code/32/3373_2.png) [@code](https://ziggit.dev/u/code)\
**Post date:** [January 19, 2025, 12:03am UTC](https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979/1 "2025-01-19T00:03:44Z")

</div>

I’m writing a small graphics library for a game I’m going to program in zig. I would like to know if there is any zig library that allows you to draw pixels directly to a frame buffer, sort of like the `minifb` or `pixels` library for Rust?

Alternatively, if there is a stable C library for this I’m open to using this too - although I still haven’t fully wrapped my head around zig’s crazy build system so might need some help setting it up!

Thanks!

---

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [January 19, 2025, 12:33am UTC](https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979/2 "2025-01-19T00:33:02Z")

</div>

Check out [Seizer: Wayland application framework](https://ziggit.dev/t/seizer-wayland-application-framework/6788)

---

<div class="post-metadata">

**Author:** ![pachde](https://ziggit.dev/user_avatar/ziggit.dev/pachde/32/2485_2.png) [@pachde](https://ziggit.dev/u/pachde)\
**Post date:** [January 19, 2025, 1:13am UTC](https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979/3 "2025-01-19T01:13:25Z")

</div>

Look to be basically Linux only, but guessing that’s ok for the OP;-)

---

<div class="post-metadata">

**Author:** ![code](https://ziggit.dev/user_avatar/ziggit.dev/code/32/3373_2.png) [@code](https://ziggit.dev/u/code)\
**Post date:** [January 19, 2025, 10:51am UTC](https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979/4 "2025-01-19T10:51:35Z")

</div>

Thank you, I’ll check it out!

---

<div class="post-metadata">

**Author:** ![code](https://ziggit.dev/user_avatar/ziggit.dev/code/32/3373_2.png) [@code](https://ziggit.dev/u/code)\
**Post date:** [January 19, 2025, 10:53am UTC](https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979/5 "2025-01-19T10:53:02Z")

</div>

Yes, for me wayland / linux is fine, although I may port to another library later for windows/macos support if I find a library that can do that (or write my own). This looks great for now!

---

<div class="post-metadata">

**Author:** ![floooh](https://ziggit.dev/user_avatar/ziggit.dev/floooh/32/2989_2.png) [@floooh](https://ziggit.dev/u/floooh)\
**Post date:** [January 19, 2025, 3:51pm UTC](https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979/6 "2025-01-19T15:51:04Z")

</div>

(shameless plug): Not “window + framebuffer”, but “window + 3d API”: [GitHub - floooh/sokol-zig: Zig bindings for the sokol headers (https://github.com/floooh/sokol)](https://github.com/floooh/sokol-zig) (it’s not Zig all the way down, but Zig bindings to underlying C libraries, but the bindings feel quite ‘ziggy’)

For a pixel framebuffer you would copy the pixels from a CPU memory region into a texture and render that texture via the 3D API (I’m actually pondering wrapping exactly this functionality in a new sokol library, but don’t hold your breath)

---

<div class="post-metadata">

**Author:** ![code](https://ziggit.dev/user_avatar/ziggit.dev/code/32/3373_2.png) [@code](https://ziggit.dev/u/code)\
**Post date:** [February 8, 2025, 12:44pm UTC](https://ziggit.dev/t/is-there-a-zig-library-for-creating-a-framebuffer-and-window-sort-of-like-minifb-for-rust/7979/7 "2025-02-08T12:44:52Z")

</div>

Your library looks great! I think for now, I’m going to use the C library of minifb as it has worked quite well for me in the past. When I upgrade my library though, I’ll definitely consider using sokol!
