Fenster Fenster /ˈfɛnstɐ/ -- a German word for "window". This library provides the most minimal and highly opinionated way to display a cross-platform 2D canvas. If you remember Borland BGI or drawing things in QBASIC or INT 10h - you know what I mean. As a nice bonus you also get cross-platform keyboard/mouse input and audio playback in only a few lines of code. What it does for you Single application window of given size with a title. Application lifecycle and system events are all handled automatically. Minimal 24-bit RGB framebuffer. Cross-platform keyboard events (keycodes). Cross-platform mouse events (X/Y + mouse click). Cross-platform timers to have a stable FPS rate. Cross-platform audio playback (WinMM, CoreAudio, ALSA). Simple polling API without a need for callbacks or multithreading (like Arduino/Processing). One C99 header of ~300LOC, easy to understand and extend. Go bindings ( import "github.com/zserge/fenster" , see godoc) , see godoc) Zig bindings (see examples/minimal-zig) Lua bindings (see https://github.com/jonasgeiler/lua-fenster) And, yes, it can run Doom! Example Here's how to draw white noise: // main.c #include "fenster.h" #define W 320 #define H 240 int main () { uint32_t buf [ W * H ]; struct fenster f = { . title = "hello" , . width = W , . height = H , . buf = buf }; fenster_open ( & f ); while ( fenster_loop ( & f ) == 0 ) { for ( int i = 0 ; i < W ; i ++ ) { for ( int j = 0 ; j < H ; j ++ ) { fenster_pixel ( & f , i , j ) = rand (); } } } fenster_close ( & f ); return 0 ; } Compile it and run: # Linux cc main.c -lX11 -lasound -o main && ./main # macOS cc main.c -framework Cocoa -framework AudioToolbox -o main && ./main # windows cc main.c -lgdi32 -lwinmm -o main.exe && main.exe That's it. API API is designed to be a polling loop, where on every iteration the framebuffer get updated and the user input (mouse/keyboard) can be polled. struct fenster { const char * title ; /* window title */ const int width ; /* window width */ const int ...
First seen: 2025-08-25 22:15
Last seen: 2025-08-26 10:17