2003-07-01 01:09:17 +00:00
|
|
|
/*
|
|
|
|
* IDirect3DSwapChain9 implementation
|
|
|
|
*
|
|
|
|
* Copyright 2002-2003 Jason Edmeades
|
|
|
|
* Raphael Junqueira
|
2005-06-23 11:05:24 +00:00
|
|
|
* Copyright 2005 Oliver Stieber
|
2003-07-01 01:09:17 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-07-01 01:09:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "d3d9_private.h"
|
|
|
|
|
2005-06-23 11:05:24 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
|
2003-07-01 01:09:17 +00:00
|
|
|
|
|
|
|
/* IDirect3DSwapChain IUnknown parts follow: */
|
2006-06-10 09:51:05 +00:00
|
|
|
static HRESULT WINAPI IDirect3DSwapChain9Impl_QueryInterface(LPDIRECT3DSWAPCHAIN9 iface, REFIID riid, LPVOID* ppobj)
|
2003-07-01 01:09:17 +00:00
|
|
|
{
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2003-07-01 01:09:17 +00:00
|
|
|
|
2009-10-20 09:05:02 +00:00
|
|
|
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), ppobj);
|
|
|
|
|
2003-07-01 01:09:17 +00:00
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
|
|
|
|| IsEqualGUID(riid, &IID_IDirect3DSwapChain9)) {
|
2008-11-02 22:49:40 +00:00
|
|
|
IDirect3DSwapChain9_AddRef(iface);
|
2005-06-23 11:05:24 +00:00
|
|
|
*ppobj = This;
|
2006-06-07 13:13:29 +00:00
|
|
|
return S_OK;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
|
2006-06-07 13:13:29 +00:00
|
|
|
*ppobj = NULL;
|
2003-07-01 01:09:17 +00:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2006-06-10 09:51:05 +00:00
|
|
|
static ULONG WINAPI IDirect3DSwapChain9Impl_AddRef(LPDIRECT3DSWAPCHAIN9 iface) {
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2005-01-24 11:31:45 +00:00
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
2009-10-20 09:05:02 +00:00
|
|
|
TRACE("%p increasing refcount to %u.\n", iface, ref);
|
2005-01-24 11:31:45 +00:00
|
|
|
|
2011-04-07 16:46:01 +00:00
|
|
|
if (ref == 1)
|
|
|
|
{
|
|
|
|
if (This->parentDevice)
|
|
|
|
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
|
|
|
|
2011-04-11 18:55:17 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-04-13 17:14:31 +00:00
|
|
|
wined3d_swapchain_incref(This->wined3d_swapchain);
|
2011-04-11 18:55:17 +00:00
|
|
|
wined3d_mutex_unlock();
|
2011-04-07 16:46:01 +00:00
|
|
|
}
|
2006-12-17 23:17:31 +00:00
|
|
|
|
2005-01-24 11:31:45 +00:00
|
|
|
return ref;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
2006-06-10 09:51:05 +00:00
|
|
|
static ULONG WINAPI IDirect3DSwapChain9Impl_Release(LPDIRECT3DSWAPCHAIN9 iface) {
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2005-01-24 11:31:45 +00:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
2009-10-20 09:05:02 +00:00
|
|
|
TRACE("%p decreasing refcount to %u.\n", iface, ref);
|
2005-01-24 11:31:45 +00:00
|
|
|
|
2003-07-01 01:09:17 +00:00
|
|
|
if (ref == 0) {
|
2009-09-26 13:56:16 +00:00
|
|
|
IDirect3DDevice9Ex *parentDevice = This->parentDevice;
|
|
|
|
|
2011-04-11 18:55:17 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-04-13 17:14:31 +00:00
|
|
|
wined3d_swapchain_decref(This->wined3d_swapchain);
|
2011-04-11 18:55:17 +00:00
|
|
|
wined3d_mutex_unlock();
|
2009-09-26 13:56:16 +00:00
|
|
|
|
|
|
|
/* Release the device last, as it may cause the device to be destroyed. */
|
|
|
|
if (parentDevice) IDirect3DDevice9Ex_Release(parentDevice);
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IDirect3DSwapChain9 parts follow: */
|
2009-09-12 12:19:25 +00:00
|
|
|
static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DSwapChain9Impl_Present(LPDIRECT3DSWAPCHAIN9 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags) {
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2009-03-23 07:30:16 +00:00
|
|
|
HRESULT hr;
|
|
|
|
|
2009-10-20 09:05:02 +00:00
|
|
|
TRACE("iface %p, src_rect %p, dst_rect %p, dst_window_override %p, dirty_region %p, flags %#x.\n",
|
|
|
|
iface, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags);
|
2009-03-23 07:30:16 +00:00
|
|
|
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-04-13 17:14:31 +00:00
|
|
|
hr = wined3d_swapchain_present(This->wined3d_swapchain, pSourceRect,
|
|
|
|
pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags);
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_unlock();
|
2009-03-23 07:30:16 +00:00
|
|
|
|
|
|
|
return hr;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
2006-06-10 09:51:05 +00:00
|
|
|
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetFrontBufferData(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DSurface9* pDestSurface) {
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2007-06-14 09:48:59 +00:00
|
|
|
HRESULT hr;
|
2009-10-20 09:05:02 +00:00
|
|
|
|
|
|
|
TRACE("iface %p, surface %p.\n", iface, pDestSurface);
|
2007-06-14 09:48:59 +00:00
|
|
|
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-04-13 17:14:31 +00:00
|
|
|
hr = wined3d_swapchain_get_front_buffer_data(This->wined3d_swapchain,
|
2011-04-29 11:03:41 +00:00
|
|
|
((IDirect3DSurface9Impl *)pDestSurface)->wined3d_surface);
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_unlock();
|
|
|
|
|
2007-06-14 09:48:59 +00:00
|
|
|
return hr;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
2010-08-31 16:41:40 +00:00
|
|
|
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(IDirect3DSwapChain9 *iface,
|
|
|
|
UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9 **ppBackBuffer)
|
|
|
|
{
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2011-04-29 11:03:41 +00:00
|
|
|
struct wined3d_surface *wined3d_surface = NULL;
|
2010-08-31 16:41:40 +00:00
|
|
|
HRESULT hr;
|
2005-06-23 11:05:24 +00:00
|
|
|
|
2009-10-20 09:05:02 +00:00
|
|
|
TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
|
|
|
|
iface, iBackBuffer, Type, ppBackBuffer);
|
2005-06-23 11:05:24 +00:00
|
|
|
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-04-13 17:14:31 +00:00
|
|
|
hr = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain,
|
2011-04-29 11:03:41 +00:00
|
|
|
iBackBuffer, (WINED3DBACKBUFFER_TYPE)Type, &wined3d_surface);
|
|
|
|
if (SUCCEEDED(hr) && wined3d_surface)
|
2010-08-31 16:41:40 +00:00
|
|
|
{
|
2011-04-29 11:03:41 +00:00
|
|
|
*ppBackBuffer = wined3d_surface_get_parent(wined3d_surface);
|
2010-08-31 16:41:40 +00:00
|
|
|
IDirect3DSurface9_AddRef(*ppBackBuffer);
|
2011-04-29 11:03:41 +00:00
|
|
|
wined3d_surface_decref(wined3d_surface);
|
2005-06-23 11:05:24 +00:00
|
|
|
}
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_unlock();
|
|
|
|
|
2006-05-24 09:34:30 +00:00
|
|
|
/* Do not touch the **ppBackBuffer pointer otherwise! (see device test) */
|
2010-08-31 16:41:40 +00:00
|
|
|
return hr;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
2006-06-10 09:51:05 +00:00
|
|
|
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetRasterStatus(LPDIRECT3DSWAPCHAIN9 iface, D3DRASTER_STATUS* pRasterStatus) {
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2007-06-14 09:48:59 +00:00
|
|
|
HRESULT hr;
|
2009-10-20 09:05:02 +00:00
|
|
|
|
|
|
|
TRACE("iface %p, raster_status %p.\n", iface, pRasterStatus);
|
2007-06-14 09:48:59 +00:00
|
|
|
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-04-13 17:14:31 +00:00
|
|
|
hr = wined3d_swapchain_get_raster_status(This->wined3d_swapchain, (WINED3DRASTER_STATUS *)pRasterStatus);
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_unlock();
|
|
|
|
|
2007-06-14 09:48:59 +00:00
|
|
|
return hr;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
2006-06-10 09:51:05 +00:00
|
|
|
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDisplayMode(LPDIRECT3DSWAPCHAIN9 iface, D3DDISPLAYMODE* pMode) {
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2007-06-14 09:48:59 +00:00
|
|
|
HRESULT hr;
|
2009-10-20 09:05:02 +00:00
|
|
|
|
|
|
|
TRACE("iface %p, mode %p.\n", iface, pMode);
|
2007-06-14 09:48:59 +00:00
|
|
|
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-04-13 17:14:31 +00:00
|
|
|
hr = wined3d_swapchain_get_display_mode(This->wined3d_swapchain, (WINED3DDISPLAYMODE *)pMode);
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_unlock();
|
2009-02-19 15:59:42 +00:00
|
|
|
|
|
|
|
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
|
|
|
|
|
2007-06-14 09:48:59 +00:00
|
|
|
return hr;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
2009-12-04 10:50:47 +00:00
|
|
|
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDevice(IDirect3DSwapChain9 *iface, IDirect3DDevice9 **device)
|
|
|
|
{
|
2005-06-23 11:05:24 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2003-07-01 01:09:17 +00:00
|
|
|
|
2009-12-04 10:50:47 +00:00
|
|
|
TRACE("iface %p, device %p.\n", iface, device);
|
2005-06-23 11:05:24 +00:00
|
|
|
|
2009-12-04 10:50:47 +00:00
|
|
|
*device = (IDirect3DDevice9 *)This->parentDevice;
|
|
|
|
IDirect3DDevice9_AddRef(*device);
|
2009-08-26 08:18:09 +00:00
|
|
|
|
2009-12-04 10:50:47 +00:00
|
|
|
TRACE("Returning device %p.\n", *device);
|
|
|
|
|
|
|
|
return D3D_OK;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
2006-06-10 09:51:05 +00:00
|
|
|
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetPresentParameters(LPDIRECT3DSWAPCHAIN9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
|
2004-09-08 01:50:37 +00:00
|
|
|
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
|
2006-03-08 23:49:11 +00:00
|
|
|
WINED3DPRESENT_PARAMETERS winePresentParameters;
|
2007-02-15 21:36:50 +00:00
|
|
|
HRESULT hr;
|
|
|
|
|
2009-10-20 09:05:02 +00:00
|
|
|
TRACE("iface %p, parameters %p.\n", iface, pPresentationParameters);
|
2007-02-15 21:36:50 +00:00
|
|
|
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-04-13 17:14:31 +00:00
|
|
|
hr = wined3d_swapchain_get_present_parameters(This->wined3d_swapchain, &winePresentParameters);
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_unlock();
|
2007-02-15 21:36:50 +00:00
|
|
|
|
|
|
|
pPresentationParameters->BackBufferWidth = winePresentParameters.BackBufferWidth;
|
|
|
|
pPresentationParameters->BackBufferHeight = winePresentParameters.BackBufferHeight;
|
2009-02-19 15:59:42 +00:00
|
|
|
pPresentationParameters->BackBufferFormat = d3dformat_from_wined3dformat(winePresentParameters.BackBufferFormat);
|
2007-02-15 21:36:50 +00:00
|
|
|
pPresentationParameters->BackBufferCount = winePresentParameters.BackBufferCount;
|
|
|
|
pPresentationParameters->MultiSampleType = winePresentParameters.MultiSampleType;
|
|
|
|
pPresentationParameters->MultiSampleQuality = winePresentParameters.MultiSampleQuality;
|
|
|
|
pPresentationParameters->SwapEffect = winePresentParameters.SwapEffect;
|
|
|
|
pPresentationParameters->hDeviceWindow = winePresentParameters.hDeviceWindow;
|
|
|
|
pPresentationParameters->Windowed = winePresentParameters.Windowed;
|
|
|
|
pPresentationParameters->EnableAutoDepthStencil = winePresentParameters.EnableAutoDepthStencil;
|
2009-02-19 15:59:42 +00:00
|
|
|
pPresentationParameters->AutoDepthStencilFormat = d3dformat_from_wined3dformat(winePresentParameters.AutoDepthStencilFormat);
|
2007-02-15 21:36:50 +00:00
|
|
|
pPresentationParameters->Flags = winePresentParameters.Flags;
|
|
|
|
pPresentationParameters->FullScreen_RefreshRateInHz = winePresentParameters.FullScreen_RefreshRateInHz;
|
|
|
|
pPresentationParameters->PresentationInterval = winePresentParameters.PresentationInterval;
|
|
|
|
|
|
|
|
return hr;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-06-10 09:51:05 +00:00
|
|
|
static const IDirect3DSwapChain9Vtbl Direct3DSwapChain9_Vtbl =
|
2003-07-01 01:09:17 +00:00
|
|
|
{
|
|
|
|
IDirect3DSwapChain9Impl_QueryInterface,
|
|
|
|
IDirect3DSwapChain9Impl_AddRef,
|
|
|
|
IDirect3DSwapChain9Impl_Release,
|
|
|
|
IDirect3DSwapChain9Impl_Present,
|
|
|
|
IDirect3DSwapChain9Impl_GetFrontBufferData,
|
|
|
|
IDirect3DSwapChain9Impl_GetBackBuffer,
|
|
|
|
IDirect3DSwapChain9Impl_GetRasterStatus,
|
|
|
|
IDirect3DSwapChain9Impl_GetDisplayMode,
|
|
|
|
IDirect3DSwapChain9Impl_GetDevice,
|
|
|
|
IDirect3DSwapChain9Impl_GetPresentParameters
|
|
|
|
};
|
|
|
|
|
2011-04-07 16:46:01 +00:00
|
|
|
static void STDMETHODCALLTYPE d3d9_swapchain_wined3d_object_released(void *parent)
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(), 0, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct wined3d_parent_ops d3d9_swapchain_wined3d_parent_ops =
|
|
|
|
{
|
|
|
|
d3d9_swapchain_wined3d_object_released,
|
|
|
|
};
|
|
|
|
|
2009-12-20 19:41:36 +00:00
|
|
|
HRESULT swapchain_init(IDirect3DSwapChain9Impl *swapchain, IDirect3DDevice9Impl *device,
|
|
|
|
D3DPRESENT_PARAMETERS *present_parameters)
|
|
|
|
{
|
|
|
|
WINED3DPRESENT_PARAMETERS wined3d_parameters;
|
|
|
|
HRESULT hr;
|
2003-07-01 01:09:17 +00:00
|
|
|
|
2009-12-20 19:41:36 +00:00
|
|
|
swapchain->ref = 1;
|
|
|
|
swapchain->lpVtbl = &Direct3DSwapChain9_Vtbl;
|
|
|
|
|
|
|
|
wined3d_parameters.BackBufferWidth = present_parameters->BackBufferWidth;
|
|
|
|
wined3d_parameters.BackBufferHeight = present_parameters->BackBufferHeight;
|
|
|
|
wined3d_parameters.BackBufferFormat = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat);
|
|
|
|
wined3d_parameters.BackBufferCount = max(1, present_parameters->BackBufferCount);
|
|
|
|
wined3d_parameters.MultiSampleType = present_parameters->MultiSampleType;
|
|
|
|
wined3d_parameters.MultiSampleQuality = present_parameters->MultiSampleQuality;
|
|
|
|
wined3d_parameters.SwapEffect = present_parameters->SwapEffect;
|
|
|
|
wined3d_parameters.hDeviceWindow = present_parameters->hDeviceWindow;
|
|
|
|
wined3d_parameters.Windowed = present_parameters->Windowed;
|
|
|
|
wined3d_parameters.EnableAutoDepthStencil = present_parameters->EnableAutoDepthStencil;
|
|
|
|
wined3d_parameters.AutoDepthStencilFormat = wined3dformat_from_d3dformat(present_parameters->AutoDepthStencilFormat);
|
|
|
|
wined3d_parameters.Flags = present_parameters->Flags;
|
|
|
|
wined3d_parameters.FullScreen_RefreshRateInHz = present_parameters->FullScreen_RefreshRateInHz;
|
|
|
|
wined3d_parameters.PresentationInterval = present_parameters->PresentationInterval;
|
|
|
|
wined3d_parameters.AutoRestoreDisplayMode = TRUE;
|
2005-06-23 11:05:24 +00:00
|
|
|
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_lock();
|
2011-05-16 21:01:22 +00:00
|
|
|
hr = wined3d_swapchain_create(device->wined3d_device, &wined3d_parameters,
|
2011-04-07 16:46:01 +00:00
|
|
|
SURFACE_OPENGL, swapchain, &d3d9_swapchain_wined3d_parent_ops,
|
2011-04-13 17:14:31 +00:00
|
|
|
&swapchain->wined3d_swapchain);
|
2009-08-26 08:18:09 +00:00
|
|
|
wined3d_mutex_unlock();
|
2007-02-15 21:36:50 +00:00
|
|
|
|
2009-12-20 19:41:36 +00:00
|
|
|
present_parameters->BackBufferWidth = wined3d_parameters.BackBufferWidth;
|
|
|
|
present_parameters->BackBufferHeight = wined3d_parameters.BackBufferHeight;
|
|
|
|
present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(wined3d_parameters.BackBufferFormat);
|
|
|
|
present_parameters->BackBufferCount = wined3d_parameters.BackBufferCount;
|
|
|
|
present_parameters->MultiSampleType = wined3d_parameters.MultiSampleType;
|
|
|
|
present_parameters->MultiSampleQuality = wined3d_parameters.MultiSampleQuality;
|
|
|
|
present_parameters->SwapEffect = wined3d_parameters.SwapEffect;
|
|
|
|
present_parameters->hDeviceWindow = wined3d_parameters.hDeviceWindow;
|
|
|
|
present_parameters->Windowed = wined3d_parameters.Windowed;
|
|
|
|
present_parameters->EnableAutoDepthStencil = wined3d_parameters.EnableAutoDepthStencil;
|
|
|
|
present_parameters->AutoDepthStencilFormat = d3dformat_from_wined3dformat(wined3d_parameters.AutoDepthStencilFormat);
|
|
|
|
present_parameters->Flags = wined3d_parameters.Flags;
|
|
|
|
present_parameters->FullScreen_RefreshRateInHz = wined3d_parameters.FullScreen_RefreshRateInHz;
|
|
|
|
present_parameters->PresentationInterval = wined3d_parameters.PresentationInterval;
|
|
|
|
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
WARN("Failed to create wined3d swapchain, hr %#x.\n", hr);
|
|
|
|
return hr;
|
2005-06-23 11:05:24 +00:00
|
|
|
}
|
2009-12-20 19:41:36 +00:00
|
|
|
|
2011-04-24 19:34:30 +00:00
|
|
|
swapchain->parentDevice = &device->IDirect3DDevice9Ex_iface;
|
2009-12-20 19:41:36 +00:00
|
|
|
IDirect3DDevice9Ex_AddRef(swapchain->parentDevice);
|
|
|
|
|
|
|
|
return D3D_OK;
|
2003-07-01 01:09:17 +00:00
|
|
|
}
|