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

d3d10core: Add a separate function for device initialization.

parent 893b3382
......@@ -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);
......
......@@ -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
{
......
......@@ -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;
}
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