d3d9: Partially implement IDirect3D9Ex::CreateDeviceEx().
This commit is contained in:
parent
5e24ccfd0c
commit
cd957f5b64
|
@ -181,7 +181,7 @@ typedef struct IDirect3DDevice9Impl
|
||||||
} IDirect3DDevice9Impl;
|
} IDirect3DDevice9Impl;
|
||||||
|
|
||||||
HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapter, D3DDEVTYPE device_type,
|
HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapter, D3DDEVTYPE device_type,
|
||||||
HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN;
|
HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters, D3DDISPLAYMODEEX *mode) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* IDirect3DVolume9 implementation structure
|
* IDirect3DVolume9 implementation structure
|
||||||
|
|
|
@ -3242,12 +3242,15 @@ static void setup_fpu(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapter, D3DDEVTYPE device_type,
|
HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapter, D3DDEVTYPE device_type,
|
||||||
HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters)
|
HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters, D3DDISPLAYMODEEX *mode)
|
||||||
{
|
{
|
||||||
WINED3DPRESENT_PARAMETERS *wined3d_parameters;
|
WINED3DPRESENT_PARAMETERS *wined3d_parameters;
|
||||||
UINT i, count = 1;
|
UINT i, count = 1;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (mode)
|
||||||
|
FIXME("Ignoring display mode.\n");
|
||||||
|
|
||||||
device->lpVtbl = &Direct3DDevice9_Vtbl;
|
device->lpVtbl = &Direct3DDevice9_Vtbl;
|
||||||
device->device_parent_vtbl = &d3d9_wined3d_device_parent_vtbl;
|
device->device_parent_vtbl = &d3d9_wined3d_device_parent_vtbl;
|
||||||
device->ref = 1;
|
device->ref = 1;
|
||||||
|
|
|
@ -425,7 +425,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3D9Impl_CreateDevice(IDirect3D9Ex
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = device_init(object, This->WineD3D, adapter, device_type, focus_window, flags, parameters);
|
hr = device_init(object, This->WineD3D, adapter, device_type, focus_window, flags, parameters, NULL);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
WARN("Failed to initialize device, hr %#x.\n", hr);
|
WARN("Failed to initialize device, hr %#x.\n", hr);
|
||||||
|
@ -469,14 +469,32 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3D9ExImpl_CreateDeviceEx(IDirect3
|
||||||
UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags,
|
UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags,
|
||||||
D3DPRESENT_PARAMETERS *parameters, D3DDISPLAYMODEEX *mode, IDirect3DDevice9Ex **device)
|
D3DPRESENT_PARAMETERS *parameters, D3DDISPLAYMODEEX *mode, IDirect3DDevice9Ex **device)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, adapter %u, device_type %#x, focus_window %p, flags %#x,\n"
|
IDirect3D9Impl *d3d9 = (IDirect3D9Impl *)iface;
|
||||||
"parameters %p, mode %p, device %p stub!\n",
|
IDirect3DDevice9Impl *object;
|
||||||
iface, adapter, device_type, focus_window, flags,
|
HRESULT hr;
|
||||||
parameters, mode, device);
|
|
||||||
|
|
||||||
*device = NULL;
|
TRACE("iface %p, adapter %u, device_type %#x, focus_window %p, flags %#x, parameters %p, mode %p, device %p.\n",
|
||||||
|
iface, adapter, device_type, focus_window, flags, parameters, mode, device);
|
||||||
|
|
||||||
return D3DERR_DRIVERINTERNALERROR;
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||||
|
if (!object)
|
||||||
|
{
|
||||||
|
ERR("Failed to allocate device memory.\n");
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr = device_init(object, d3d9->WineD3D, adapter, device_type, focus_window, flags, parameters, mode);
|
||||||
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
WARN("Failed to initialize device, hr %#x.\n", hr);
|
||||||
|
HeapFree(GetProcessHeap(), 0, object);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("Created device %p.\n", object);
|
||||||
|
*device = (IDirect3DDevice9Ex *)object;
|
||||||
|
|
||||||
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDirect3D9ExImpl_GetAdapterLUID(IDirect3D9Ex *iface, UINT adapter, LUID *luid)
|
static HRESULT WINAPI IDirect3D9ExImpl_GetAdapterLUID(IDirect3D9Ex *iface, UINT adapter, LUID *luid)
|
||||||
|
|
Loading…
Reference in New Issue