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

d3d9: Partially implement IDirect3D9Ex::CreateDeviceEx().

parent 5e24ccfd
......@@ -181,7 +181,7 @@ typedef struct IDirect3DDevice9Impl
} IDirect3DDevice9Impl;
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
......
......@@ -3242,12 +3242,15 @@ static void setup_fpu(void)
}
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;
UINT i, count = 1;
HRESULT hr;
if (mode)
FIXME("Ignoring display mode.\n");
device->lpVtbl = &Direct3DDevice9_Vtbl;
device->device_parent_vtbl = &d3d9_wined3d_device_parent_vtbl;
device->ref = 1;
......
......@@ -425,7 +425,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3D9Impl_CreateDevice(IDirect3D9Ex
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))
{
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,
D3DPRESENT_PARAMETERS *parameters, D3DDISPLAYMODEEX *mode, IDirect3DDevice9Ex **device)
{
FIXME("iface %p, adapter %u, device_type %#x, focus_window %p, flags %#x,\n"
"parameters %p, mode %p, device %p stub!\n",
iface, adapter, device_type, focus_window, flags,
parameters, mode, device);
IDirect3D9Impl *d3d9 = (IDirect3D9Impl *)iface;
IDirect3DDevice9Impl *object;
HRESULT hr;
*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)
......
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