Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ddupl update #212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Samples/DXGIDesktopDuplication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ This sample demonstrates how to use the desktop duplication behaviors exposed by

This sample is written in C++. You also need some experience with DirectX.

**Warning** This sample requires Microsoft Visual Studio 2013 or a later version (any SKU) and will not compile in Microsoft Visual Studio Express 2013 for Windows.
**Warning** This sample requires Microsoft Visual Studio 2017 or a later version (any SKU) and will not compile in Microsoft Visual Studio Express 2017 for Windows.

For info about how to use the desktop duplication API, see [Desktop Duplication API](http://msdn.microsoft.com/en-us/library/windows/desktop/hh404487).

**Note** The Windows-classic-samples repo contains a variety of code samples that exercise the various programming models, platforms, features, and components available in Windows and/or Windows Server. This repo provides a Visual Studio solution (SLN) file for each sample, along with the source files, assets, resources, and metadata needed to compile and run the sample. For more info about the programming models, platforms, languages, and APIs demonstrated in these samples, check out the documentation on the [Windows Dev Center](https://dev.windows.com). This sample is provided as-is in order to indicate or demonstrate the functionality of the programming models and feature APIs for Windows and/or Windows Server. This sample was created for Windows 8.1 and/or Windows Server 2012 R2 using Visual Studio 2013, but in many cases it will run unaltered using later versions. This sample was created for Windows 8.1 and/or Windows Server 2012 R2 using Visual Studio 2013, but in many cases it will run unaltered using later versions. Please provide feedback on this sample!
**Note** The Windows-classic-samples repo contains a variety of code samples that exercise the various programming models, platforms, features, and components available in Windows and/or Windows Server. This repo provides a Visual Studio solution (SLN) file for each sample, along with the source files, assets, resources, and metadata needed to compile and run the sample. For more info about the programming models, platforms, languages, and APIs demonstrated in these samples, check out the documentation on the [Windows Dev Center](https://dev.windows.com). This sample is provided as-is in order to indicate or demonstrate the functionality of the programming models and feature APIs for Windows and/or Windows Server. This sample was created for Windows 10 1809 and/or Windows Server 2016 1709 using Visual Studio 2019, but in many cases it will run unaltered using later versions.

To get a copy of Windows, go to [Downloads and tools](http://go.microsoft.com/fwlink/p/?linkid=301696).

Expand All @@ -20,16 +20,16 @@ Operating system requirements

Client

Windows 8.1
Windows 10, version 1809

Server

Windows Server 2012 R2
Windows Server 2016, version 1709

Build the sample
----------------

To build this sample, open the solution (.sln) file titled DesktopDuplication.sln from Visual Studio 2013 for Windows 8.1 (any SKU) or later versions of Visual Studio and Windows. Press F7 (or F6 for Visual Studio 2013) or go to Build-\>Build Solution from the top menu after the sample has loaded.
To build this sample, open the solution (.sln) file titled DesktopDuplication.sln from Visual Studio 2017 for Windows 10 1809 (any SKU) or later versions of Visual Studio and Windows. Press F7 (or F6 for Visual Studio 2013) or go to Build-\>Build Solution from the top menu after the sample has loaded.

Run the sample
--------------
Expand Down
12 changes: 6 additions & 6 deletions Samples/DXGIDesktopDuplication/cpp/CommonTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define _COMMONTYPES_H_

#include <windows.h>
#include <d3d11.h>
#include <dxgi1_2.h>
#include <d3d11_4.h>
#include <dxgi1_6.h>
#include <sal.h>
#include <new>
#include <warning.h>
Expand Down Expand Up @@ -38,7 +38,7 @@ typedef _Return_type_success_(return == DUPL_RETURN_SUCCESS) enum
}DUPL_RETURN;

_Post_satisfies_(return != DUPL_RETURN_SUCCESS)
DUPL_RETURN ProcessFailure(_In_opt_ ID3D11Device* Device, _In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr, _In_opt_z_ HRESULT* ExpectedErrors = nullptr);
DUPL_RETURN ProcessFailure(_In_opt_ ID3D11Device5* Device, _In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr, _In_opt_z_ HRESULT* ExpectedErrors = nullptr);

void DisplayMsg(_In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr);

Expand All @@ -61,8 +61,8 @@ typedef struct _PTR_INFO
//
typedef struct _DX_RESOURCES
{
ID3D11Device* Device;
ID3D11DeviceContext* Context;
ID3D11Device5* Device;
ID3D11DeviceContext4* Context;
ID3D11VertexShader* VertexShader;
ID3D11PixelShader* PixelShader;
ID3D11InputLayout* InputLayout;
Expand Down Expand Up @@ -96,7 +96,7 @@ typedef struct _THREAD_DATA
//
typedef struct _FRAME_DATA
{
ID3D11Texture2D* Frame;
ID3D11Texture2D1* Frame;
DXGI_OUTDUPL_FRAME_INFO FrameInfo;
_Field_size_bytes_((MoveCount * sizeof(DXGI_OUTDUPL_MOVE_RECT)) + (DirtyCount * sizeof(RECT))) BYTE* MetaData;
UINT DirtyCount;
Expand Down
6 changes: 3 additions & 3 deletions Samples/DXGIDesktopDuplication/cpp/DesktopDuplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ DWORD WINAPI DDProc(_In_ void* Param)
DUPLICATIONMANAGER DuplMgr;

// D3D objects
ID3D11Texture2D* SharedSurf = nullptr;
ID3D11Texture2D1* SharedSurf = nullptr;
IDXGIKeyedMutex* KeyMutex = nullptr;

// Data passed in from thread creation
Expand Down Expand Up @@ -471,7 +471,7 @@ DWORD WINAPI DDProc(_In_ void* Param)
DispMgr.InitD3D(&TData->DxRes);

// Obtain handle to sync shared Surface
HRESULT hr = TData->DxRes.Device->OpenSharedResource(TData->TexSharedHandle, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&SharedSurf));
HRESULT hr = TData->DxRes.Device->OpenSharedResource(TData->TexSharedHandle, __uuidof(ID3D11Texture2D1), reinterpret_cast<void**>(&SharedSurf));
if (FAILED (hr))
{
Ret = ProcessFailure(TData->DxRes.Device, L"Opening shared texture failed", L"Error", hr, SystemTransitionsExpectedErrors);
Expand Down Expand Up @@ -609,7 +609,7 @@ DWORD WINAPI DDProc(_In_ void* Param)
}

_Post_satisfies_(return != DUPL_RETURN_SUCCESS)
DUPL_RETURN ProcessFailure(_In_opt_ ID3D11Device* Device, _In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr, _In_opt_z_ HRESULT* ExpectedErrors)
DUPL_RETURN ProcessFailure(_In_opt_ ID3D11Device5* Device, _In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr, _In_opt_z_ HRESULT* ExpectedErrors)
{
HRESULT TranslatedHr;

Expand Down
12 changes: 6 additions & 6 deletions Samples/DXGIDesktopDuplication/cpp/DesktopDuplication.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down Expand Up @@ -91,7 +91,7 @@
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
<EnableDpiAwareness>true</EnableDpiAwareness>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -108,7 +108,7 @@
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
<EnableDpiAwareness>true</EnableDpiAwareness>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down
49 changes: 25 additions & 24 deletions Samples/DXGIDesktopDuplication/cpp/DisplayManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ void DISPLAYMANAGER::InitD3D(DX_RESOURCES* Data)
//
// Process a given frame and its metadata
//
DUPL_RETURN DISPLAYMANAGER::ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Texture2D* SharedSurf, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc)
DUPL_RETURN DISPLAYMANAGER::ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Texture2D1* SharedSurf, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc)
{
DUPL_RETURN Ret = DUPL_RETURN_SUCCESS;

// Process dirties and moves
if (Data->FrameInfo.TotalMetadataBufferSize)
{
D3D11_TEXTURE2D_DESC Desc;
Data->Frame->GetDesc(&Desc);
D3D11_TEXTURE2D_DESC1 Desc;
Data->Frame->GetDesc1(&Desc);

if (Data->MoveCount)
{
Expand All @@ -92,7 +92,7 @@ DUPL_RETURN DISPLAYMANAGER::ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Te
//
// Returns D3D device being used
//
ID3D11Device* DISPLAYMANAGER::GetDevice()
ID3D11Device5* DISPLAYMANAGER::GetDevice()
{
return m_Device;
}
Expand Down Expand Up @@ -166,21 +166,21 @@ void DISPLAYMANAGER::SetMoveRect(_Out_ RECT* SrcRect, _Out_ RECT* DestRect, _In_
//
// Copy move rectangles
//
DUPL_RETURN DISPLAYMANAGER::CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(MoveCount) DXGI_OUTDUPL_MOVE_RECT* MoveBuffer, UINT MoveCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, INT TexWidth, INT TexHeight)
DUPL_RETURN DISPLAYMANAGER::CopyMove(_Inout_ ID3D11Texture2D1* SharedSurf, _In_reads_(MoveCount) DXGI_OUTDUPL_MOVE_RECT* MoveBuffer, UINT MoveCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, INT TexWidth, INT TexHeight)
{
D3D11_TEXTURE2D_DESC FullDesc;
SharedSurf->GetDesc(&FullDesc);
D3D11_TEXTURE2D_DESC1 FullDesc;
SharedSurf->GetDesc1(&FullDesc);

// Make new intermediate surface to copy into for moving
if (!m_MoveSurf)
{
D3D11_TEXTURE2D_DESC MoveDesc;
D3D11_TEXTURE2D_DESC1 MoveDesc;
MoveDesc = FullDesc;
MoveDesc.Width = DeskDesc->DesktopCoordinates.right - DeskDesc->DesktopCoordinates.left;
MoveDesc.Height = DeskDesc->DesktopCoordinates.bottom - DeskDesc->DesktopCoordinates.top;
MoveDesc.BindFlags = D3D11_BIND_RENDER_TARGET;
MoveDesc.MiscFlags = 0;
HRESULT hr = m_Device->CreateTexture2D(&MoveDesc, nullptr, &m_MoveSurf);
MoveDesc.MiscFlags = 0;
HRESULT hr = m_Device->CreateTexture2D1(&MoveDesc, nullptr, &m_MoveSurf);
if (FAILED(hr))
{
return ProcessFailure(m_Device, L"Failed to create staging texture for move rects", L"Error", hr, SystemTransitionsExpectedErrors);
Expand All @@ -202,7 +202,7 @@ DUPL_RETURN DISPLAYMANAGER::CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_re
Box.right = SrcRect.right + DeskDesc->DesktopCoordinates.left - OffsetX;
Box.bottom = SrcRect.bottom + DeskDesc->DesktopCoordinates.top - OffsetY;
Box.back = 1;
m_DeviceContext->CopySubresourceRegion(m_MoveSurf, 0, SrcRect.left, SrcRect.top, 0, SharedSurf, 0, &Box);
m_DeviceContext->CopySubresourceRegion1(m_MoveSurf, 0, SrcRect.left, SrcRect.top, 0, SharedSurf, 0, &Box, 0);

// Copy back to shared surface
Box.left = SrcRect.left;
Expand All @@ -211,7 +211,7 @@ DUPL_RETURN DISPLAYMANAGER::CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_re
Box.right = SrcRect.right;
Box.bottom = SrcRect.bottom;
Box.back = 1;
m_DeviceContext->CopySubresourceRegion(SharedSurf, 0, DestRect.left + DeskDesc->DesktopCoordinates.left - OffsetX, DestRect.top + DeskDesc->DesktopCoordinates.top - OffsetY, 0, m_MoveSurf, 0, &Box);
m_DeviceContext->CopySubresourceRegion1(SharedSurf, 0, DestRect.left + DeskDesc->DesktopCoordinates.left - OffsetX, DestRect.top + DeskDesc->DesktopCoordinates.top - OffsetY, 0, m_MoveSurf, 0, &Box, 0);
}

return DUPL_RETURN_SUCCESS;
Expand All @@ -223,7 +223,7 @@ DUPL_RETURN DISPLAYMANAGER::CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_re
#pragma warning(push)
#pragma warning(disable:__WARNING_USING_UNINIT_VAR) // false positives in SetDirtyVert due to tool bug

void DISPLAYMANAGER::SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _In_ RECT* Dirty, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ D3D11_TEXTURE2D_DESC* FullDesc, _In_ D3D11_TEXTURE2D_DESC* ThisDesc)
void DISPLAYMANAGER::SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _In_ RECT* Dirty, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ D3D11_TEXTURE2D_DESC1* FullDesc, _In_ D3D11_TEXTURE2D_DESC1* ThisDesc)
{
INT CenterX = FullDesc->Width / 2;
INT CenterY = FullDesc->Height / 2;
Expand Down Expand Up @@ -314,45 +314,46 @@ void DISPLAYMANAGER::SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _I
//
// Copies dirty rectangles
//
DUPL_RETURN DISPLAYMANAGER::CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(DirtyCount) RECT* DirtyBuffer, UINT DirtyCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc)
DUPL_RETURN DISPLAYMANAGER::CopyDirty(_In_ ID3D11Texture2D1* SrcSurface, _Inout_ ID3D11Texture2D1* SharedSurf, _In_reads_(DirtyCount) RECT* DirtyBuffer, UINT DirtyCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc)
{
HRESULT hr;

D3D11_TEXTURE2D_DESC FullDesc;
SharedSurf->GetDesc(&FullDesc);
D3D11_TEXTURE2D_DESC1 FullDesc;
SharedSurf->GetDesc1(&FullDesc);

D3D11_TEXTURE2D_DESC ThisDesc;
SrcSurface->GetDesc(&ThisDesc);
D3D11_TEXTURE2D_DESC1 ThisDesc;
SrcSurface->GetDesc1(&ThisDesc);

if (!m_RTV)
{
hr = m_Device->CreateRenderTargetView(SharedSurf, nullptr, &m_RTV);
hr = m_Device->CreateRenderTargetView1(SharedSurf, nullptr, &m_RTV);
if (FAILED(hr))
{
return ProcessFailure(m_Device, L"Failed to create render target view for dirty rects", L"Error", hr, SystemTransitionsExpectedErrors);
}
}

D3D11_SHADER_RESOURCE_VIEW_DESC ShaderDesc;
D3D11_SHADER_RESOURCE_VIEW_DESC1 ShaderDesc;
ShaderDesc.Format = ThisDesc.Format;
ShaderDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
ShaderDesc.Texture2D.MostDetailedMip = ThisDesc.MipLevels - 1;
ShaderDesc.Texture2D.MipLevels = ThisDesc.MipLevels;
ShaderDesc.Texture2D.PlaneSlice = 0;

// Create new shader resource view
ID3D11ShaderResourceView* ShaderResource = nullptr;
hr = m_Device->CreateShaderResourceView(SrcSurface, &ShaderDesc, &ShaderResource);
ID3D11ShaderResourceView1* ShaderResource = nullptr;
hr = m_Device->CreateShaderResourceView1(SrcSurface, &ShaderDesc, &ShaderResource);
if (FAILED(hr))
{
return ProcessFailure(m_Device, L"Failed to create shader resource view for dirty rects", L"Error", hr, SystemTransitionsExpectedErrors);
}

FLOAT BlendFactor[4] = {0.f, 0.f, 0.f, 0.f};
m_DeviceContext->OMSetBlendState(nullptr, BlendFactor, 0xFFFFFFFF);
m_DeviceContext->OMSetRenderTargets(1, &m_RTV, nullptr);
m_DeviceContext->OMSetRenderTargets(1, reinterpret_cast<ID3D11RenderTargetView * const*>(&m_RTV), nullptr);
m_DeviceContext->VSSetShader(m_VertexShader, nullptr, 0);
m_DeviceContext->PSSetShader(m_PixelShader, nullptr, 0);
m_DeviceContext->PSSetShaderResources(0, 1, &ShaderResource);
m_DeviceContext->PSSetShaderResources(0, 1, reinterpret_cast<ID3D11ShaderResourceView * const*> (&ShaderResource));
m_DeviceContext->PSSetSamplers(0, 1, &m_SamplerLinear);
m_DeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);

Expand Down
18 changes: 9 additions & 9 deletions Samples/DXGIDesktopDuplication/cpp/DisplayManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ class DISPLAYMANAGER
DISPLAYMANAGER();
~DISPLAYMANAGER();
void InitD3D(DX_RESOURCES* Data);
ID3D11Device* GetDevice();
DUPL_RETURN ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Texture2D* SharedSurf, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
ID3D11Device5* GetDevice();
DUPL_RETURN ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Texture2D1* SharedSurf, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
void CleanRefs();

private:
// methods
DUPL_RETURN CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(DirtyCount) RECT* DirtyBuffer, UINT DirtyCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
DUPL_RETURN CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(MoveCount) DXGI_OUTDUPL_MOVE_RECT* MoveBuffer, UINT MoveCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, INT TexWidth, INT TexHeight);
void SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _In_ RECT* Dirty, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ D3D11_TEXTURE2D_DESC* FullDesc, _In_ D3D11_TEXTURE2D_DESC* ThisDesc);
DUPL_RETURN CopyDirty(_In_ ID3D11Texture2D1* SrcSurface, _Inout_ ID3D11Texture2D1* SharedSurf, _In_reads_(DirtyCount) RECT* DirtyBuffer, UINT DirtyCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
DUPL_RETURN CopyMove(_Inout_ ID3D11Texture2D1* SharedSurf, _In_reads_(MoveCount) DXGI_OUTDUPL_MOVE_RECT* MoveBuffer, UINT MoveCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, INT TexWidth, INT TexHeight);
void SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _In_ RECT* Dirty, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ D3D11_TEXTURE2D_DESC1* FullDesc, _In_ D3D11_TEXTURE2D_DESC1* ThisDesc);
void SetMoveRect(_Out_ RECT* SrcRect, _Out_ RECT* DestRect, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ DXGI_OUTDUPL_MOVE_RECT* MoveRect, INT TexWidth, INT TexHeight);

// variables
ID3D11Device* m_Device;
ID3D11DeviceContext* m_DeviceContext;
ID3D11Texture2D* m_MoveSurf;
ID3D11Device5* m_Device;
ID3D11DeviceContext4* m_DeviceContext;
ID3D11Texture2D1* m_MoveSurf;
ID3D11VertexShader* m_VertexShader;
ID3D11PixelShader* m_PixelShader;
ID3D11InputLayout* m_InputLayout;
ID3D11RenderTargetView* m_RTV;
ID3D11RenderTargetView1* m_RTV;
ID3D11SamplerState* m_SamplerLinear;
BYTE* m_DirtyVertexBufferAlloc;
UINT m_DirtyVertexBufferAllocSize;
Expand Down
Loading