This commit is contained in:
Бранимир Караџић 2023-10-17 07:37:29 -07:00
parent d952e5cfb3
commit 448a42a8c6
1 changed files with 13 additions and 8 deletions

View File

@ -27,8 +27,8 @@ namespace WinUI3
ISwapChainPanelNative : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetSwapChain(
/* [annotation][in] */
virtual HRESULT STDMETHODCALLTYPE SetSwapChain(
/* [annotation][in] */
_In_ IDXGISwapChain *swapChain) = 0;
};
@ -37,8 +37,8 @@ namespace WinUI3
ISwapChainBackgroundPanelNative : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetSwapChain(
/* [annotation][in] */
virtual HRESULT STDMETHODCALLTYPE SetSwapChain(
/* [annotation][in] */
_In_ IDXGISwapChain *swapChain) = 0;
};
}
@ -144,14 +144,14 @@ namespace bgfx
{
ISwapChainPanelNative* swapChainPanelNative = NULL;
if (NULL != nativeWindow && FAILED(nativeWindow->QueryInterface(__uuidof(T), (void**)&swapChainPanelNative))
if (FAILED(nativeWindow->QueryInterface(__uuidof(T), (void**)&swapChainPanelNative) )
|| NULL == swapChainPanelNative)
{
return false;
}
*hr = swapChainPanelNative->SetSwapChain(swapChain);
if (SUCCEEDED(*hr))
if (SUCCEEDED(*hr) )
{
DX_RELEASE_I(swapChainPanelNative);
}
@ -167,6 +167,11 @@ namespace bgfx
{
HRESULT hr = S_OK;
if (NULL == nativeWindow)
{
return hr;
}
if (trySetSwapChain<ISwapChainPanelNative>(nativeWindow, swapChain, &hr)
|| trySetSwapChain<ISwapChainBackgroundPanelNative>(nativeWindow, swapChain, &hr)
|| trySetSwapChain<WinUI3::ISwapChainPanelNative>(nativeWindow, swapChain, &hr)
@ -558,7 +563,7 @@ namespace bgfx
# if BX_PLATFORM_WINRT
IInspectable* nativeWindow = reinterpret_cast<IInspectable*>(_scd.nwh);
hr = setSwapChain(nativeWindow, *_swapChain);
if (FAILED(hr))
if (FAILED(hr) )
{
return hr;
}
@ -634,7 +639,7 @@ namespace bgfx
IInspectable* nativeWindow = reinterpret_cast<IInspectable*>(_scd.nwh);
return setSwapChain(nativeWindow, NULL);
}
#endif
#endif // BX_PLATFORM_WINRT
void Dxgi::updateHdr10(SwapChainI* _swapChain, const SwapChainDesc& _scd)
{