Ziggified GLFW bindings with 100% API coverage, zero-fuss installation, cross compilation, and more.

mach/glfw - Ziggified GLFW bindings CI Hexops logo

Ziggified GLFW bindings that Mach engine uses, with 100% API coverage, zero-fuss installation, cross compilation, and more.

The main Mach repository includes this one as a git subtree. This is a separate repo so that anyone can use this library in their own project / engine if they like!

Zero fuss installation, cross compilation, and more

Just as with Mach, you get zero fuss installation & cross compilation using these GLFW bindings. only zig and git are needed to build from any OS and produce binaries for every OS. No system dependencies at all.

See also: platform support table

100% API coverage

These bindings recently achieved 100% API coverage of GLFW v3.3.4. Every function, type, etc. has been wrapped in a ziggified API.

What does a ziggified GLFW API offer?

You could just @cImport GLFW with Zig - the main reasons to use a ziggified wrapper though are because you get:

  • true and false booleans instead of c.GLFW_TRUE and c.GLFW_FALSE integers
  • Methods, so you can write e.g. window.hint instead of glfwWindowHint
  • Generics, so you can just use window.hint instead of glfwWindowHint, glfwWindowHintString, etc.
  • Enums, so you can write window.getKey(.escape) instead of c.glfwGetKey(window, c.GLFW_KEY_ESCAPE)
  • Slices instead of C pointers and lengths.
  • packed struct to represent bit masks, so you can interact with each bit the same way you'd interact with a bool if you like, instead of remembering the & | ^ incantation (although you're free to do that too.)

How do I use OpenGL, Vulkan, WebGPU, etc. with this?

You'll need to bring your own library for this. Some are:

Issues

Issues are tracked in the main Mach repository.

Contributing

Contributions are very welcome. Just send a PR to this repository.

We track the latest stable release of GLFW, if you need a newer version we can start a development branch / figure that out - just open an issue.

Once your PR is merged, if you're using Mach engine and wanting the changes there, it will be sync'd to the main repo via git subtree.

Owner
Hexops
Experiment everywhere
Hexops
Similar Resources

A Minimal Web Browser with Built-in Adblocker in Less Than 100 Lines of Code

A Minimal Web Browser with Built-in Adblocker in Less Than 100 Lines of Code

A Minimal QtWebEngine Web Browser with Adblocker How Does It Work This is a minimal network filter implementation using QWebEngineUrlRequestIntercepto

Jul 23, 2022

TulipCell is an Excel add-in providing 100+ technical analysis indicators.

Tulip Cell Introduction Tulip Cell is an Excel add-in that provides the technical analysis functions from the Tulip Indicators library. Building Build

Sep 14, 2022

This is a compilation of the code and images for all Arduino code in the Robotics 11 class.

This is a compilation of the code and images for all Arduino code in the Robotics 11 class.

Robotics 11 - Arduino This is a compilation of the code and images for all Arduino code in the Robotics 11 class. All code can be viewed in each proje

Oct 29, 2021

A collection of tools, libraries, and tests for Vulkan shader compilation.

Shaderc A collection of tools, libraries and tests for shader compilation. At the moment it includes: glslc, a command line compiler for GLSL/HLSL to

Sep 21, 2022

This is the source code for Mirai. The compilation method has been simplified a little and some modifications have been made.

Mirai BotNet to Tashiro(未来砲) Leaked Linux.Mirai Source Code for Research/IoT Development Purposes Uploaded for research purposes and so we can develop

Jul 30, 2022

Several GX2 test programs to compare it with OpenGL. (With additional GLFW+OpenGL implementation provided)

GX2-Tests Provided are GX2 test programs and samples for comparison with OpenGL and with additional GLFW+OpenGL implementation for test on PC. These s

Nov 15, 2021

My own recreation of the MiniLibX library used by 42, using glfw & glad.

MLX42 Project still WIP! My own recreation of the MiniLibX library used by 42, using glfw & glad, running on OpenGL 3.3. The goal of MLX42 is to repla

