thedmd / imgui-node-editor

Node Editor built using Dear ImGui
MIT License
3.64k stars 537 forks source link

Replace SentinelDrawCallback with a define #256

Closed nspitko closed 1 year ago

nspitko commented 1 year ago

This mirrors the way ImGui does it (See also ImDrawCallback_ResetRenderState).

The primary motivation here is that it's possible to override the type of ImDrawCallback in the implementation, so any extension code needs to allow for whatever zany types the implementer may choose. (In our case, vclosure*)

With this change, the type should always be compatible, and we additionally support implementation overrides should some other extension or internal code be sitting on that sentinel value already in a way that would cause a conflict.

nspitko commented 1 year ago

Note that #255 needs to be resolved before this can be merged, else it'll probably introduce a crash unless the user explicitly handles it in their backend.

thedmd commented 1 year ago

Thank you, I reintegrated changes to 0.9 and 0.10.