This commit is contained in:
Branimir Karadžić 2015-10-09 19:21:42 -07:00
parent e627c4a4d6
commit 09e6aa3d9a
2 changed files with 91 additions and 87 deletions

View file

@ -11,7 +11,7 @@
#if BX_PLATFORM_WINRT
# include <inspectable.h>
# include <windows.ui.xaml.media.dxinterop.h>
#endif
#endif // BX_PLATFORM_WINRT
namespace bgfx { namespace d3d11
{
@ -1023,11 +1023,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_scd.SampleDesc.Quality = 0;
m_scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
m_scd.BufferCount = 2;
m_scd.Scaling = (g_platformData.ndt == 0) ? DXGI_SCALING_NONE : DXGI_SCALING_STRETCH;
m_scd.Scaling = 0 == g_platformData.ndt
? DXGI_SCALING_NONE
: DXGI_SCALING_STRETCH;
m_scd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
m_scd.AlphaMode = DXGI_ALPHA_MODE_IGNORE;
if (g_platformData.ndt == 0)
if (NULL == g_platformData.ndt)
{
hr = m_factory->CreateSwapChainForCoreWindow(m_device
, (::IUnknown*)g_platformData.nwh
@ -1041,19 +1043,19 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
BGFX_FATAL(g_platformData.ndt == reinterpret_cast<void*>(1), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
hr = m_factory->CreateSwapChainForComposition(
m_device,
&m_scd,
NULL,
&m_swapChain);
hr = m_factory->CreateSwapChainForComposition(m_device
, &m_scd
, NULL
, &m_swapChain
);
BX_WARN(SUCCEEDED(hr), "Unable to create Direct3D11 swap chain.");
IInspectable* nativeWindow = reinterpret_cast<IInspectable *>(g_platformData.nwh);
ISwapChainBackgroundPanelNative* panel = nullptr;
ISwapChainBackgroundPanelNative* panel = NULL;
hr = nativeWindow->QueryInterface(__uuidof(ISwapChainBackgroundPanelNative), (void**)&panel);
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
if (panel != nullptr)
if (NULL != panel)
{
hr = panel->SetSwapChain(m_swapChain);
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
@ -2169,19 +2171,19 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
BGFX_FATAL(g_platformData.ndt == reinterpret_cast<void*>(1), Fatal::UnableToInitialize, "Invalid native display type.");
hr = m_factory->CreateSwapChainForComposition(
m_device,
&m_scd,
NULL,
&m_swapChain);
hr = m_factory->CreateSwapChainForComposition(m_device
, &m_scd
, NULL
, &m_swapChain
);
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 swap chain.");
IInspectable *nativeWindow = reinterpret_cast<IInspectable *>(g_platformData.nwh);
ISwapChainBackgroundPanelNative* panel = nullptr;
ISwapChainBackgroundPanelNative* panel = NULL;
hr = nativeWindow->QueryInterface(__uuidof(ISwapChainBackgroundPanelNative), (void **)&panel);
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
if (panel != nullptr)
if (NULL != panel)
{
hr = panel->SetSwapChain(m_swapChain);
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
@ -3321,7 +3323,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
void trim()
{
if (s_renderD3D11)
#if BX_PLATFORM_WINRT
if (NULL != s_renderD3D11)
{
if (s_renderD3D11->m_device)
{
@ -3334,6 +3337,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
}
}
#endif // BX_PLATFORM_WINRT
}
void stubMultiDrawInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride)

View file

@ -20,7 +20,7 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4005) // warning C4005: '' : macro redefinitio
#include <sal.h>
#define D3D11_NO_HELPERS
#if BX_PLATFORM_WINRT
# include <d3d11_2.h>
# include <d3d11_3.h>
#else
# include <d3d11.h>
#endif // BX_PLATFORM_WINRT