Commit bd1ec9eb authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Cleanup IWineD3DDeviceImpl_GetBackBuffer().

parent 35d5e766
......@@ -4009,22 +4009,31 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface, DWORD
/*****
* Get Back Buffer
*****/
static HRESULT WINAPI IWineD3DDeviceImpl_GetBackBuffer(IWineD3DDevice *iface, UINT iSwapChain, UINT BackBuffer, WINED3DBACKBUFFER_TYPE Type,
IWineD3DSurface **ppBackBuffer) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DSwapChain *swapChain;
static HRESULT WINAPI IWineD3DDeviceImpl_GetBackBuffer(IWineD3DDevice *iface, UINT swapchain_idx,
UINT backbuffer_idx, WINED3DBACKBUFFER_TYPE backbuffer_type, IWineD3DSurface **backbuffer)
{
IWineD3DSwapChain *swapchain;
HRESULT hr;
TRACE("(%p) : BackBuf %d Type %d SwapChain %d returning %p\n", This, BackBuffer, Type, iSwapChain, *ppBackBuffer);
TRACE("iface %p, swapchain_idx %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
iface, swapchain_idx, backbuffer_idx, backbuffer_type, backbuffer);
hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapChain);
if (hr == WINED3D_OK) {
hr = IWineD3DSwapChain_GetBackBuffer(swapChain, BackBuffer, Type, ppBackBuffer);
IWineD3DSwapChain_Release(swapChain);
} else {
*ppBackBuffer = NULL;
hr = IWineD3DDeviceImpl_GetSwapChain(iface, swapchain_idx, &swapchain);
if (FAILED(hr))
{
WARN("Failed to get swapchain %u, hr %#x.\n", swapchain_idx, hr);
return hr;
}
return hr;
hr = IWineD3DSwapChain_GetBackBuffer(swapchain, backbuffer_idx, backbuffer_type, backbuffer);
IWineD3DSwapChain_Release(swapchain);
if (FAILED(hr))
{
WARN("Failed to get backbuffer %u, hr %#x.\n", backbuffer_idx, hr);
return hr;
}
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_GetDeviceCaps(IWineD3DDevice *iface, WINED3DCAPS* pCaps) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment