News for hackers. Stuff that matters.
Re:Doomgeneric: Make Porting Doom Easier by AnIdiotOnTheNet on Monday January 23, 2023 @06:22PM (#34496553)
Man I really hope the spec for those functions is fleshed out somewhere else to actually-useful detail. I didn't see anything at a cursory glance.

What format is the frame buffer in? What kind of "key events" need to be passed?

Re:Doomgeneric: Make Porting Doom Easier by deathanatos on Monday January 23, 2023 @06:46PM (#34496812)
> I didn't see anything at a cursory glance.

> What format is the frame buffer in?

It's a pointer to a screen-sized number of u32s. I'd hazard a guess that it's either RGBA or ABGR, and if you render one and everything looks wrong, it's the other. (Where the A channel is unused, as it's a framebuffer.)

Certainly not fool-proof and vulnerable to endian swaps if you somehow ended up on a big endian device. But this is also a port-doom-to-my-toaster level thing?

Re:Doomgeneric: Make Porting Doom Easier by rzzzt on Monday January 23, 2023 @06:55PM (#34496913)
The SDL code snippet on the last screenshot says SDL_PIXELFORMAT_RGB888, which is in XRGB order (not a 24-bit format, that would be RGB24).
Re:Doomgeneric: Make Porting Doom Easier by schemescape on Monday January 23, 2023 @09:38PM (#34498423)
Quick, open a PR to add this documentation ;)
Re:Doomgeneric: Make Porting Doom Easier by slj on Monday January 23, 2023 @06:46PM (#34496813)
Wouldn’t be too hard to check out the existing implementations already using doomgeneric and write them for your own requirements!!
Re:Doomgeneric: Make Porting Doom Easier by anyfoo on Monday January 23, 2023 @07:05PM (#34497029)
This is one of those things where if you actually plan to port DOOM, you will figure it out pretty quickly on your own, by just glancing at the actual code.

It's pretty common at that level to "just read the source", or to at least look how others use the interface.

Re:Doomgeneric: Make Porting Doom Easier by AnIdiotOnTheNet on Monday January 23, 2023 @08:13PM (#34497706)
Sure, but like, if the point of this is to make porting DOOM super easy by requiring the programmer to only implement a few functions, I don't think it is a ridiculous notion that those few functions be well specified.

Obviously I can dig this out of the code if I wanted to. I've reverse engineered programs with nothing but a debugger and stubbornness[0], that's not the point.

Like, what if I'm not a C programmer and I'm just using a C binding?

[0] Most recently, that was a DOS updater for an old HP Elitebook with a battery that no longer functioned. The updater requires that the AC be plugged in, which it loudly complains about, but fails to mention that it also requires the battery to be charged. Fortunately this wasn't a 90s game or it probably would have been more complicated than finding the check and turning a conditional jump into an unconditional one.

Re:Doomgeneric: Make Porting Doom Easier by anyfoo on Monday January 23, 2023 @08:35PM (#34497890)
Fair enough. I think anyone who wants to port DOOM to new/old hardware (or old and/or exotic OSs) would not see this as much of a barrier, but maybe thorough documentation would help easy ports to who knows what outside of that. We don't even know what people could come up with if that were made even easier.
Re:Doomgeneric: Make Porting Doom Easier by avx56 on Monday January 23, 2023 @11:00PM (#34499043)
Build a system that even a fool can use, and only a fool will want to use it
Re:Doomgeneric: Make Porting Doom Easier by ReactiveJelly on Tuesday January 24, 2023 @08:21AM (#34503196)
Interface https://github.com/ozkl/doomgeneric/blob/master/doomgeneric/...

150-line example impl https://github.com/ozkl/doomgeneric/blob/master/doomgeneric/...

As other commenters said, the code is good enough to read for that task.

The only weird thing is that you don't control main... That means this isn't a DOOM library, it's a DOOM framework :/