Commit a4bc52a8 authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

wined3d: Fix WINED3DPRESENT_PARAMETERS and use it instead of D3DPRESENT_PARAMETERS.

parent a30bc580
......@@ -241,23 +241,37 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DD
object->lpVtbl = &Direct3DSwapChain8_Vtbl;
/* Allocate an associated WineD3DDevice object */
localParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth;
localParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight;
localParameters.BackBufferFormat = (WINED3DFORMAT *)&pPresentationParameters->BackBufferFormat;
localParameters.BackBufferCount = &pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pPresentationParameters->MultiSampleType;
localParameters.MultiSampleQuality = NULL; /* d3d9 only */
localParameters.SwapEffect = (WINED3DSWAPEFFECT *) &pPresentationParameters->SwapEffect;
localParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow;
localParameters.Windowed = &pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = (WINED3DFORMAT *)&pPresentationParameters->AutoDepthStencilFormat;
localParameters.Flags = &pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = &pPresentationParameters->FullScreen_PresentationInterval;
localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth;
localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight;
localParameters.BackBufferFormat = pPresentationParameters->BackBufferFormat;
localParameters.BackBufferCount = pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = pPresentationParameters->MultiSampleType;
localParameters.MultiSampleQuality = 0; /* d3d9 only */
localParameters.SwapEffect = pPresentationParameters->SwapEffect;
localParameters.hDeviceWindow = pPresentationParameters->hDeviceWindow;
localParameters.Windowed = pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = pPresentationParameters->AutoDepthStencilFormat;
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval;
hrc = IWineD3DDevice_CreateAdditionalSwapChain(This->WineD3DDevice, &localParameters, &object->wineD3DSwapChain, (IUnknown*)object, D3D8CB_CreateRenderTarget, D3D8CB_CreateDepthStencilSurface);
pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth;
pPresentationParameters->BackBufferHeight = localParameters.BackBufferHeight;
pPresentationParameters->BackBufferFormat = localParameters.BackBufferFormat;
pPresentationParameters->BackBufferCount = localParameters.BackBufferCount;
pPresentationParameters->MultiSampleType = localParameters.MultiSampleType;
pPresentationParameters->SwapEffect = localParameters.SwapEffect;
pPresentationParameters->hDeviceWindow = localParameters.hDeviceWindow;
pPresentationParameters->Windowed = localParameters.Windowed;
pPresentationParameters->EnableAutoDepthStencil = localParameters.EnableAutoDepthStencil;
pPresentationParameters->AutoDepthStencilFormat = localParameters.AutoDepthStencilFormat;
pPresentationParameters->Flags = localParameters.Flags;
pPresentationParameters->FullScreen_RefreshRateInHz = localParameters.FullScreen_RefreshRateInHz;
pPresentationParameters->FullScreen_PresentationInterval = localParameters.PresentationInterval;
if (hrc != D3D_OK) {
FIXME("(%p) call to IWineD3DDevice_CreateAdditionalSwapChain failed\n", This);
HeapFree(GetProcessHeap(), 0 , object);
......@@ -274,24 +288,42 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DD
static HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
WINED3DPRESENT_PARAMETERS localParameters;
DWORD dummy_dword = 0;
HRESULT hr;
TRACE("(%p) Relay pPresentationParameters(%p)\n", This, pPresentationParameters);
/* FINDME: FIXME: */
localParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth;
localParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight;
localParameters.BackBufferFormat = (WINED3DFORMAT *)&pPresentationParameters->BackBufferFormat;
localParameters.BackBufferCount = &pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pPresentationParameters->MultiSampleType;
localParameters.MultiSampleQuality = &dummy_dword; /* D3d9 only */
localParameters.SwapEffect = (WINED3DSWAPEFFECT *) &pPresentationParameters->SwapEffect;
localParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow;
localParameters.Windowed = &pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = (WINED3DFORMAT *)&pPresentationParameters->AutoDepthStencilFormat;
localParameters.Flags = &pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = &pPresentationParameters->FullScreen_PresentationInterval;
return IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth;
localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight;
localParameters.BackBufferFormat = pPresentationParameters->BackBufferFormat;
localParameters.BackBufferCount = pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = pPresentationParameters->MultiSampleType;
localParameters.MultiSampleQuality = 0; /* d3d9 only */
localParameters.SwapEffect = pPresentationParameters->SwapEffect;
localParameters.hDeviceWindow = pPresentationParameters->hDeviceWindow;
localParameters.Windowed = pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = pPresentationParameters->AutoDepthStencilFormat;
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval;
hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth;
pPresentationParameters->BackBufferHeight = localParameters.BackBufferHeight;
pPresentationParameters->BackBufferFormat = localParameters.BackBufferFormat;
pPresentationParameters->BackBufferCount = localParameters.BackBufferCount;
pPresentationParameters->MultiSampleType = localParameters.MultiSampleType;
pPresentationParameters->SwapEffect = localParameters.SwapEffect;
pPresentationParameters->hDeviceWindow = localParameters.hDeviceWindow;
pPresentationParameters->Windowed = localParameters.Windowed;
pPresentationParameters->EnableAutoDepthStencil = localParameters.EnableAutoDepthStencil;
pPresentationParameters->AutoDepthStencilFormat = localParameters.AutoDepthStencilFormat;
pPresentationParameters->Flags = localParameters.Flags;
pPresentationParameters->FullScreen_RefreshRateInHz = localParameters.FullScreen_RefreshRateInHz;
pPresentationParameters->FullScreen_PresentationInterval = localParameters.PresentationInterval;
return hr;
}
static HRESULT WINAPI IDirect3DDevice8Impl_Present(LPDIRECT3DDEVICE8 iface, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) {
......
......@@ -176,23 +176,43 @@ static BOOL WINAPI IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9 iface,
static HRESULT WINAPI IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
WINED3DPRESENT_PARAMETERS localParameters;
HRESULT hr;
TRACE("(%p) Relay pPresentationParameters(%p)\n", This, pPresentationParameters);
localParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth;
localParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight;
localParameters.BackBufferFormat = (WINED3DFORMAT *)&pPresentationParameters->BackBufferFormat;
localParameters.BackBufferCount = &pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pPresentationParameters->MultiSampleType;
localParameters.MultiSampleQuality = &pPresentationParameters->MultiSampleQuality;
localParameters.SwapEffect = (WINED3DSWAPEFFECT *) &pPresentationParameters->SwapEffect;
localParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow;
localParameters.Windowed = &pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = (WINED3DFORMAT *)&pPresentationParameters->AutoDepthStencilFormat;
localParameters.Flags = &pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = &pPresentationParameters->PresentationInterval;
return IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth;
localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight;
localParameters.BackBufferFormat = pPresentationParameters->BackBufferFormat;
localParameters.BackBufferCount = pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = pPresentationParameters->MultiSampleType;
localParameters.MultiSampleQuality = pPresentationParameters->MultiSampleQuality;
localParameters.SwapEffect = pPresentationParameters->SwapEffect;
localParameters.hDeviceWindow = pPresentationParameters->hDeviceWindow;
localParameters.Windowed = pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = pPresentationParameters->AutoDepthStencilFormat;
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->PresentationInterval;
hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth;
pPresentationParameters->BackBufferHeight = localParameters.BackBufferHeight;
pPresentationParameters->BackBufferFormat = localParameters.BackBufferFormat;
pPresentationParameters->BackBufferCount = localParameters.BackBufferCount;
pPresentationParameters->MultiSampleType = localParameters.MultiSampleType;
pPresentationParameters->MultiSampleQuality = localParameters.MultiSampleQuality;
pPresentationParameters->SwapEffect = localParameters.SwapEffect;
pPresentationParameters->hDeviceWindow = localParameters.hDeviceWindow;
pPresentationParameters->Windowed = localParameters.Windowed;
pPresentationParameters->EnableAutoDepthStencil = localParameters.EnableAutoDepthStencil;
pPresentationParameters->AutoDepthStencilFormat = localParameters.AutoDepthStencilFormat;
pPresentationParameters->Flags = localParameters.Flags;
pPresentationParameters->FullScreen_RefreshRateInHz = localParameters.FullScreen_RefreshRateInHz;
pPresentationParameters->PresentationInterval = localParameters.PresentationInterval;
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_Present(LPDIRECT3DDEVICE9 iface, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA*
......
......@@ -128,21 +128,27 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDevice(LPDIRECT3DSWAPCHAIN9 ifa
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetPresentParameters(LPDIRECT3DSWAPCHAIN9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
WINED3DPRESENT_PARAMETERS winePresentParameters;
HRESULT hr;
TRACE("(%p)->(%p): Relay\n", This, pPresentationParameters);
winePresentParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth;
winePresentParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight;
winePresentParameters.BackBufferFormat = (WINED3DFORMAT *) &pPresentationParameters->BackBufferFormat;
winePresentParameters.BackBufferCount = &pPresentationParameters->BackBufferCount;
winePresentParameters.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pPresentationParameters->MultiSampleType;
winePresentParameters.MultiSampleQuality = &pPresentationParameters->MultiSampleQuality;
winePresentParameters.SwapEffect = (WINED3DSWAPEFFECT *)&pPresentationParameters->SwapEffect;
winePresentParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow;
winePresentParameters.Windowed = &pPresentationParameters->Windowed;
winePresentParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil;
winePresentParameters.Flags = &pPresentationParameters->Flags;
winePresentParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz;
winePresentParameters.PresentationInterval = &pPresentationParameters->PresentationInterval;
return IWineD3DSwapChain_GetPresentParameters(This->wineD3DSwapChain, &winePresentParameters);
hr = IWineD3DSwapChain_GetPresentParameters(This->wineD3DSwapChain, &winePresentParameters);
pPresentationParameters->BackBufferWidth = winePresentParameters.BackBufferWidth;
pPresentationParameters->BackBufferHeight = winePresentParameters.BackBufferHeight;
pPresentationParameters->BackBufferFormat = winePresentParameters.BackBufferFormat;
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;
pPresentationParameters->Flags = winePresentParameters.Flags;
pPresentationParameters->FullScreen_RefreshRateInHz = winePresentParameters.FullScreen_RefreshRateInHz;
pPresentationParameters->PresentationInterval = winePresentParameters.PresentationInterval;
return hr;
}
......@@ -184,23 +190,38 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE
}
/* Allocate an associated WineD3DDevice object */
localParameters.BackBufferWidth = &pPresentationParameters->BackBufferWidth;
localParameters.BackBufferHeight = &pPresentationParameters->BackBufferHeight;
localParameters.BackBufferFormat = (WINED3DFORMAT *)&pPresentationParameters->BackBufferFormat;
localParameters.BackBufferCount = &pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pPresentationParameters->MultiSampleType;
localParameters.MultiSampleQuality = &pPresentationParameters->MultiSampleQuality;
localParameters.SwapEffect = (WINED3DSWAPEFFECT *)&pPresentationParameters->SwapEffect;
localParameters.hDeviceWindow = &pPresentationParameters->hDeviceWindow;
localParameters.Windowed = &pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = &pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = (WINED3DFORMAT *)&pPresentationParameters->AutoDepthStencilFormat;
localParameters.Flags = &pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = &pPresentationParameters->PresentationInterval;
localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth;
localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight;
localParameters.BackBufferFormat = pPresentationParameters->BackBufferFormat;
localParameters.BackBufferCount = pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = pPresentationParameters->MultiSampleType;
localParameters.MultiSampleQuality = pPresentationParameters->MultiSampleQuality;
localParameters.SwapEffect = pPresentationParameters->SwapEffect;
localParameters.hDeviceWindow = pPresentationParameters->hDeviceWindow;
localParameters.Windowed = pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = pPresentationParameters->AutoDepthStencilFormat;
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->PresentationInterval;
hrc = IWineD3DDevice_CreateAdditionalSwapChain(This->WineD3DDevice, &localParameters, &object->wineD3DSwapChain, (IUnknown*)object, D3D9CB_CreateRenderTarget, D3D9CB_CreateDepthStencilSurface);
pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth;
pPresentationParameters->BackBufferHeight = localParameters.BackBufferHeight;
pPresentationParameters->BackBufferFormat = localParameters.BackBufferFormat;
pPresentationParameters->BackBufferCount = localParameters.BackBufferCount;
pPresentationParameters->MultiSampleType = localParameters.MultiSampleType;
pPresentationParameters->MultiSampleQuality = localParameters.MultiSampleQuality;
pPresentationParameters->SwapEffect = localParameters.SwapEffect;
pPresentationParameters->hDeviceWindow = localParameters.hDeviceWindow;
pPresentationParameters->Windowed = localParameters.Windowed;
pPresentationParameters->EnableAutoDepthStencil = localParameters.EnableAutoDepthStencil;
pPresentationParameters->AutoDepthStencilFormat = localParameters.AutoDepthStencilFormat;
pPresentationParameters->Flags = localParameters.Flags;
pPresentationParameters->FullScreen_RefreshRateInHz = localParameters.FullScreen_RefreshRateInHz;
pPresentationParameters->PresentationInterval = localParameters.PresentationInterval;
if (hrc != D3D_OK) {
FIXME("(%p) call to IWineD3DDevice_CreateAdditionalSwapChain failed\n", This);
HeapFree(GetProcessHeap(), 0 , object);
......
......@@ -2720,17 +2720,9 @@ IDirectDrawImpl_AttachD3DDevice(IDirectDrawImpl *This,
IDirectDrawSurfaceImpl *primary)
{
HRESULT hr;
UINT BackBufferCount = 0;
HWND window;
WINED3DPRESENT_PARAMETERS localParameters;
BOOL isWindowed, EnableAutoDepthStencil;
WINED3DFORMAT AutoDepthStencilFormat;
WINED3DMULTISAMPLE_TYPE MultiSampleType;
WINED3DSWAPEFFECT SwapEffect;
DWORD Flags, MultiSampleQuality;
UINT FullScreen_RefreshRateInHz, PresentationInterval;
WINED3DDISPLAYMODE Mode;
TRACE("(%p)->(%p)\n", This, primary);
......@@ -2761,47 +2753,28 @@ IDirectDrawImpl_AttachD3DDevice(IDirectDrawImpl *This,
TRACE("(%p) Using existing window %p for Direct3D rendering\n", This, window);
}
/* use the surface description for the device parameters, not the
* Device settings. The app might render to an offscreen surface
*/
Mode.Width = primary->surface_desc.dwWidth;
Mode.Height = primary->surface_desc.dwHeight;
Mode.Format = PixelFormat_DD2WineD3D(&primary->surface_desc.u4.ddpfPixelFormat);
if(primary->surface_desc.dwFlags & DDSD_BACKBUFFERCOUNT)
{
BackBufferCount = primary->surface_desc.dwBackBufferCount;
}
/* Store the future Render Target surface */
This->d3d_target = primary;
isWindowed = !(This->cooperative_level & DDSCL_FULLSCREEN);
EnableAutoDepthStencil = FALSE;
AutoDepthStencilFormat = WINED3DFMT_D16;
MultiSampleType = WINED3DMULTISAMPLE_NONE;
SwapEffect = WINED3DSWAPEFFECT_COPY;
Flags = 0;
MultiSampleQuality = 0;
FullScreen_RefreshRateInHz = WINED3DPRESENT_RATE_DEFAULT; /* Default rate: It's already set */
PresentationInterval = WINED3DPRESENT_INTERVAL_DEFAULT;
TRACE("Passing mode %d\n", Mode.Format);
localParameters.BackBufferWidth = &Mode.Width;
localParameters.BackBufferHeight = &Mode.Height;
localParameters.BackBufferFormat = (WINED3DFORMAT *) &Mode.Format;
localParameters.BackBufferCount = (UINT *) &BackBufferCount;
localParameters.MultiSampleType = &MultiSampleType;
localParameters.MultiSampleQuality = &MultiSampleQuality;
localParameters.SwapEffect = &SwapEffect;
localParameters.hDeviceWindow = &window;
localParameters.Windowed = &isWindowed;
localParameters.EnableAutoDepthStencil = &EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = &AutoDepthStencilFormat;
localParameters.Flags = &Flags;
localParameters.FullScreen_RefreshRateInHz = &FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = &PresentationInterval;
/* Use the surface description for the device parameters, not the
* Device settings. The app might render to an offscreen surface
*/
localParameters.BackBufferWidth = primary->surface_desc.dwWidth;
localParameters.BackBufferHeight = primary->surface_desc.dwHeight;
localParameters.BackBufferFormat = PixelFormat_DD2WineD3D(&primary->surface_desc.u4.ddpfPixelFormat);
localParameters.BackBufferCount = (primary->surface_desc.dwFlags & DDSD_BACKBUFFERCOUNT) ? primary->surface_desc.dwBackBufferCount : 0;
localParameters.MultiSampleType = WINED3DMULTISAMPLE_NONE;
localParameters.MultiSampleQuality = 0;
localParameters.SwapEffect = WINED3DSWAPEFFECT_COPY;
localParameters.hDeviceWindow = window;
localParameters.Windowed = !(This->cooperative_level & DDSCL_FULLSCREEN);
localParameters.EnableAutoDepthStencil = FALSE;
localParameters.AutoDepthStencilFormat = WINED3DFMT_D16;
localParameters.Flags = 0;
localParameters.FullScreen_RefreshRateInHz = WINED3DPRESENT_RATE_DEFAULT; /* Default rate: It's already set */
localParameters.PresentationInterval = WINED3DPRESENT_INTERVAL_DEFAULT;
TRACE("Passing mode %d\n", localParameters.BackBufferFormat);
/* Set this NOW, otherwise creating the depth stencil surface will cause a
* recursive loop until ram or emulated video memory is full
......
......@@ -456,19 +456,9 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetDevice(IWineD3DSwapChain *iface,
static HRESULT WINAPI IWineD3DSwapChainImpl_GetPresentParameters(IWineD3DSwapChain *iface, WINED3DPRESENT_PARAMETERS *pPresentationParameters) {
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
TRACE("(%p)\n", This);
*pPresentationParameters->BackBufferWidth = This->presentParms.BackBufferWidth;
*pPresentationParameters->BackBufferHeight = This->presentParms.BackBufferHeight;
*pPresentationParameters->BackBufferFormat = This->presentParms.BackBufferFormat;
*pPresentationParameters->BackBufferCount = This->presentParms.BackBufferCount;
*pPresentationParameters->MultiSampleType = This->presentParms.MultiSampleType;
*pPresentationParameters->MultiSampleQuality = This->presentParms.MultiSampleQuality;
*pPresentationParameters->SwapEffect = This->presentParms.SwapEffect;
*pPresentationParameters->hDeviceWindow = This->presentParms.hDeviceWindow;
*pPresentationParameters->Windowed = This->presentParms.Windowed;
*pPresentationParameters->EnableAutoDepthStencil = This->presentParms.EnableAutoDepthStencil;
*pPresentationParameters->Flags = This->presentParms.Flags;
*pPresentationParameters->FullScreen_RefreshRateInHz = This->presentParms.FullScreen_RefreshRateInHz;
*pPresentationParameters->PresentationInterval = This->presentParms.PresentationInterval;
*pPresentationParameters = This->presentParms;
return WINED3D_OK;
}
......
......@@ -1316,7 +1316,7 @@ typedef struct IWineD3DSwapChainImpl
IWineD3DSurface **backBuffer;
IWineD3DSurface *frontBuffer;
BOOL wantsDepthStencilBuffer;
D3DPRESENT_PARAMETERS presentParms;
WINED3DPRESENT_PARAMETERS presentParms;
DWORD orig_width, orig_height;
WINED3DFORMAT orig_fmt;
......
......@@ -861,20 +861,20 @@ typedef struct _WINED3DADAPTER_IDENTIFIER {
} WINED3DADAPTER_IDENTIFIER;
typedef struct _WINED3DPRESENT_PARAMETERS {
UINT *BackBufferWidth;
UINT *BackBufferHeight;
WINED3DFORMAT *BackBufferFormat;
UINT *BackBufferCount;
WINED3DMULTISAMPLE_TYPE *MultiSampleType;
DWORD *MultiSampleQuality;
WINED3DSWAPEFFECT *SwapEffect;
HWND *hDeviceWindow;
BOOL *Windowed;
BOOL *EnableAutoDepthStencil;
WINED3DFORMAT *AutoDepthStencilFormat;
DWORD *Flags;
UINT *FullScreen_RefreshRateInHz;
UINT *PresentationInterval;
UINT BackBufferWidth;
UINT BackBufferHeight;
WINED3DFORMAT BackBufferFormat;
UINT BackBufferCount;
WINED3DMULTISAMPLE_TYPE MultiSampleType;
DWORD MultiSampleQuality;
WINED3DSWAPEFFECT SwapEffect;
HWND hDeviceWindow;
BOOL Windowed;
BOOL EnableAutoDepthStencil;
WINED3DFORMAT AutoDepthStencilFormat;
DWORD Flags;
UINT FullScreen_RefreshRateInHz;
UINT PresentationInterval;
} WINED3DPRESENT_PARAMETERS;
typedef enum _WINED3DRESOURCETYPE {
......
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