mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05: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;
|
||||
WindowHandle handle = { (uint16_t)_wparam };
|
||||
m_eventQueue.postWindowEvent(handle, hwnd);
|
||||
m_eventQueue.postSizeEvent(handle, msg->m_width, msg->m_height);
|
||||
m_eventQueue.postWindowEvent(handle, hwnd);
|
||||
|
||||
delete msg;
|
||||
}
|
||||
|
|
|
@ -2545,13 +2545,24 @@ namespace bgfx
|
|||
|
||||
D3DPRESENT_PARAMETERS params;
|
||||
memcpy(¶ms, &s_renderD3D9->m_params, sizeof(D3DPRESENT_PARAMETERS) );
|
||||
params.BackBufferWidth = _width;
|
||||
params.BackBufferHeight = _height;
|
||||
params.BackBufferWidth = bx::uint32_max(_width, 16);
|
||||
params.BackBufferHeight = bx::uint32_max(_height, 16);
|
||||
|
||||
DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(¶ms, &m_swapChain) );
|
||||
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_depthStencil = NULL;
|
||||
m_denseIdx = _denseIdx;
|
||||
m_num = 1;
|
||||
m_needResolve = false;
|
||||
|
@ -2561,6 +2572,7 @@ namespace bgfx
|
|||
{
|
||||
if (NULL != m_hwnd)
|
||||
{
|
||||
DX_RELEASE(m_depthStencil, 0);
|
||||
DX_RELEASE(m_color[0], 0);
|
||||
DX_RELEASE(m_swapChain, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue