Skip to content

viewport_enable does not work, missing functions call #29

@defaultgnome

Description

@defaultgnome

I wanted to enable multi-viewport and dragging my imgui window outside of my main glfw window, but i get an error.

This is what i'm trying to set:

zgui.io.setConfigFlags(.{
    .viewport_enable = true,
});

Right at the start of the runtime I get this error:

Assertion failed: ((g.FrameCount == 0 || g.FrameCount == g.FrameCountPlatformEnded) && "Forgot to call UpdatePlatformWindows() in main loop after EndFrame()? Check examples/ applications for reference."), function ErrorCheckNewFrameSanityChecks, file imgui.cpp, line 10847.

So if I understand correctly we need to call those functions in the main loop. (see ImGui documentation)

// Update and Render additional Platform Windows
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{
    ImGui::UpdatePlatformWindows();
    ImGui::RenderPlatformWindowsDefault();
    // TODO for OpenGL: restore current GL context.
}

But as far as I saw in the source code of zgui I don't see those functions.

Can we please add them?


Additional Info

Zig Version: 0.14.0
ZGUI Version:

        .zgui = .{
            .url = "https://github.com/zig-gamedev/zgui/archive/refs/heads/main.tar.gz",
            .hash = "zgui-0.6.0-dev--L6sZCCGaACkWlRBJOh9dEJ4fjKp0HenyS8__Bzkvl6q",
        },

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