DisplayManager.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright (c) Microsoft Corporation. All rights reserved
  7. #ifndef _DISPLAYMANAGER_H_
  8. #define _DISPLAYMANAGER_H_
  9. #include "CommonTypes.h"
  10. //
  11. // Handles the task of processing frames
  12. //
  13. class DISPLAYMANAGER
  14. {
  15. public:
  16. DISPLAYMANAGER();
  17. ~DISPLAYMANAGER();
  18. void InitD3D(DX_RESOURCES* Data);
  19. ID3D11Device* GetDevice();
  20. DUPL_RETURN ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Texture2D* SharedSurf, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc);
  21. void CleanRefs();
  22. private:
  23. // methods
  24. 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);
  25. 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);
  26. 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);
  27. void SetMoveRect(_Out_ RECT* SrcRect, _Out_ RECT* DestRect, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ DXGI_OUTDUPL_MOVE_RECT* MoveRect, INT TexWidth, INT TexHeight);
  28. // variables
  29. ID3D11Device* m_Device;
  30. ID3D11DeviceContext* m_DeviceContext;
  31. ID3D11Texture2D* m_MoveSurf;
  32. ID3D11VertexShader* m_VertexShader;
  33. ID3D11PixelShader* m_PixelShader;
  34. ID3D11InputLayout* m_InputLayout;
  35. ID3D11RenderTargetView* m_RTV;
  36. ID3D11SamplerState* m_SamplerLinear;
  37. BYTE* m_DirtyVertexBufferAlloc;
  38. UINT m_DirtyVertexBufferAllocSize;
  39. };
  40. #endif