Debian Codegraph @

xbmc/windowing/win10/WinSystemWin10DX.h

raw
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
15 class CWinSystemWin10DX : public CWinSystemWin10, public CRenderSystemDX
16 {
17 public:
18 CWinSystemWin10DX();
19 ~CWinSystemWin10DX();
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
42 /*!
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
49 */
50 void Register(ID3DResource *resource) const
51 {
52 m_deviceResources->Register(resource);
53 };
54 /*!
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
58 */
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
81 DEBUG_INFO_RENDER GetDebugInfo() override;
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