RGFW: Single-header C99 window abstraction library

157 points107 comments7 months ago
eqvinox

Every time I see a "single-header C library", I wonder to myself where we'd be if only Windows had a proper package manager.

(Especially since that'd force the POSIX world to de-fracture itself too.)

show comments
eska

Not sure whether this is tested on Windows at all. I opened the header and immediately found this `typedef signed long i64`, i.e. i64 is actually i32.

show comments
garbagepatch

This was added to raylib as a backend recently: https://github.com/raysan5/raylib/releases#:~:text=RGFW

show comments
felipefar

You could support mobile platforms as well. IIRC, even if Android allows creating only one window per activity, this behavior can be easily mapped on the abstraction that you provide.

show comments
CyberDildonics

I love single header libraries and I like the idea here of taking care of one necessity well. It seems like good modularity all around.

A quick heads up, the micro UI emscripten example doesn't work on chrome or firefox. The error is: DrawElements doesn't actually prepareClientAttributes properly.

show comments
colleagueRiley

Thanks :)

uecker

I like simple code written in C, but when does this "single-header" nonsense stop? C has super nice and simple modularization via the classical .h/.c split which ensures fast compilation, proper encapsulation, no instruction bloat via creating multiple instances for all functions.

show comments
dmitrygr

> Wayland support is very experimental and broken

You and everyone else, RGFW, you and everyone else.

show comments