Canvas Fallback Support
How hard would it be to implement fallback on Context-2D with the way the code is now? Is there a way to get ImGui raw buffer without relying on GL ?
I don't see why not. ImGui was designed to be disconnected from how it's rendered - whether it's rendered via opengl, directx, hand-rendered, whatever. So if you can create/draw textures, draw triangles, then it should be possible. Although via canvas context2d, you are likely to run into performance issues with complex draws/windows. Especially if it's all cpu-rendered.
See ImDraw* classes in imgui.h and GetDrawData() documentation.
As far as the GetDrawData() function goes is that it provides a set of instructions ready for openGL and the likes, I was referring to a pixel basis format because canvas is slow like you said, but canvas can render an entire array of colours. I was hoping there is something in ImGui that could convert all those triangle drawing instructions into an array of colours.
The whole point of using opengl or canvas 2d api is to rasterize those triangle descriptions into pixels that can be displayed on a screen/buffer. ImGui does not come with a rasterizer -- it's up to the user to supply that piece.
So you must either use gl, canvas 2d, or some other software render to perform the rasterization.
Yes, I’m currently attempting to make that software rasterizer. I have tried TinyGL, and haven’t been successful. At the moment I’m trying to bring Regal to javascript using emscripten. I’m having more success with that. But The rasterization process should be possible with tinyGL, I’m just not good at understanding the entire proccess itself.
An update, I asked for help on the main Dear ImGui and have replicated the problem I'm having onto a Git. If you could have a look or identify what the problem is, that would help.