Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CWinSystemWin32DX Class Reference

#include <WinSystemWin32DX.h>

Inheritance diagram for CWinSystemWin32DX:
CWinSystemWin32 CRenderSystemDX CWinSystemBase CRenderSystemBase

Public Member Functions

 CWinSystemWin32DX ()
 
 ~CWinSystemWin32DX ()
 
CRenderSystemBaseGetRenderSystem () override
 
bool CreateNewWindow (const std::string &name, bool fullScreen, RESOLUTION_INFO &res) override
 
bool ResizeWindow (int newWidth, int newHeight, int newLeft, int newTop) override
 
bool SetFullScreen (bool fullScreen, RESOLUTION_INFO &res, bool blankOtherDisplays) override
 
void PresentRenderImpl (bool rendered) override
 
bool DPIChanged (WORD dpi, RECT windowRect) const override
 
void SetWindow (HWND hWnd) const
 
bool DestroyRenderSystem () override
 
voidGetHWContext () override
 Get OS specific hardware context.
 
void UninitHooks ()
 
void InitHooks (IDXGIOutput *pOutput)
 
void OnMove (int x, int y) override
 
void OnResize (int width, int height)
 
void Register (ID3DResource *resource) const
 Register as a dependent of the DirectX Render System Resources should call this on construction if they're dependent on the Render System for survival. Any resources that registers will get callbacks on loss and reset of device. In addition, callbacks for destruction and creation of the device are also called, where any resources dependent on the DirectX device should be destroyed and recreated.
 
void Unregister (ID3DResource *resource) const
 Unregister as a dependent of the DirectX Render System Resources should call this on destruction if they're a dependent on the Render System.
 
void Register (IDispResource *resource) override
 
void Unregister (IDispResource *resource) override
 
void FixRefreshRateIfNecessary (const D3D10DDIARG_CREATERESOURCE *pResource) const
 
bool IsHDRDisplay () override
 
HDR_STATUS ToggleHDR () override
 
HDR_STATUS GetOSHDRStatus () override
 
bool IsHDROutput () const
 
bool IsTransferPQ () const
 
void SetHdrMetaData (DXGI_HDR_METADATA_HDR10 &hdr10) const
 
void SetHdrColorSpace (const DXGI_COLOR_SPACE_TYPE colorSpace) const
 
DEBUG_INFO_RENDER GetDebugInfo () override
 Gets debug info from video renderer for use in "Debug Info OSD" (Alt + O)
 
bool SupportsVideoSuperResolution () override
 System supports Video Super Resolution HW upscaler i.e.: "NVIDIA RTX Video Super Resolution" or "Intel Video Super Resolution".
 
- Public Member Functions inherited from CWinSystemWin32
 CWinSystemWin32 ()
 
virtual ~CWinSystemWin32 ()
 
bool InitWindowSystem () override
 
bool DestroyWindowSystem () override
 
void FinishWindowResize (int newWidth, int newHeight) override
 
void ForceFullScreen (const RESOLUTION_INFO &resInfo) override
 Forces the window to fullscreen provided the window resolution.
 
void UpdateResolutions () override
 
bool CenterWindow () override
 
virtual void NotifyAppFocusChange (bool bGaining) override
 
void ShowOSMouse (bool show) override
 
bool HasInertialGestures () override
 
bool Minimize () override
 
bool Restore () override
 
bool Hide () override
 
bool Show (bool raise=true) override
 
std::string GetClipboardText () override
 
bool UseLimitedColor () override
 
float GetGuiSdrPeakLuminance () const override
 Max luminance for GUI SDR content in HDR mode.
 
bool HasSystemSdrPeakLuminance () override
 Test support of the OS for a SDR max luminance in HDR mode setting.
 
std::unique_ptr< CVideoSyncGetVideoSync (CVideoReferenceClock *clock) override
 
std::vector< std::string > GetConnectedOutputs () override
 
HWND GetHwnd () const
 
bool IsAlteringWindow () const
 
void SetAlteringWindow (bool altering)
 
bool IsTogglingHDR () const
 
void SetTogglingHDR (bool toggling)
 
bool IsMinimized () const
 
