port: GrpScreen verbatim 40250 (2d draws via UIRender, D3D8 shim device-lost/Present/ID3DXMesh)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 14:40:57 +09:00
co-authored by Claude Opus 5.5
parent d73f5ea4bd
commit b5d413afa6
7 changed files with 1125 additions and 323 deletions
+10
View File
@@ -328,6 +328,11 @@ public:
// The caps leave out D3DCAPS2_FULLSCREENGAMMA (the frame goes to a window, where D3D8 ignores the
// ramp too), so 40250 CPythonGraphic::SetGamma returns before it gets here.
void SetGammaRamp(DWORD, const D3DGAMMARAMP*) override {}
// PORT: the host owns the swapchain (Vulkan / canvas): the recorded device is never lost, Reset keeps
// the recording size, and the host presents the recorded frame after CPythonApplication::Process.
HRESULT TestCooperativeLevel() override { return D3D_OK; }
HRESULT Reset(D3DPRESENT_PARAMETERS*) override { return D3D_OK; }
HRESULT Present(const RECT*, const RECT*, HWND, const RGNDATA*) override { return D3D_OK; }
HRESULT BeginScene() override { return S_OK; }
HRESULT EndScene() override { return S_OK; }
@@ -504,6 +509,11 @@ public:
}
// PORT: fixed function only; CGraphicDevice's stream "shaders" are the FVFs they describe.
HRESULT SetVertexShader(DWORD handle) override { m_fvf = handle; return S_OK; }
HRESULT GetVertexShader(DWORD* pHandle) override
{
*pHandle = m_fvf;
return S_OK;
}
HRESULT SetPixelShader(DWORD) override { return S_OK; }
// PORT: no programmable vertex shaders; 40250 falls back to its FVF when creation fails.
HRESULT CreateVertexShader(const DWORD*, const DWORD*, DWORD* pHandle, DWORD) override