by Lerc on 9/9/2024, 6:29:08 AM
by felipefar on 9/9/2024, 12:49:19 AM
Nice work! It wouldn't be much work to support Android with this library and keep the single source file, since the addition of native_app_glue. It'd require just an AndroidManifest.xml, and the API communication can be done by calling the functions provided by the NDK or in the worst case by calling JNI.
by immibis on 9/8/2024, 10:41:11 PM
You might want to use CLOCK_MONOTONIC on POSIX or changing the system time will screw up the refresh rate or freeze the window completely.
by unwind on 9/9/2024, 6:07:43 AM
Very nice and very straight-forward. I really liked the part on getting "Doom" to run, impressive how easy such porting is now!
Any low-level C is kind of catnip for the old SO-powered part of my brain, but did not spend a lot of time and got a lot of confidence.i did find this bug:
memset(f->buf, rgb, f->width*f->height*sizeoof(*f->buf));
This will not work to set a color in the general case (`rgb` is `uint32_t`) since `memset()` only uses the lower `CHAR_BIT` bits of the value, it is setting the memory byte by byte. For black or white it will work! :)by onetom on 9/9/2024, 5:37:47 AM
Would it work on NetBSD/OpenBSD/FreeBSD/GhostBSD too?
Because if it does, it would worth mentioning it in the readme.
In Plan 9, Rio, the window manager, does a similar thing; it exposes a framebuffer to the process running in a window, simply as the /dev/draw device file, iirc.
by mrpippy on 9/8/2024, 11:34:45 PM
In the Mac/AppKit implementation it would be interesting to try using wantsUpdateLayer: and updateLayer: instead of drawRect. That should be more efficient.
by password4321 on 9/9/2024, 2:57:19 AM
TIL: Our goal here is to have a framebuffer for a single window that would run and look the same on Linux, Windows and macOS.
Basically re-implementing enough SDL from scratch to run Doom, nice!
by igtztorrero on 9/9/2024, 2:22:23 PM
WASN + Fester, for Browser, it is possible?
This has popped up because
Microui+fenster=Small GUI https://news.ycombinator.com/item?id=41477446
Was posted in the last day.
In that thread I suggested that API compatibility would be the way to go for more esoteric platforms, Since there's already comments here about BSD and Android targets.
All you need is
A bit more for audio, but that's really it's own little APIAs a mimimal API for doing interactive apps, it's hard to beat. I can see hobbyists who make their own operating systems taking advantage of this to get things working quickly.