void SetMinimized (bool minimized)
 
void CacheSystemSdrPeakLuminance ()
 Cache the system HDR/SDR balance for use during rendering, instead of querying the API for each frame.
 
void SetSizeMoveMode (bool mode)
 
bool IsInSizeMoveMode () const
 
bool MessagePump () override
 
- Public Member Functions inherited from CWinSystemBase
 CWinSystemBase ()
 
virtual ~CWinSystemBase ()
 
virtual const std::string GetName ()
 
virtual bool DestroyWindow ()
 
virtual bool DisplayHardwareScalingEnabled ()
 
virtual void UpdateDisplayHardwareScaling (const RESOLUTION_INFO &resInfo)
 
virtual void SetDirtyRegions (const CDirtyRegionList &dirtyRegionsList)
 
virtual int GetBufferAge ()
 
virtual bool MoveWindow (int topLeft, int topRight)
 
virtual void FinishModeChange (RESOLUTION res)
 
virtual bool IsCreated ()
 
virtual void NotifyAppActiveChange (bool bActivated)
 
virtual bool HasCursor ()
 
virtual int NoOfBuffers ()
 
virtual float GetDisplayLatency ()
 Get average display latency.
 
virtual float GetFrameLatencyAdjustment ()
 Get time that should be subtracted from the display latency for this frame in milliseconds.
 
virtual unsigned int GetScreenId (const std::string &screen)
 Get the screen ID provided the screen name.
 
virtual void MoveToScreen (unsigned int screenIdx)
 Window was requested to move to the given screen.
 
virtual void OnChangeScreen (unsigned int screenIdx)
 Used to signal the windowing system about the change of the current screen.
 
KODI::WINDOWING::COSScreenSaverManagerGetOSScreenSaver ()
 Get OS screen saver inhibit implementation if available.
 
unsigned int GetWidth ()
 
unsigned int GetHeight ()
 
virtual bool CanDoWindowed ()
 
bool IsFullScreen ()
 
virtual bool SupportsScreenMove ()
 Check if the windowing system supports moving windows across screens.
 
void SetWindowResolution (int width, int height)
 
std::vector< RESOLUTION_WHRScreenResolutions (float refreshrate)
 
std::vector< REFRESHRATERefreshRates (int width, int height, uint32_t dwFlags)
 
REFRESHRATE DefaultRefreshRate (const std::vector< REFRESHRATE > &rates)
 
virtual bool HasCalibration (const RESOLUTION_INFO &resInfo)
 
void RegisterRenderLoop (IRenderLoop *client)
 
void UnregisterRenderLoop (IRenderLoop *client)
 
void DriveRenderLoop ()
 
virtual CGraphicContextGetGfxContext () const
 
std::shared_ptr< CDPMSSupportGetDPMSManager ()
 
virtual bool SetHDR (const VideoPicture *videoPicture)
 Set the HDR metadata. Passing nullptr as the parameter should disable HDR.
 
virtual CHDRCapabilities GetDisplayHDRCapabilities () const
 
bool IsHDRDisplaySettingEnabled ()
 Return true when HDR display is available and enabled in settings.
 
bool IsVideoSuperResolutionSettingEnabled ()
 Return true when "Video Super Resolution" is supported and enabled in settings.
 
bool IsHighPrecisionProcessingSettingEnabled ()
 Return true when setting "High Precision Processing" is enabled.
 
std::pair< bool, intGetDitherSettings ()
 Get dither settings.
 
virtual bool BindTextureUploadContext ()
 Binds a shared context to the current thread, in order to upload textures asynchronously.
 
virtual bool UnbindTextureUploadContext ()
 Unbinds the shared context.
 
virtual bool HasContext ()
 Checks if a graphics context is already bound to the current thread.
 
- Public Member Functions inherited from CRenderSystemDX
 CRenderSystemDX ()
 
virtual ~CRenderSystemDX ()
 
bool InitRenderSystem () override
 
bool BeginRender () override
 
bool EndRender () override
 
void PresentRender (bool rendered, bool videoLayer) override
 
bool ClearBuffers (KODI::UTILS::COLOR::Color color) override
 
