Merge pull request #3272 from Cacodemon345/patch-134

qt_d3d9renderer: HiDPI and stability fixes
This commit is contained in:
Miran Grča
2023-04-23 12:42:03 +02:00
committed by GitHub

View File

@@ -80,7 +80,7 @@ D3D9Renderer::showEvent(QShowEvent *event)
params.BackBufferCount = 1;
params.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
params.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
params.hDeviceWindow = windowHandle;
params.hDeviceWindow = (HWND) winId();
HRESULT result = d3d9->CreateDeviceEx(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, windowHandle, D3DCREATE_MULTITHREADED | D3DCREATE_HARDWARE_VERTEXPROCESSING, &params, nullptr, &d3d9dev);
if (FAILED(result))
@@ -118,10 +118,10 @@ D3D9Renderer::paintEvent(QPaintEvent *event)
srcRect.bottom = source.bottom();
srcRect.left = source.left();
srcRect.right = source.right();
dstRect.top = destination.top();
dstRect.bottom = destination.bottom();
dstRect.left = destination.left();
dstRect.right = destination.right();
dstRect.top = destination.top() * devicePixelRatioF();
dstRect.bottom = destination.bottom() * devicePixelRatioF();
dstRect.left = destination.left() * devicePixelRatioF();
dstRect.right = destination.right() * devicePixelRatioF();
d3d9dev->BeginScene();
d3d9dev->Clear(0, nullptr, D3DCLEAR_TARGET, 0xFF000000, 0, 0);
while (surfaceInUse) { }