-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Advice on creating a backend not using vertex buffers. #3175
Comments
There is no customization point where you can capture individual draw commands. Only way is to do as you suggested and replace AddXXX function implementations. |
I think you'd want to #ifdef out the ImDrawList header and implementation and create your own in another file. I don't mind supporting this for experiments such as https://github.com/ggerganov/imtui etc. but I'd only do this with an actual implementation lined up. Aka if you have something useful working, I would take the PR to add an official way to ifdef the default implementation out. But I suspect it's going to be more subtle than that. So first I suggest you hack imgui with the minimum amount of change (only new |
So far the least intrusive implementation has been to create a define in imconfig to select between the original ImDrawList and one that inherits and extends. Seems to be the minimum amount of change, added a PR for that alone. #3185 |
It's a good idea for the pull request created by myself. (#2724) I am agree with that "Probably a better idea to allow passing a custom drawlist to context creation." in #3185 (comment). |
The ability to configure this part of ImGui is more interesting to me than the various PRs/Issues about improved font rendering. I don't mind writing the things necessary to do better font handling (maybe Slug) or rendering (maybe Primitive Buffers), but don't have a good hook for it right now. Even a compile-time one would be nice. |
Greetings fellow humans, quick question on backends that I couldn't find in the docs:
Consider a system where there's no viable API for drawing with vertices / triangles. A system where you pass a structure in the form of
{ DRAW_LINE, x0, y0, x1, y1, colour }
to a device and it does the rendering on its own.Is there any proper customization-point to capture the calls or is the only option to replace
ImDrawList
or modifyAddPolyline()
and friends inimgui_draw.cpp
?Somewhat related to #2724 which could probably benefit from the advice.
The text was updated successfully, but these errors were encountered: