Search code examples
c++imgui

ImGui has no member RenderPlatformWindowsDefault error


When i try to build my old code i dont remember what version is imgui but i'm getting this error. i searched whole internet but i can't find nothing.

ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
        {
            ImGui::UpdatePlatformWindows();
            ImGui::RenderPlatformWindowsDefault();
        } 

Visual studio errors:

Error (active) E0020 identifier "ImGuiConfigFlags_ViewportsEnable" is undefined

Error (active) E0135 namespace "ImGui" has no member "UpdatePlatformWindows"

Error (active) E0135 namespace "ImGui" has no member "RenderPlatformWindowsDefault"

Imgui version : v1.88


Solution

  • That code uses the docking branch of imgui, and you're probably using the master branch.

    You could either switch to the docking branch, or remove those lines of code if you don't need it.