mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 21:20:25 +00:00
wined3d: Cleanup IWineD3DDeviceImpl_GetBackBuffer().
This commit is contained in:
parent
35d5e7669e
commit
bd1ec9eb02
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user