7 ms·
Yup, it seems it could work for both SDL1 and OpenGL 1.x, it's just a matter of writing a custom backend. Per README: "Integrating Dear ImGui within your custo
by TeMPOraL 6y ago
Yup, it seems it could work for both SDL1 and OpenGL 1.x, it's just a matter of writing a custom backend. Per README:
"Integrating Dear ImGui within your custom engine is a matter of 1) wiring mouse/keyboard/gamepad inputs 2) uploading one texture to your GPU/render engine 3) providing a render function that can bind textures and render textured triangles."
The backends don't seem all that complicated. Here's the OpenGL 2 implementation: https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_opengl2.cpp https://github.com/ocornut/imgui/blob/master/backends/imgui_... - should be backportable to OpenGL 1.x.
I'm pretty sure that if someone was crazy enough, they could even write a ncurses backend for it. Rejecting 50% of the functionality for sure, but most of the UIs I've seen done with Dear ImGui were simple enough that they could be translated to terminal display almost 1:1.
I actually love this kind of design, where the dependency on IO particulars is neatly separated out. I don't see much in terms of automated testing in the repo, but I imagine feature-level tests should be easy to add with such design: just have a backend that lets the test drive input, and consume callbacks and rendering commands.
- TazeTSchnitzel 6y agoBy the way, that link is broken because of a following character being parsed by HN as being part of the URL.
- TeMPOraL 6y agoThanks, fixed. @dang, is there any reason URL parser should consider a trailing semicolon to be a part of the URL? Or maybe HN needs some form of minimal markup or escaping syntax for URLs? Or at least a documentation of the existing parser? :).
- flohofwoe 6y agoHere's an experimental text-mode backend for Dear ImGui based on ncurses (not sure if this required deeper changes to Dear ImGui though): https://github.com/ggerganov/imtui https://github.com/ggerganov/imtui Also, regarding automated testing, AFAIK this is in progress for quite a while: https://github.com/ocornut/imgui/issues/435 https://github.com/ocornut/imgui/issues/435