void SetViewPort (const CRect &viewPort) override
 
void GetViewPort (CRect &viewPort) override
 
void RestoreViewPort () override
 
CRect ClipRectToScissorRect (const CRect &rect) override
 
bool ScissorsCanEffectClipping () override
 
void SetScissors (const CRect &rect) override
 
void ResetScissors () override
 
void CaptureStateBlock () override
 
void ApplyStateBlock () override
 
void SetCameraPosition (const CPoint &camera, int screenWidth, int screenHeight, float stereoFactor=0.f) override
 
void SetStereoMode (RENDER_STEREO_MODE mode, RENDER_STEREO_VIEW view) override
 
bool SupportsStereo (RENDER_STEREO_MODE mode) const override
 
void Project (float &x, float &y, float &z) override
 
bool SupportsNPOT (bool dxt) const override
 
void OnDXDeviceLost () override
 
void OnDXDeviceRestored () override
 
CGUIShaderDXGetGUIShader () const
 
bool IsFormatSupport (DXGI_FORMAT format, unsigned int usage) const
 
CRect GetBackBufferRect ()
 
CD3DTextureGetBackBuffer ()
 
void FlushGPU () const
 
void RequestDecodingTime ()
 
void ReleaseDecodingTime ()
 
void SetAlphaBlendEnable (bool enable)
 
bool IsExtSupported (const char *extension) const override
 
bool ResetRenderSystem (int width, int height) override
 
- Public Member Functions inherited from CRenderSystemBase
 CRenderSystemBase ()
 
virtual ~CRenderSystemBase ()
 
virtual void InvalidateColorBuffer ()
 
virtual void SetDepthCulling (DEPTH_CULLING culling)
 
virtual std::string GetShaderPath (const std::string &filename)
 
void GetRenderVersion (unsigned int &major, unsigned int &minor) const
 
const std::string & GetRenderVendor () const
 
const std::string & GetRenderRenderer () const
 
const std::string & GetRenderVersionString () const
 
unsigned int GetMaxTextureSize () const
 
unsigned int GetMinDXTPitch () const
 
virtual void ShowSplash (const std::string &message)
 

Static Public Member Functions

static void Register ()
 
static std::unique_ptr< CWinSystemBaseCreateWinSystem ()
 
- Static Public Member Functions inherited from CWinSystemBase
static std::unique_ptr< CWinSystemBaseCreateWinSystem ()
 

Protected Member Functions

void SetDeviceFullScreen (bool fullScreen, RESOLUTION_INFO &res) override
 
void ReleaseBackBuffer () override
 
void CreateBackBuffer () override
 
void ResizeDeviceBuffers () override
 
bool IsStereoEnabled () override
 
void OnScreenChange (HMONITOR monitor) override
 
bool ChangeResolution (const RESOLUTION_INFO &res, bool forceChange=false) override
 
- Protected Member Functions inherited from CWinSystemWin32
virtual void UpdateStates (bool fullScreen)
 
WINDOW_STATE GetState (bool fullScreen) const
 
virtual void AdjustWindow (bool forceResize=false)
 
void CenterCursor () const
 
virtual bool CreateBlankWindows ()
 
virtual bool BlankNonActiveMonitors (bool bBlank)
 
MONITOR_DETAILSGetDisplayDetails (const std::string &name)
 
MONITOR_DETAILSGetDisplayDetails (HMONITOR handle)
 
void RestoreDesktopResolution (MONITOR_DETAILS *details)
 
RECT ScreenRect (HMONITOR handle)
 
void GetConnectedDisplays (std::vector< MONITOR_DETAILS > &outputs)
 
void OnDisplayLost ()
 
void OnDisplayReset ()
 
void OnDisplayBack ()
 
void ResolutionChanged ()
 
RECT GetScreenWorkArea (HMONITOR handle) const
 
RECT GetNcAreaOffsets (DWORD dwStyle, BOOL bMenu, DWORD dwExStyle) const
 
- Protected Member Functions inherited from CWinSystemBase
void UpdateDesktopResolution (RESOLUTION_INFO &newRes, const std::string &output, int width, int height, float refreshRate, uint32_t dwFlags)
 
void UpdateDesktopResolution (RESOLUTION_INFO &newRes, const std::string &output, int width, int height, int screenWidth, int screenHeight, float refreshRate, uint32_t dwFlags)
 
virtual std::unique_ptr< KODI::WINDOWING::IOSScreenSaverGetOSScreenSaverImpl ()
 
- Protected Member Functions inherited from CRenderSystemDX
bool CreateStates ()
 
bool InitGUIShader ()
 
void OnResize ()
 
void CheckInterlacedStereoView (void)
 
void CheckDeviceCaps ()
 

Protected Attributes

HMODULE m_hDriverModule
 
- Protected Attributes inherited from CWinSystemWin32
HWND m_hWnd
 
HMONITOR m_hMonitor
 
std::vector< HWND > m_hBlankWindows
 
HINSTANCE m_hInstance
 
HICON m_hIcon
 
bool m_ValidWindowedPosition
 
bool m_IsAlteringWindow
 
bool m_IsTogglingHDR {false}
 
CCriticalSection m_resourceSection
 
std::vector< IDispResource * > m_resources
 
bool m_delayDispReset
 
XbmcThreads::EndTime m_dispResetTimer
 
WINDOW_STATE m_state
 
WINDOW_FULLSCREEN_STATE m_fullscreenState
 
WINDOW_WINDOW_STATE m_windowState
 
DWORD m_windowStyle
 
DWORD m_windowExStyle
 
bool m_inFocus
 
bool m_bMinimized
 
bool m_bSizeMoveEnabled = false
 
bool m_bFirstResChange = true
 
std::unique_ptr< CIRServerSuitem_irss
 
std::vector< MONITOR_DETAILSm_displays
 
NOTIFYICONDATA m_trayIcon = {}
 
bool m_validSystemSdrPeakLuminance {false}
 
float m_systemSdrPeakLuminance {.0f}
 
- Protected Attributes inherited from CWinSystemBase
int m_nWidth = 0
 
int m_nHeight = 0
 
int m_nTop = 0
 
int m_nLeft = 0
 
bool m_bWindowCreated = false
 
bool m_bFullScreen = false
 
bool m_bBlankOtherDisplay = false
 
float m_fRefreshRate = 0.0f
 
std::unique_ptr< KODI::WINDOWING::COSScreenSaverManagerm_screenSaverManager
 
CCriticalSection m_renderLoopSection
 
std::vector< IRenderLoop * > m_renderLoopClients
 
std::unique_ptr< IWinEventsm_winEvents
 
std::unique_ptr< CGraphicContextm_gfxContext
 
std::shared_ptr< CDPMSSupportm_dpms
 
- Protected Attributes inherited from CRenderSystemDX
CCriticalSection m_resourceSection
 
CCriticalSection m_decoderSection
 
bool m_inScene { false }
 True if we're in a BeginScene()/EndScene() block.
 
bool m_BlendEnabled { false }
 
bool m_ScissorsEnabled { false }
 
D3D11_VIEWPORT m_viewPort
 
CRect m_scissor
 
CGUIShaderDXm_pGUIShader { nullptr }
 
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > m_depthStencilState
 
Microsoft::WRL::ComPtr< ID3D11BlendState > m_BlendEnableState
 
Microsoft::WRL::ComPtr< ID3D11BlendState > m_BlendDisableState
 
Microsoft::WRL::ComPtr< ID3D11RasterizerState > m_RSScissorDisable
 
Microsoft::WRL::ComPtr< ID3D11RasterizerState > m_RSScissorEnable
 
CD3DTexture m_rightEyeTex
 
XbmcThreads::EndTime m_decodingTimer
 
XbmcThreads::ConditionVariable m_decodingEvent
 
std::shared_ptr< DX::DeviceResourcesm_deviceResources
 
- Protected Attributes inherited from CRenderSystemBase
bool m_bRenderCreated
 
bool m_bVSync
 
unsigned int m_maxTextureSize
 
unsigned int m_minDXTPitch
 
std::string m_RenderRenderer
 
std::string m_RenderVendor
 
std::string m_RenderVersion
 
int m_RenderVersionMinor
 
int m_RenderVersionMajor
 
RENDER_STEREO_VIEW m_stereoView = RENDER_STEREO_VIEW_OFF
 
RENDER_STEREO_MODE m_stereoMode = RENDER_STEREO_MODE_OFF
 
bool m_limitedColorRange = false
 
bool m_transferPQ {false}
 
std::unique_ptr< CGUIImagem_splashImage
 
std::unique_ptr< CGUITextLayoutm_splashMessageLayout
 

Additional Inherited Members

- Static Public Attributes inherited from CWinSystemBase
static const char * SETTING_WINSYSTEM_IS_HDR_DISPLAY = "winsystem.ishdrdisplay"
 
- Static Protected Member Functions inherited from CWinSystemWin32
static bool AddResolution (const RESOLUTION_INFO &res)
 Adds a resolution to the list of resolutions if we don't already have it.
 
static void SetForegroundWindowInternal (HWND hWnd)
 
static RECT GetVirtualScreenRect ()
 
- Static Protected Attributes inherited from CWinSystemWin32
static const char * SETTING_WINDOW_TOP = "window.top"
 
static const char * SETTING_WINDOW_LEFT = "window.left"
 

Constructor & Destructor Documentation

◆ CWinSystemWin32DX()

CWinSystemWin32DX::CWinSystemWin32DX ( )

◆ ~CWinSystemWin32DX()

CWinSystemWin32DX::~CWinSystemWin32DX ( )

Member Function Documentation

◆ ChangeResolution()

bool CWinSystemWin32DX::ChangeResolution ( const RESOLUTION_INFO & res,
bool forceChange = false )
overrideprotectedvirtual

Reimplemented from CWinSystemWin32.

◆ CreateBackBuffer()

void CWinSystemWin32DX::CreateBackBuffer ( )
overrideprotectedvirtual

Implements CWinSystemWin32.

◆ CreateNewWindow()

bool CWinSystemWin32DX::CreateNewWindow ( const std::string & name,
bool fullScreen,
RESOLUTION_INFO & res )
overridevirtual

Implements CWinSystemWin32.

◆ CreateWinSystem()

std::unique_ptr< CWinSystemBase > CWinSystemWin32DX::CreateWinSystem ( )
static

◆ DestroyRenderSystem()

bool CWinSystemWin32DX::DestroyRenderSystem ( )
overridevirtual

Reimplemented from CRenderSystemDX.

◆ DPIChanged()

bool CWinSystemWin32DX::DPIChanged ( WORD dpi,
RECT windowRect ) const
overridevirtual

Reimplemented from CWinSystemWin32.

◆ FixRefreshRateIfNecessary()

void CWinSystemWin32DX::FixRefreshRateIfNecessary ( const D3D10DDIARG_CREATERESOURCE * pResource) const

◆ GetDebugInfo()

DEBUG_INFO_RENDER CWinSystemWin32DX::GetDebugInfo ( )
overridevirtual

Gets debug info from video renderer for use in "Debug Info OSD" (Alt + O)

Reimplemented from CWinSystemBase.

◆ GetHWContext()

void * CWinSystemWin32DX::GetHWContext ( )
inlineoverridevirtual

Get OS specific hardware context.

Returns
OS specific context or nullptr if OS not have
Note
This function is currently only related to Windows with DirectX, all other OS where use GL returns nullptr. Returned Windows class pointer is ID3D11DeviceContext1.

Reimplemented from CWinSystemBase.

◆ GetOSHDRStatus()

HDR_STATUS CWinSystemWin32DX::GetOSHDRStatus ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ GetRenderSystem()

CRenderSystemBase * CWinSystemWin32DX::GetRenderSystem ( )
inlineoverridevirtual

Reimplemented from CWinSystemBase.

◆ InitHooks()

void CWinSystemWin32DX::InitHooks ( IDXGIOutput * pOutput)

◆ IsHDRDisplay()

bool CWinSystemWin32DX::IsHDRDisplay ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ IsHDROutput()

bool CWinSystemWin32DX::IsHDROutput ( ) const

◆ IsStereoEnabled()

