mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
d3d11screencapture: Set viewport when drawing mouse cursor
If there weren't any moved/dirty regions in the captured frame, the viewport of the ID3D11DeviceContext would be left at whatever previous value it had, which could lead to the cursor being drawn in a wrong position and/or in an incorrect size. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2362>
This commit is contained in:
parent
f4f342aa78
commit
03b6dab006
1 changed files with 9 additions and 0 deletions
|
@ -516,6 +516,15 @@ public:
|
|||
context_handle->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
context_handle->IASetInputLayout(layout_.Get());
|
||||
|
||||
D3D11_VIEWPORT VP;
|
||||
VP.Width = static_cast<FLOAT>(FullDesc.Width);
|
||||
VP.Height = static_cast<FLOAT>(FullDesc.Height);
|
||||
VP.MinDepth = 0.0f;
|
||||
VP.MaxDepth = 1.0f;
|
||||
VP.TopLeftX = 0.0f;
|
||||
VP.TopLeftY = 0.0f;
|
||||
context_handle->RSSetViewports(1, &VP);
|
||||
|
||||
context_handle->Draw(NUMVERTICES, 0);
|
||||
|
||||
/* Unbind srv and rtv from context */
|
||||
|
|
Loading…
Reference in a new issue