-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Custom DrawList #4879
Comments
I tried editing the Render function myself and added the bolded part
But it didn't pass this assert : So I'm guessing I did something wrong and have no idea how any of this works I just want to render menus please help this stuff is giving me headaches |
I tried again,the code above worked,just had to comment out the assert (probably not the best thing to do) and changed the code to
Please suggest any alternative other than commenting out the assert |
You will want to build an ImDrawData drawData{};
ImDrawList *dl = m_drawList.get();
drawData.Valid = true;
drawData.CmdLists = &dl;
drawData.CmdListsCount = 1;
drawData.TotalVtxCount = dl->VtxBuffer.size();
drawData.TotalIdxCount = dl->IdxBuffer.size();
drawData.DisplayPos = ImVec2(0.0f, 0.0f);
drawData.DisplaySize = ImVec2(Graphics::GetScreenWidth(), Graphics::GetScreenHeight());
drawData.FramebufferScale = ImVec2(1.0f, 1.0f);
Pi::pigui->GetRenderer()->RenderDrawData(&drawData); I don't make any guarantees that this code works verbatim with a vanilla ImGui render backend, we do things slightly differently to make drawing as efficient as possible, but it should be a good jumping-off point. |
…DrawData itself. Faclitate user-manipulation of the array (#6406, #4879, #1878) + deep swap. (#6597, #6475, #6167, #5776, #5109, #4763, #3515, #1860) + Metrics: avoid misleadingly iterating all layers of DrawDataBuilder as everything is flattened into Layers[0] at this point. # Conflicts: # imgui.cpp # imgui_internal.h
Version/Branch of Dear ImGui:
Version: 1.86
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: DX9 + Win32
Compiler: C++ / Visual Studio
Operating System: Windows 11
My Issue/Question:
How do I render a custom draw list like for example,I can just call
ImGui::Render(custom_drawlist);
I was using an old program and that was how it rendered custom drawlist,not sure if it's a specific implementation by the program to render custom draw list.But after I recently update the files to 1.86,the ImGui::Render() function doesn't take any parameters anymore and now I don't know how to render the custom draw list
The text was updated successfully, but these errors were encountered: