2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "HDRStatus.h"
12 #include "WinSystemWin10.h"
13 #include "rendering/dx/RenderSystemDX.h"
15 class CWinSystemWin10DX
: public CWinSystemWin10
, public CRenderSystemDX
21 static void Register();
22 static std::unique_ptr
<CWinSystemBase
> CreateWinSystem();
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(); }
35 void InitHooks(IDXGIOutput
* pOutput
);
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(); }
43 \brief Register as a dependent of the DirectX Render System
44 Resources should call this on construction if they're dependent on the Render System
45 for survival. Any resources that registers will get callbacks on loss and reset of
46 device. In addition, callbacks for destruction and creation of the device are also called,
47 where any resources dependent on the DirectX device should be destroyed and recreated.
48 \sa Unregister, ID3DResource
50 void Register(ID3DResource
*resource
) const
52 m_deviceResources
->Register(resource
);
55 \brief Unregister as a dependent of the DirectX Render System
56 Resources should call this on destruction if they're a dependent on the Render System
57 \sa Register, ID3DResource
59 void Unregister(ID3DResource
*resource
) const
61 m_deviceResources
->Unregister(resource
);
64 void Register(IDispResource
* resource
) override
{ CWinSystemWin10::Register(resource
); }
65 void Unregister(IDispResource
* resource
) override
{ CWinSystemWin10::Unregister(resource
); }
67 void ShowSplash(const std::string
& message
) override
;
69 // HDR OS/display override
70 bool IsHDRDisplay() override
;
71 HDR_STATUS
ToggleHDR() override
;
72 HDR_STATUS
GetOSHDRStatus() override
;
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;
80 // Get debug info from swapchain
81 DEBUG_INFO_RENDER
GetDebugInfo() override
;
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
;