Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
minifb
MiniFB is a small cross platform library to create a frame buffer that you can draw pixels in
pane is a wrapper around rust winit. It used to be a way to open a window you can write to (so could be used with canvas) but stopped working because it relies on the deprecated native-plugin API, and hasn't been ported to FFI.
pane is a wrapper around rust winit. It used to be a way to open a window you can write to (so could be used with canvas) but stopped working because it relies on the deprecated native-plugin API, and hasn't been ported to FFI.
sdl2 gets around the first problem by downloading a CLI service & starting it, that speaks JSON over a TCP socket. It's a limited surface of the API, and missing some pretty basic stuff, but I could see it working ok. It's not canvas, so I'd have to translate those sort of calls to it. I discussed that a bit here and it sounds like I could blit images of the canvas to sdl2 surface, but since it doesn't support in-memory images, I'd have to implement that in sdl2, or save a "frame" image to a file, for every blit. Either way, I have the overhead of redrawing every frame as a complete image. This seems incredibly jenky, and I assume will not perform very well, but I haven't tested.
sdl2 gets around the first problem by downloading a CLI service & starting it, that speaks JSON over a TCP socket. It's a limited surface of the API, and missing some pretty basic stuff, but I could see it working ok. It's not canvas, so I'd have to translate those sort of calls to it. I discussed that a bit here and it sounds like I could blit images of the canvas to sdl2 surface, but since it doesn't support in-memory images, I'd have to implement that in sdl2, or save a "frame" image to a file, for every blit. Either way, I have the overhead of redrawing every frame as a complete image. This seems incredibly jenky, and I assume will not perform very well, but I haven't tested.
I also saw minifb, which seems like a really to-the-point way to get a buffer I can draw to., so I guess I will go in that direction (rust lib, make FFI bindings for deno, etc.)
I ended up helping to make deno-minifb. It works pretty decently with deno-canvas, and we're working on improving it.