kodi
WinSystemWin10DX.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "HDRStatus.h"
12 #include "WinSystemWin10.h"
13 #include "rendering/dx/RenderSystemDX.h"
14 
16 {
17 public:
20 
21  static void Register();
22  static std::unique_ptr<CWinSystemBase> CreateWinSystem();
23 
24  // Implementation of CWinSystemBase via CWinSystemWin10
25  CRenderSystemBase *GetRenderSystem() override { return this; }
26  bool CreateNewWindow(const std::string& name, bool fullScreen, RESOLUTION_INFO& res) override;
27  bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) override;
28  bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) override;
29  void PresentRenderImpl(bool rendered) override;
30  bool DPIChanged(WORD dpi, RECT windowRect) const override;
31  bool DestroyRenderSystem() override;
32  void* GetHWContext() override { return m_deviceResources->GetD3DContext(); }
33 
34  void UninitHooks();
35  void InitHooks(IDXGIOutput* pOutput);
36 
37  void OnMove(int x, int y) override;
38  void OnResize(int width, int height);
39  winrt::Windows::Foundation::Size GetOutputSize() const { return m_deviceResources->GetOutputSize(); }
40  void TrimDevice() const { m_deviceResources->Trim(); }
41 
50  void Register(ID3DResource *resource) const
51  {
52  m_deviceResources->Register(resource);
53  };
59  void Unregister(ID3DResource *resource) const
60  {
61  m_deviceResources->Unregister(resource);
62  };
63 
64  void Register(IDispResource* resource) override { CWinSystemWin10::Register(resource); }
65  void Unregister(IDispResource* resource) override { CWinSystemWin10::Unregister(resource); }
66 
67  void ShowSplash(const std::string& message) override;
68 
69  // HDR OS/display override
70  bool IsHDRDisplay() override;
71  HDR_STATUS ToggleHDR() override;
72  HDR_STATUS GetOSHDRStatus() override;
73 
74  // HDR support
75  bool IsHDROutput() const;
76  bool IsTransferPQ() const;
77  void SetHdrMetaData(DXGI_HDR_METADATA_HDR10& hdr10) const;
78  void SetHdrColorSpace(const DXGI_COLOR_SPACE_TYPE colorSpace) const;
79 
80  // Get debug info from swapchain
82 
83 protected:
84  void SetDeviceFullScreen(bool fullScreen, RESOLUTION_INFO& res) override;
85  void ReleaseBackBuffer() override;
86  void CreateBackBuffer() override;
87  void ResizeDeviceBuffers() override;
88  bool IsStereoEnabled() override;
89 };
90 
void * GetHWContext() override
Get OS specific hardware context.
Definition: WinSystemWin10DX.h:32
Definition: RenderSystemDX.h:25
Definition: WinSystemWin10DX.h:15
Definition: RenderSystem.h:27
Definition: DispResource.h:14
Provide info of a resolution.
Definition: Resolution.h:66
Definition: DebugInfo.h:30
Definition: D3DResource.h:36
void Unregister(ID3DResource *resource) const
Unregister as a dependent of the DirectX Render System Resources should call this on destruction if t...
Definition: WinSystemWin10DX.h:59
DEBUG_INFO_RENDER GetDebugInfo() override
Gets debug info from video renderer for use in "Debug Info OSD" (Alt + O)
Definition: WinSystemWin10DX.cpp:217
void Register(ID3DResource *resource) const
Register as a dependent of the DirectX Render System Resources should call this on construction if th...
Definition: WinSystemWin10DX.h:50
Definition: WinSystemWin10.h:63