Is there any way to do a GPU-less 2D buffer display to winit?

I'm currently working on a project that needs to be able to display a 2D buffer to the screen in a window, process input events, etc. For the former, minifb seems like the best option. But, for the latter winit is standard. I'm having some issues with minifb sometimes segfaulting¹, and missing some features such as the ability to set a window icon. Minifb also requires a C and C++ compiler at least on Linux, which is not ideal. Winit being more commonly used is more likely to have these sorts of issues worked out, but all the crates that can display something in winit depend on the presence of a modern(ish) GPU, which is not tolerable in my use case, and is a bigger issue than the minifb issues.

Is there any current GPU-less and cross-platform way to get a 2D buffer shown on a winit window, or will I likely need to try to make this myself?

1: Clearly this is a bug in minifb that could theoretically be fixed, but I haven't been able to figure out what causes it as it seems to just happen randomly. If I had any idea of what causes this bug or how to reliably reproduce it, I would report it and possibly PR a fix. All I know is that seems to happen when resizing, and sometimes happens along with a blacked-out window when it should have something displayed in it.

1 Like