thedmd / imgui-node-editor

Node Editor built using Dear ImGui
MIT License
3.6k stars 536 forks source link

struct EditorContext has inconsistent namespace #190

Open vlmillet opened 1 year ago

vlmillet commented 1 year ago

in imgui_node_editor.h, struct EditorContext is forward declared in ax::NodeEditor namespace, while it is defined in ax::NodeEditor::Detail. It seems to be wanted as the reinterpret_cast tells in CreateEditor, but it provokes unknown symbol dependency reflection while using your library with my reflection meta compiler. Is there a strong reason why it is like this ? I suggest in imgui_node_editor.h something like this to avoid compiler misleading :

namespace Detail
{
    struct EditorContext;
}
using EditorContext = Detail::EditorContext;

instead of struct EditorContext;

thedmd commented 1 year ago

struct EditorContext; was ment to be opaque handle to editor. Like FILE in stdio.

It is possible to pull EditorContext out of Details namespace internally. What I do not wish to do is to put implementation details in public header.

Do you need access to implementation details?

Maybe there is a way to better articulate for your compiler that it treat this declaration as opaque handle?