News for hackers. Stuff that matters.
Re:RGFW: Single-header C99 window abstraction library by dmitrygr on Friday November 22, 2024 @08:59PM (#42218714)
> Wayland support is very experimental and broken

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

Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Friday November 22, 2024 @09:23PM (#42218780)
X11 needs a real alternative :(
Re:RGFW: Single-header C99 window abstraction library by themerone on Friday November 22, 2024 @11:53PM (#42219273)
What do you expect from an alternative?
Re:RGFW: Single-header C99 window abstraction library by colleagueRiley on Saturday November 23, 2024 @08:47AM (#42220835)
- Better API design - Not being experimental after 11 years

I think that Wayland actually has some steps in the right direction, but overall I don't think it's actually a very good alternative. It's way more low-level than X11 and a lot of higher level features, like window decorations, are not even officially supported.

Re:RGFW: Single-header C99 window abstraction library by akira2501 on Saturday November 23, 2024 @01:30AM (#42219505)
X11 is fine. It's mostly just Video Games that need an alternative. It'd be nice if there was a "pause X11 video card control and give exclusive access to a single application." Then there's no need to care.
Re:RGFW: Single-header C99 window abstraction library by ori_b on Saturday November 23, 2024 @02:41AM (#42219699)
You just described X11's DRI (direct rendering infrastructure).

https://en.m.wikipedia.org/wiki/Direct_Rendering_Infrastruct...

Re:RGFW: Single-header C99 window abstraction library by Longhanks on Saturday November 23, 2024 @05:07AM (#42220175)
X11 is utterly broken for multi-monitor setups with different resolutions at different scales (e. g. builtin laptop screen @1.25x, external display at 1x or some variation of that). With high resolution screens (e g. 4k at only 27"), that setup is not uncommon anymore.

(Wayland is broken in very many other ways, though, so you trade one evil for... 5 others).

Re:RGFW: Single-header C99 window abstraction library by alwayslikethis on Saturday November 23, 2024 @07:36AM (#42220572)
Wayland's scaling for 1.25x and even 1.5x is not so great either, though it is slowly going in the right direction with wp-fractional-scale-v1
Re:RGFW: Single-header C99 window abstraction library by uecker on Saturday November 23, 2024 @11:04AM (#42221561)
X was a very well designed system IMHO that could be evolved via extensions (e.g. how compositing was added etc.). It is sad that few people work on it anymore to fix such issues.
Re:RGFW: Single-header C99 window abstraction library by immibis on Saturday November 23, 2024 @10:38PM (#42225758)
X isn't opinionated enough, and Wayland is even worse. While X has labels like "substructure redirect override" that in practice means "bypass the window manager" and tries to theoretically support multiple window managers, Wayland barely even knows what a window is!
Re:RGFW: Single-header C99 window abstraction library by immibis on Saturday November 23, 2024 @10:35PM (#42225745)
Correction: Xorg doesn't have good support for this. I don't think there's an extension for it in the protocol either, but one could be created - just as it has for Wayland. Apps that don't support the extension should be scaled by the compositor as usual.

X11 has a reasonably solid core, though, while Wayland does not.

Re:RGFW: Single-header C99 window abstraction library by freeone3000 on Saturday November 23, 2024 @09:51AM (#42221198)
This actually doesn’t work with modern expectations.

Modern games are expected to work in multi-monitor setups and render in “borderless windowed” mode, so you can alt-tab out to multitask, or have a comms overlay. Single monitor single process gaming still happens, but a good 85% of setups (according to the Steam Hardware Survey) are not that. There are five games I know or that actually handle multimonitor natively of the hundreds I’ve played. So we need some form of cooperative multitasking for graphics with the window manager.

Re:RGFW: Single-header C99 window abstraction library by 1oooqooq on Saturday November 23, 2024 @11:41AM (#42221759)
Modern good games are not expected to "render in “borderless windowed” mode, so you can alt-tab out to multitask"

Really bad games with slow multiplayer match making lobby and tiresome repetitive gameplay and bad UX where you need to look most of the actual game information on a fan wiki, or triple A games where you have to login and enter credit card information on a "launcher"... those are the ones you expect to "render in “borderless windowed” mode, so you can alt-tab out to multitask". Good riddance.

Re:RGFW: Single-header C99 window abstraction library by jll29 on Saturday November 23, 2024 @05:02AM (#42220161)
Are you kidding? I started reading the X11 handbook series in the 1980s and now it's 2024 and I'm nearly finished, and you want to replace it? ;-)
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 :)