News for hackers. Stuff that matters.
Re:RGFW: Single-header C99 window abstraction library by amjoshuamichael on Friday November 22, 2024 @09:43PM (#42218836)
Yeah, I've been looking for a minimal SDL alternative for a long time and I was really excited reading through this as that solution, but the lack of Wayland support is a huge dealbreaker for me.

Are there any good minimal windowing utilities that support Wayland? SDL does a lot I don't need and I try to maintain minimal dependencies. I suppose I could just use glfw & libsoundio, haven't tried that yet.

Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Friday November 22, 2024 @10:02PM (#42218897)
As far as I know, RGFW is the only minimal windowing of its kind. I guess I would suggest either targeting XWayland or using GLFW.

The Wayland API itself also really sucks to work with, even more so than Xlib....

But, RGFW's Wayland support will probably be improved in the future. :)

Re:RGFW: Single-header C99 window abstraction library by PittleyDunkin on Friday November 22, 2024 @11:13PM (#42219160)
GLFW has worked well for me.
Re:RGFW: Single-header C99 window abstraction library by marcthe12 on Saturday November 23, 2024 @01:01AM (#42219441)
Waylands problem is that to use it, you need code generation so the wayland backend kinda hard to design for a header only lib.
Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Saturday November 23, 2024 @08:50AM (#42220850)
I just have the Makefile do the code generation, it would be annoying for the user, but they can complain to Wayland if they don't like it.
Re:RGFW: Single-header C99 window abstraction library by amjoshuamichael on Saturday November 23, 2024 @11:09AM (#42221578)
I've seen some interesting work in doing Wayland by hand:

https://gaultier.github.io/blog/wayland_from_scratch.html

I'd also look at the work done on minimal wayland projects like [foot](https://codeberg.org/dnkl/foot), which supports wayland well and seems to be written by hand (see: https://codeberg.org/dnkl/foot/src/branch/master/wayland.c)

Re:RGFW: Single-header C99 window abstraction library by vkazanov on Saturday November 23, 2024 @03:03AM (#42219760)
Isn't SDL itself is quite minimal already? I mean, it is definitely not high-level in any sense of the word.
Re:RGFW: Single-header C99 window abstraction library by Sharlin on Saturday November 23, 2024 @07:07AM (#42220502)
Not minimal in the sense of "just give me a window, a minimal event loop, and a GPU context/swapbuffers function".
Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Saturday November 23, 2024 @08:52AM (#42220860)
Even then, that's what GLFW is designed to do, and it's entire source code is still far larger than RGFW's.
Re:RGFW: Single-header C99 window abstraction library by slimsag on Saturday November 23, 2024 @08:35AM (#42220781)
SDL provides..

..an image decoding library.

..an audio input/output library.

..a multi-channel audio mixer.

..ttf and rtf font rendering.

..networking.

..runtime shader cross-compilation

..its own entire graphics abstraction layer / API.

..its own shader language, shader compiler, and shader bytecode format.

I don't know at which point something becomes 'high level', but SDL is only 'minimal' if you use a subset of its functionality.

Re:RGFW: Single-header C99 window abstraction library by nextaccountic on Saturday November 23, 2024 @05:44AM (#42220256)
Rust has a lot of those small libs, my favorite is miniquad

https://crates.io/crates/miniquad

Re:RGFW: Single-header C99 window abstraction library by Sharlin on Saturday November 23, 2024 @07:11AM (#42220517)
Other alternatives: pixels, minifb, softbuffer.
Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Saturday November 23, 2024 @08:49AM (#42220846)
Sure, but none of these are true alternatives because they are missing a lot of features that libraries like GLFW or RGFW have.

(They may be good alternatives for certain use-cases)

Re:RGFW: Single-header C99 window abstraction library by Sharlin on Saturday November 23, 2024 @10:42AM (#42221460)
Oh, just based on the README I assumed RGFW was more minimal than it actually is.
Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Saturday November 23, 2024 @11:23AM (#42221652)
Minimal refers to the code itself.

GLFW's codebase is ~10MB while RGFW's is about ~300kb. But RGFW tries to support nearly everything that GLFW supports.

Re:RGFW: Single-header C99 window abstraction library by Sharlin on Saturday November 23, 2024 @01:20PM (#42222545)
Yeah, my bad :)