Sep 8, 2022

Fluid Visualization - The code compilation is only tested on Arch Linux x86_64

Fluid Visualization The code compilation is only tested on Arch Linux x86_64, Linux kernel 5.15.13-arch1, with gcc 11.1.0, CMake 3.22.1, Xorg X server

Jan 30, 2022

Upgraded from Pixar postcard path tracing, instead of printing Pixar, this program print my name, which pose to be more challenging than the original code. The upgraded is also more readable and run 9x faster than the original source code.

Upgraded from Pixar postcard path tracing, instead of printing Pixar, this program print my name, which pose to be more challenging than the original code. The upgraded is also more readable and run 9x faster than the original source code.

SDF-Sphere-Tracing Upgraded from Pixar postcard path tracing, instead of printing Pixar, this program print my name, which pose to be more challenging

Aug 29, 2022
Comments
  • Fix code example

    Fix code example

    • [X] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

    Fixed a small typo in the readme example.

"Zero setup" cross-compilation for a wide variety of architectures.

"Zero setup" cross-compilation for a wide variety of architectures. xcross includes compact docker images and a build utility for minimal setup C/C++ cross-compiling, inspired by rust-embedded/cross

Aug 19, 2022
PikaScript is an ultra-lightweight Python engine with zero dependencies and zero-configuration, that can run with 4KB of RAM (such as STM32G030C8 and STM32F103C8), and is very easy to deploy and expand.
PikaScript is an ultra-lightweight Python engine with zero dependencies and zero-configuration, that can run with 4KB of RAM (such as STM32G030C8 and STM32F103C8), and is very easy to deploy and expand.

PikaScript 中文页| Star please~ 1. Abstract PikaScript is an ultra-lightweight Python engine with zero dependencies and zero-configuration, that can run

Sep 23, 2022
oZKS (Ordered Zero-Knowledge Set) is a library that provides an implementation of an Ordered (and Append Only) Zero-Knowledge Set.

Ordered Zero-Knowledge Set - oZKS Introduction oZKS is a library that provides an implementation of an Ordered (and Append Only) Zero Knowledge Set. A

Aug 31, 2022
Embed read-only filesystems into any C++11 program w. a single header, zero dependencies and zero modifications to your code

c-embed Embed read-only filesystems into any C++11 program w. a single header, zero dependencies and zero modifications to your code. Usage c-embed al

Sep 18, 2022
Rewritten version of the MiniLibX graphics API used by 42, using glfw & glad. Running on OpenGL.
Rewritten version of the MiniLibX graphics API used by 42, using glfw & glad. Running on OpenGL.

Written by W2.Wizard for the 42 Network A recreation of the MiniLibX library used by 42, using GLFW & glad, running on OpenGL. The goal of MLX42 is to

Sep 21, 2022
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation

A cross platform shader language with multi-threaded offline compilation or platform shader source code generation. Output json reflection info and c++ header with your shaders structs, fx-like techniques and compile time branch evaluation via (uber-shader) "permutations".

Aug 21, 2022
A utility to automate the installation, maintenance, and debugging of Asterisk/DAHDI, while integrating additional patches to provide the richest telephony experience

PhreakScript A utility to automate the installation, maintenance, and debugging of Asterisk/DAHDI, while integrating additional patches to provide the

Sep 18, 2022
This repository provides you the material of installation the Catalana Hackintosh

VivoBook Asus X542UQ laptop Catalina 10.15.7 Hackintosh This repository provides you the material of installation the Catalana Hackintosh with Opencor

Oct 9, 2021
A graphical application to enhance user experience with Ubuntu on WSL during the distro installation process.

Ubuntu WSL Splash TODO: Place a CI badge here. TODO: Put a nice screenshot here when we get one. A graphical application to enhance user experience wi

Jul 26, 2022
keyball is split keyboard has 100% track ball

keyball Keyball is split keyboard has 100% track ball Firmware build guide Keyball46 have separate firmwares for each of PCBs w/ trackball and w/o tra

Sep 17, 2022