Skip to content

ImDrawListSharedData not generated correctly when generating dcimgui.h #102

@ZimM-LostPolygon

Description

@ZimM-LostPolygon

Trying to update to 1.92.x and keep hitting more edge cases.

ImDrawListSharedData struct is defined in imgui_internal.h while being used all throughout imgui.h. However, since normally only imgui.h is included when processing imgui.h, what ends up happening is that dear_bindings never knows nothing about ImDrawListSharedData except for the mere fact it exists, so the type is silently emitted as empty, with no fields:

{
    "name": "ImDrawListSharedData",
    "original_fully_qualified_name": "ImDrawListSharedData",
    "kind": "struct",
    "by_value": false,
    "has_placement_constructor": false,
    "forward_declaration": true,
    "is_anonymous": false,
    "fields": [],
    "comments": {
        "attached": "// Data shared among multiple draw lists (typically owned by parent ImGui context, but you may create one yourself)"
    },
    "is_internal": false,
    "source_location": {
        "filename": "imgui.h",
        "line": 171
    }
},

Honestly, not sure if this just wasn't noticed before, or it is a result of recent-ish changes, but the way dear_bindings works, it expects ImDrawListSharedData to be fully defined in imgui.h.

Possible solutions/workarounds:

  1. ImDrawListSharedData's definition is moved from imgui_internal.h to imgui.h in dear imgui itself
  2. Include imgui_internal.h even if only intending to generate a wrapper for imgui.h. EDIT: this should work, but somehow doesn't. ImDrawListSharedData is still empty in every generated file

Are there any other types that behave weirdly like that? Are we able to detect those cases and throw an error instead of silently outputting invalid output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions