mirror of
https://github.com/DarthAffe/ScreenCapture.NET.git
synced 2025-12-12 13:28:35 +00:00
Added error-checking to the result of AcquireNextFrame in DX11 capture
Fixes #7
This commit is contained in:
parent
ffc52e8f1d
commit
6a43f84fe5
@ -111,7 +111,7 @@ public sealed class DX11ScreenCapture : IScreenCapture
|
|||||||
IDXGIResource? screenResource = null;
|
IDXGIResource? screenResource = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_duplicatedOutput.AcquireNextFrame(Timeout, out OutduplFrameInfo duplicateFrameInformation, out screenResource);
|
_duplicatedOutput.AcquireNextFrame(Timeout, out OutduplFrameInfo duplicateFrameInformation, out screenResource).CheckError();
|
||||||
if ((screenResource == null) || (duplicateFrameInformation.LastPresentTime == 0)) return false;
|
if ((screenResource == null) || (duplicateFrameInformation.LastPresentTime == 0)) return false;
|
||||||
|
|
||||||
using ID3D11Texture2D screenTexture = screenResource.QueryInterface<ID3D11Texture2D>();
|
using ID3D11Texture2D screenTexture = screenResource.QueryInterface<ID3D11Texture2D>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user