From 91c245c1a6f5065e4106b145d8dbe0856dfb66a5 Mon Sep 17 00:00:00 2001 From: tobid7 Date: Sat, 12 Sep 2026 17:29:48 +0200 Subject: [PATCH] dx9 clipping --- backends/source/gfx_directx9.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/backends/source/gfx_directx9.cpp b/backends/source/gfx_directx9.cpp index 2a0ddf5..8b40d01 100644 --- a/backends/source/gfx_directx9.cpp +++ b/backends/source/gfx_directx9.cpp @@ -286,7 +286,20 @@ void GfxDirectX9::UploadPools() { impl->IBO->Unlock(); } -void GfxDirectX9::ClipRect() {} +void GfxDirectX9::ClipRect() { + if (CurrentHasClip) { + RECT r; + r.left = CurrentClip.x; + r.top = CurrentClip.y; + r.right = CurrentClip.x + CurrentClip.z; + r.bottom = CurrentClip.y + CurrentClip.w; + + impl->Device->SetScissorRect(&r); + impl->Device->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE); + } else { + impl->Device->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); + } +} } // namespace PD #else namespace PD {