Hacker News new | ask | show | jobs
by meheleventyone 1981 days ago
Plotting a single pixel is amusingly difficult in general particularly in the age of 3D acceleration. It was also not necessarily a picnic in the past either as there often wasn't space for a fully addressable frame buffer.

I actually did this whilst playing about with Zig a while ago. I made an offscreen buffer, rendered pixels to a frame buffer array in WASM and then copied them into the offscreen buffer. Not going to win speed awards but it worked, was fast enough and was super simple. Also it meant I could scale the canvas to scale my image. This was for a very small screen representing windows in a building. My proof of concept was approximately 30 lines of JS and the same again in Zig. Most of the latter is type definitions.

Although given that Canvas is supposed to be a friendly abstraction it definitely feels like a weird oversight. Personally for pixel sized things I love PICO-8.