Remix.run Logo
amjoshuamichael 3 days ago

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.

colleagueRiley 3 days ago | parent | next [-]

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. :)

3 days ago | parent [-]
[deleted]
nextaccountic 3 days ago | parent | prev | next [-]

Rust has a lot of those small libs, my favorite is miniquad

https://crates.io/crates/miniquad

Sharlin 3 days ago | parent [-]

Other alternatives: pixels, minifb, softbuffer.

colleagueRiley 3 days ago | parent [-]

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)

Sharlin 3 days ago | parent [-]

Oh, just based on the README I assumed RGFW was more minimal than it actually is.

colleagueRiley 3 days ago | parent [-]

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.

Sharlin 3 days ago | parent [-]

Yeah, my bad :)

PittleyDunkin 3 days ago | parent | prev | next [-]

GLFW has worked well for me.

marcthe12 3 days ago | parent | prev | next [-]

Waylands problem is that to use it, you need code generation so the wayland backend kinda hard to design for a header only lib.

amjoshuamichael 3 days ago | parent | next [-]

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)

colleagueRiley 3 days ago | parent | prev [-]

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.

vkazanov 3 days ago | parent | prev [-]

Isn't SDL itself is quite minimal already? I mean, it is definitely not high-level in any sense of the word.

slimsag 3 days ago | parent | next [-]

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.

Sharlin 3 days ago | parent | prev [-]

Not minimal in the sense of "just give me a window, a minimal event loop, and a GPU context/swapbuffers function".

colleagueRiley 3 days ago | parent [-]

Even then, that's what GLFW is designed to do, and it's entire source code is still far larger than RGFW's.