Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for imgui_internal.h #9

Closed
ocornut opened this issue Aug 17, 2021 · 7 comments · Fixed by #46
Closed

Add support for imgui_internal.h #9

ocornut opened this issue Aug 17, 2021 · 7 comments · Fixed by #46

Comments

@ocornut
Copy link
Member

ocornut commented Aug 17, 2021

Untested but Ben mentions this is still WIP

@ocornut
Copy link
Member Author

ocornut commented Nov 16, 2022

Errors preventing cimgui_internal.h to be parsed (this is before attempting to compile cimgui_internal.cpp)

  • cimgui_internal.h(313,138): warning C4229: anachronism used: modifiers on data are ignored
#ifndef ImQsort
    CIMGUI_API void cImQsort(void* base, size_t count, size_t size_of_element, int (* IMGUI_CDECL compare_func)(void const*, void const*));
#endif // #ifndef ImQsort

For now I've removed this function (the "right" fix would be to remove both IMGUI_CDECL and const) but it is unlikely someone would need this wrapper from C.

  • cimgui_internal.h(522,9): error C2061: syntax error: identifier 'ImVector'
    // Helper: ImGuiTextIndex<>
    // Maintain a line index for a text buffer. This is a strong candidate to be moved into the public API.
    typedef struct ImGuiTextIndex_t
    {
        ImVector<int> LineOffsets;
        int
        EndOffset
    } ImGuiTextIndex;

Removed the type, however the "right" fix here would be to emit a ImVector_int instance in the structure?

  • error C2061: syntax error: identifier 'ImVec2ih_ImVec2ih'
    Constructor not removed due to using explicit ?
CIMGUI_API explicit ImVec2ih_ImVec2ih(ImVec2ih* self, ImVec2 rhs);`

I hackily removed this however it seems to be parsing error chocking on explicit.

@ZimM-LostPolygon
Copy link
Contributor

Was this abandoned? If not, is there any way to test it out? Doesn't seem like headers for imgui_internal.h are generated as of now

@ocornut
Copy link
Member Author

ocornut commented Sep 30, 2023

The idea is that you’d need to run dear bindings on this specific header rather than imgui.h.

It doesn’t work yet. IMHO this is the most important feature ahead but this is being developed in spare time. Feel free to help fixing things if you can.

Extra thought: due to the nature of internals i guess the generator could be tweaked to not emit the non-Ex/Ex functions.

@ZimM-LostPolygon
Copy link
Contributor

Extra thought: due to the nature of internals i guess the generator could be tweaked to not emit the non-Ex/Ex functions.

Had the same thought. The non-Ex/Ex split makes it right more annoying, since C# supports default arguments just fine, and the variant with implied default values won't probably even be referenced by the wrapper.

@ocornut
Copy link
Member Author

ocornut commented Oct 16, 2023

Did you meant to close this? I guess it's part of #47 ?
When #47 makes progress it may make sense to enable it on CI ?

@ShironekoBen
Copy link
Collaborator

Oops, no, I didn't notice it's linked to #46 as well so when I merged that it got closed. I'll reopen until we get #47 all sorted out!

@ShironekoBen ShironekoBen reopened this Oct 16, 2023
@ShironekoBen
Copy link
Collaborator

Closing this as #47 implements imgui_internal.h support now. We can (hopefully!) track any more specific problems that come up with it as other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants