OutputManager.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 _OUTPUTMANAGER_H_
  8. #define _OUTPUTMANAGER_H_
  9. #include <stdio.h>
  10. #include "CommonTypes.h"
  11. #include "warning.h"
  12. //
  13. // Handles the task of drawing into a window.
  14. // Has the functionality to draw the mouse given a mouse shape buffer and position
  15. //
  16. class OUTPUTMANAGER
  17. {
  18. public:
  19. OUTPUTMANAGER();
  20. ~OUTPUTMANAGER();
  21. DUPL_RETURN InitOutput(HWND Window, INT SingleOutput, _Out_ UINT* OutCount, _Out_ RECT* DeskBounds);
  22. DUPL_RETURN UpdateApplicationWindow(_In_ PTR_INFO* PointerInfo, _Inout_ bool* Occluded);
  23. void CleanRefs();
  24. HANDLE GetSharedHandle();
  25. void WindowResize();
  26. private:
  27. // Methods
  28. DUPL_RETURN ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInfo, _Out_ INT* PtrWidth, _Out_ INT* PtrHeight, _Out_ INT* PtrLeft, _Out_ INT* PtrTop, _Outptr_result_bytebuffer_(*PtrHeight **PtrWidth * BPP) BYTE** InitBuffer, _Out_ D3D11_BOX* Box);
  29. DUPL_RETURN MakeRTV();
  30. void SetViewPort(UINT Width, UINT Height);
  31. DUPL_RETURN InitShaders();
  32. DUPL_RETURN InitGeometry();
  33. DUPL_RETURN CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCount, _Out_ RECT* DeskBounds);
  34. DUPL_RETURN DrawFrame();
  35. DUPL_RETURN DrawMouse(_In_ PTR_INFO* PtrInfo);
  36. DUPL_RETURN ResizeSwapChain();
  37. // Vars
  38. IDXGISwapChain1* m_SwapChain;
  39. ID3D11Device* m_Device;
  40. IDXGIFactory2* m_Factory;
  41. ID3D11DeviceContext* m_DeviceContext;
  42. ID3D11RenderTargetView* m_RTV;
  43. ID3D11SamplerState* m_SamplerLinear;
  44. ID3D11BlendState* m_BlendState;
  45. ID3D11VertexShader* m_VertexShader;
  46. ID3D11PixelShader* m_PixelShader;
  47. ID3D11InputLayout* m_InputLayout;
  48. ID3D11Texture2D* m_SharedSurf;
  49. IDXGIKeyedMutex* m_KeyMutex;
  50. HWND m_WindowHandle;
  51. bool m_NeedsResize;
  52. DWORD m_OcclusionCookie;
  53. };
  54. #endif