bool CWinSystemWin32DX::IsStereoEnabled ( )
overrideprotectedvirtual

Implements CWinSystemWin32.

◆ IsTransferPQ()

bool CWinSystemWin32DX::IsTransferPQ ( ) const

◆ OnMove()

void CWinSystemWin32DX::OnMove ( int x,
int y )
overridevirtual

Reimplemented from CWinSystemBase.

◆ OnResize()

void CWinSystemWin32DX::OnResize ( int width,
int height )

◆ OnScreenChange()

void CWinSystemWin32DX::OnScreenChange ( HMONITOR monitor)
overrideprotectedvirtual

Implements CWinSystemWin32.

◆ PresentRenderImpl()

void CWinSystemWin32DX::PresentRenderImpl ( bool rendered)
overridevirtual

Implements CRenderSystemDX.

◆ Register() [1/3]

void CWinSystemWin32DX::Register ( )
static

◆ Register() [2/3]

void CWinSystemWin32DX::Register ( ID3DResource * resource) const
inline

Register as a dependent of the DirectX Render System Resources should call this on construction if they're dependent on the Render System for survival. Any resources that registers will get callbacks on loss and reset of device. In addition, callbacks for destruction and creation of the device are also called, where any resources dependent on the DirectX device should be destroyed and recreated.

See also
Unregister, ID3DResource

◆ Register() [3/3]

void CWinSystemWin32DX::Register ( IDispResource * resource)
inlineoverridevirtual

Reimplemented from CWinSystemWin32.

◆ ReleaseBackBuffer()

void CWinSystemWin32DX::ReleaseBackBuffer ( )
overrideprotectedvirtual

Implements CWinSystemWin32.

◆ ResizeDeviceBuffers()

void CWinSystemWin32DX::ResizeDeviceBuffers ( )
overrideprotectedvirtual

Implements CWinSystemWin32.

◆ ResizeWindow()

bool CWinSystemWin32DX::ResizeWindow ( int newWidth,
int newHeight,
int newLeft,
int newTop )
overridevirtual

Reimplemented from CWinSystemWin32.

◆ SetDeviceFullScreen()

void CWinSystemWin32DX::SetDeviceFullScreen ( bool fullScreen,
RESOLUTION_INFO & res )
overrideprotectedvirtual

Implements CWinSystemWin32.

◆ SetFullScreen()

bool CWinSystemWin32DX::SetFullScreen ( bool fullScreen,
RESOLUTION_INFO & res,
bool blankOtherDisplays )
overridevirtual

Reimplemented from CWinSystemWin32.

◆ SetHdrColorSpace()

void CWinSystemWin32DX::SetHdrColorSpace ( const DXGI_COLOR_SPACE_TYPE colorSpace) const

◆ SetHdrMetaData()

void CWinSystemWin32DX::SetHdrMetaData ( DXGI_HDR_METADATA_HDR10 & hdr10) const

◆ SetWindow()

void CWinSystemWin32DX::SetWindow ( HWND hWnd) const

◆ SupportsVideoSuperResolution()

bool CWinSystemWin32DX::SupportsVideoSuperResolution ( )
overridevirtual

System supports Video Super Resolution HW upscaler i.e.: "NVIDIA RTX Video Super Resolution" or "Intel Video Super Resolution".

Reimplemented from CWinSystemBase.

◆ ToggleHDR()

HDR_STATUS CWinSystemWin32DX::ToggleHDR ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ UninitHooks()

void CWinSystemWin32DX::UninitHooks ( )

◆ Unregister() [1/2]

void CWinSystemWin32DX::Unregister ( ID3DResource * resource) const
inline

Unregister as a dependent of the DirectX Render System Resources should call this on destruction if they're a dependent on the Render System.

See also
Register, ID3DResource

◆ Unregister() [2/2]

void CWinSystemWin32DX::Unregister ( IDispResource * resource)
inlineoverridevirtual

Reimplemented from CWinSystemWin32.

Member Data Documentation

◆ m_hDriverModule

HMODULE CWinSystemWin32DX::m_hDriverModule
protected

The documentation for this class was generated from the following files: