diff --git a/dlls/d3d10core/d3d10core_main.c b/dlls/d3d10core/d3d10core_main.c index 273f15d6632..4151dd05336 100644 --- a/dlls/d3d10core/d3d10core_main.c +++ b/dlls/d3d10core/d3d10core_main.c @@ -81,13 +81,7 @@ static HRESULT WINAPI layer_create(enum dxgi_device_layer_id id, void **layer_ba } object = *layer_base; - - object->vtbl = &d3d10_device_vtbl; - object->inner_unknown_vtbl = &d3d10_device_inner_unknown_vtbl; - object->device_parent_vtbl = &d3d10_wined3d_device_parent_vtbl; - object->refcount = 1; - - object->outer_unknown = device_object; + d3d10_device_init(object, device_object); *device_layer = &object->inner_unknown_vtbl; TRACE("Created d3d10 device at %p\n", object); diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index f4535ce930d..35d5ed3e256 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -67,9 +67,6 @@ HRESULT parse_dxbc(const char *data, SIZE_T data_size, HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN; /* IDirect3D10Device */ -extern const struct ID3D10DeviceVtbl d3d10_device_vtbl DECLSPEC_HIDDEN; -extern const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl DECLSPEC_HIDDEN; -extern const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl DECLSPEC_HIDDEN; struct d3d10_device { const struct ID3D10DeviceVtbl *vtbl; @@ -81,6 +78,8 @@ struct d3d10_device IWineD3DDevice *wined3d_device; }; +void d3d10_device_init(struct d3d10_device *device, void *outer_unknown) DECLSPEC_HIDDEN; + /* ID3D10Texture2D */ struct d3d10_texture2d { diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index b3da2ed4c00..4898a091aa7 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -1117,7 +1117,7 @@ static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device *iface FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); } -const struct ID3D10DeviceVtbl d3d10_device_vtbl = +static const struct ID3D10DeviceVtbl d3d10_device_vtbl = { /* IUnknown methods */ d3d10_device_QueryInterface, @@ -1221,7 +1221,7 @@ const struct ID3D10DeviceVtbl d3d10_device_vtbl = d3d10_device_GetTextFilterSize, }; -const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl = +static const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl = { /* IUnknown methods */ d3d10_device_inner_QueryInterface, @@ -1425,7 +1425,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar return S_OK; } -const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl = +static const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl = { /* IUnknown methods */ device_parent_QueryInterface, @@ -1439,3 +1439,12 @@ const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl = device_parent_CreateVolume, device_parent_CreateSwapChain, }; + +void d3d10_device_init(struct d3d10_device *device, void *outer_unknown) +{ + device->vtbl = &d3d10_device_vtbl; + device->inner_unknown_vtbl = &d3d10_device_inner_unknown_vtbl; + device->device_parent_vtbl = &d3d10_wined3d_device_parent_vtbl; + device->refcount = 1; + device->outer_unknown = outer_unknown; +}