You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Back-ends: imgui_impl_win32 + customimgui_impl_dx9 (Was modified to use shaders instead of fixed function DX9)
Compiler: VS2022 MSVC
Operating System: Windows 11
My Issue/Question:
I'm using a dx9 device end scene hook with a custom imgui_impl_dx9 backend to get Dear ImGui to work with GTA IV.
It all works fine, except that some Widgets (Like the Listbox and the items inside the Listbox) will not stay inside the Window when you scroll. Basically the whole clipping behaviour is acting weird.
A video of that behaviour can be seen below where i'm testing this with the demo window.
Any help would be appreciated! Thanks!
Screenshots/Video
imgui.mp4
Code
My OnBeforeD3D9DeviceEndScene Method
static void OnBeforeD3D9DeviceEndScene(IDirect3DDevice9* d3d9Device)
{
// Initialize ImGui if not initialized yet
InitializeImGui(d3d9Device);
// ImGui is not initialized, return.
//if (!ImGuiStates::s_bIsImGuiInitialized)
// return;
// Get ImGuiIO
ImGuiIO& io = ImGui::GetIO(); (void)io;
// Get the main viewport of ImGui
/*ImGuiViewport* vp = ImGui::GetMainViewport();*/
// Show cursor and disable mouse forever for testing
io.MouseDrawCursor = true;
ImGuiStates::s_bImGuiWantsMouseDisabled = true;
// Create new ImGui Frame
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
ImGui::ShowDemoWindow();
// End ImGui Frame and draw
ImGui::EndFrame();
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
}
Your rendering backend is not honoring the ImDrawCmd::ClipRect field correctly.
Perhaps the SetScissorRect() call has no effect in your situation for some reason, in spite of bd->pd3dDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE); being called. I don't know the reason. Perhaps you can replicate scissoring in the vertex shader.
There's a DX9+Shader backend at #3874 which didn't seem to mention this issue.
This is not our backend nor our code so we can't really provide support for it.
ocornut
changed the title
Certain Widgets do not get clipped inside the Window properly
Custom DX9: backend: certain Widgets do not get clipped inside the Window properly
Nov 3, 2023
Version/Branch of Dear ImGui:
Version: 1.89.8 (18980)
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_win32 + custom imgui_impl_dx9 (Was modified to use shaders instead of fixed function DX9)
Compiler: VS2022 MSVC
Operating System: Windows 11
My Issue/Question:
I'm using a dx9 device end scene hook with a custom imgui_impl_dx9 backend to get Dear ImGui to work with GTA IV.
It all works fine, except that some Widgets (Like the Listbox and the items inside the Listbox) will not stay inside the Window when you scroll. Basically the whole clipping behaviour is acting weird.
A video of that behaviour can be seen below where i'm testing this with the demo window.
Any help would be appreciated! Thanks!
Screenshots/Video
imgui.mp4
Code
My OnBeforeD3D9DeviceEndScene Method
The InitializeImGui Method
The text was updated successfully, but these errors were encountered: