mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-03-23 21:29:51 -04:00
DX9: Fixed swap chain depth creation.
This commit is contained in:
parent
59ba895727
commit
3d3a725812
2 changed files with 18 additions and 6 deletions
|
@ -278,8 +278,8 @@ namespace entry
|
||||||
|
|
||||||
m_hwnd[_wparam] = hwnd;
|
m_hwnd[_wparam] = hwnd;
|
||||||
WindowHandle handle = { (uint16_t)_wparam };
|
WindowHandle handle = { (uint16_t)_wparam };
|
||||||
m_eventQueue.postWindowEvent(handle, hwnd);
|
|
||||||
m_eventQueue.postSizeEvent(handle, msg->m_width, msg->m_height);
|
m_eventQueue.postSizeEvent(handle, msg->m_width, msg->m_height);
|
||||||
|
m_eventQueue.postWindowEvent(handle, hwnd);
|
||||||
|
|
||||||
delete msg;
|
delete msg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2545,13 +2545,24 @@ namespace bgfx
|
||||||
|
|
||||||
D3DPRESENT_PARAMETERS params;
|
D3DPRESENT_PARAMETERS params;
|
||||||
memcpy(¶ms, &s_renderD3D9->m_params, sizeof(D3DPRESENT_PARAMETERS) );
|
memcpy(¶ms, &s_renderD3D9->m_params, sizeof(D3DPRESENT_PARAMETERS) );
|
||||||
params.BackBufferWidth = _width;
|
params.BackBufferWidth = bx::uint32_max(_width, 16);
|
||||||
params.BackBufferHeight = _height;
|
params.BackBufferHeight = bx::uint32_max(_height, 16);
|
||||||
|
|
||||||
DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(¶ms, &m_swapChain) );
|
DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(¶ms, &m_swapChain) );
|
||||||
DX_CHECK(m_swapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &m_color[0]) );
|
DX_CHECK(m_swapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &m_color[0]) );
|
||||||
|
|
||||||
|
DX_CHECK(s_renderD3D9->m_device->CreateDepthStencilSurface(
|
||||||
|
params.BackBufferWidth
|
||||||
|
, params.BackBufferHeight
|
||||||
|
, params.AutoDepthStencilFormat
|
||||||
|
, params.MultiSampleType
|
||||||
|
, params.MultiSampleQuality
|
||||||
|
, FALSE
|
||||||
|
, &m_depthStencil
|
||||||
|
, NULL
|
||||||
|
) );
|
||||||
|
|
||||||
m_colorHandle[0].idx = invalidHandle;
|
m_colorHandle[0].idx = invalidHandle;
|
||||||
m_depthStencil = NULL;
|
|
||||||
m_denseIdx = _denseIdx;
|
m_denseIdx = _denseIdx;
|
||||||
m_num = 1;
|
m_num = 1;
|
||||||
m_needResolve = false;
|
m_needResolve = false;
|
||||||
|
@ -2561,8 +2572,9 @@ namespace bgfx
|
||||||
{
|
{
|
||||||
if (NULL != m_hwnd)
|
if (NULL != m_hwnd)
|
||||||
{
|
{
|
||||||
DX_RELEASE(m_color[0], 0);
|
DX_RELEASE(m_depthStencil, 0);
|
||||||
DX_RELEASE(m_swapChain, 0);
|
DX_RELEASE(m_color[0], 0);
|
||||||
|
DX_RELEASE(m_swapChain, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue