wined3d: The wined3d object doesn't need a parent.

This commit is contained in:
Henri Verbeet 2012-05-02 21:47:57 +02:00 committed by Alexandre Julliard
parent 5b680d6023
commit 9267148705
9 changed files with 10 additions and 22 deletions

View File

@ -45,7 +45,7 @@ IDirect3D8* WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT SDKVersion) {
object->IDirect3D8_iface.lpVtbl = &Direct3D8_Vtbl;
object->ref = 1;
object->WineD3D = wined3d_create(8, WINED3D_LEGACY_DEPTH_BIAS, &object->IDirect3D8_iface);
object->WineD3D = wined3d_create(8, WINED3D_LEGACY_DEPTH_BIAS);
TRACE("Created Direct3D object @ %p, WineObj @ %p\n", object, object->WineD3D);

View File

@ -40,7 +40,7 @@ IDirect3D9* WINAPI DECLSPEC_HOTPATCH Direct3DCreate9(UINT SDKVersion) {
object->ref = 1;
wined3d_mutex_lock();
object->WineD3D = wined3d_create(9, 0, object);
object->WineD3D = wined3d_create(9, 0);
wined3d_mutex_unlock();
TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);

View File

@ -5559,8 +5559,7 @@ HRESULT ddraw_init(struct ddraw *ddraw, enum wined3d_device_type device_type)
ddraw->orig_width = GetSystemMetrics(SM_CXSCREEN);
ddraw->orig_height = GetSystemMetrics(SM_CYSCREEN);
ddraw->wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS,
&ddraw->IDirectDraw7_iface);
ddraw->wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS);
if (!ddraw->wined3d)
{
WARN("Failed to create a wined3d object.\n");

View File

@ -300,7 +300,7 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory)
factory->refcount = 1;
EnterCriticalSection(&dxgi_cs);
factory->wined3d = wined3d_create(10, 0, factory);
factory->wined3d = wined3d_create(10, 0);
if (!factory->wined3d)
{
LeaveCriticalSection(&dxgi_cs);

View File

@ -5031,13 +5031,6 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, e
return WINED3D_OK;
}
void * CDECL wined3d_get_parent(const struct wined3d *wined3d)
{
TRACE("wined3d %p.\n", wined3d);
return wined3d->parent;
}
static void WINE_GLAPI invalid_func(const void *data)
{
ERR("Invalid vertex attribute function called\n");
@ -5506,11 +5499,10 @@ const struct wined3d_parent_ops wined3d_null_parent_ops =
};
/* Do not call while under the GL lock. */
HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags, void *parent)
HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags)
{
wined3d->dxVersion = version;
wined3d->ref = 1;
wined3d->parent = parent;
wined3d->flags = flags;
if (!InitAdapters(wined3d))

View File

@ -6,7 +6,7 @@
@ cdecl wined3d_check_device_format_conversion(ptr long long long long)
@ cdecl wined3d_check_device_multisample_type(ptr long long long long long ptr)
@ cdecl wined3d_check_device_type(ptr long long long long long)
@ cdecl wined3d_create(long long ptr)
@ cdecl wined3d_create(long long)
@ cdecl wined3d_decref(ptr)
@ cdecl wined3d_enum_adapter_modes(ptr long long long ptr)
@ cdecl wined3d_get_adapter_count(ptr)
@ -15,7 +15,6 @@
@ cdecl wined3d_get_adapter_mode_count(ptr long long)
@ cdecl wined3d_get_adapter_monitor(ptr long)
@ cdecl wined3d_get_device_caps(ptr long long ptr)
@ cdecl wined3d_get_parent(ptr)
@ cdecl wined3d_incref(ptr)
@ cdecl wined3d_register_software_device(ptr ptr)

View File

@ -90,7 +90,7 @@ struct wined3d_settings wined3d_settings =
};
/* Do not call while under the GL lock. */
struct wined3d * CDECL wined3d_create(UINT version, DWORD flags, void *parent)
struct wined3d * CDECL wined3d_create(UINT version, DWORD flags)
{
struct wined3d *object;
HRESULT hr;
@ -102,7 +102,7 @@ struct wined3d * CDECL wined3d_create(UINT version, DWORD flags, void *parent)
return NULL;
}
hr = wined3d_init(object, version, flags, parent);
hr = wined3d_init(object, version, flags);
if (FAILED(hr))
{
WARN("Failed to initialize wined3d object, hr %#x.\n", hr);

View File

@ -1656,14 +1656,13 @@ void wined3d_get_draw_rect(const struct wined3d_state *state, RECT *rect) DECLSP
struct wined3d
{
LONG ref;
void *parent;
DWORD flags;
UINT dxVersion;
UINT adapter_count;
struct wined3d_adapter adapters[1];
};
HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags, void *parent) DECLSPEC_HIDDEN;
HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags) DECLSPEC_HIDDEN;
BOOL wined3d_register_window(HWND window, struct wined3d_device *device) DECLSPEC_HIDDEN;
void wined3d_unregister_window(HWND window) DECLSPEC_HIDDEN;

View File

@ -2009,7 +2009,7 @@ HRESULT __cdecl wined3d_check_device_multisample_type(const struct wined3d *wine
HRESULT __cdecl wined3d_check_device_type(const struct wined3d *wined3d, UINT adapter_idx,
enum wined3d_device_type device_type, enum wined3d_format_id display_format_id,
enum wined3d_format_id backbuffer_format_id, BOOL windowed);
struct wined3d * __cdecl wined3d_create(UINT dxVersion, DWORD flags, void *parent);
struct wined3d * __cdecl wined3d_create(UINT version, DWORD flags);
ULONG __cdecl wined3d_decref(struct wined3d *wined3d);
HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx,
enum wined3d_format_id format_id, UINT mode_idx, struct wined3d_display_mode *mode);
@ -2023,7 +2023,6 @@ UINT __cdecl wined3d_get_adapter_mode_count(const struct wined3d *wined3d,
HMONITOR __cdecl wined3d_get_adapter_monitor(const struct wined3d *wined3d, UINT adapter_idx);
HRESULT __cdecl wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapter_idx,
enum wined3d_device_type device_type, WINED3DCAPS *caps);
void * __cdecl wined3d_get_parent(const struct wined3d *wined3d);
ULONG __cdecl wined3d_incref(struct wined3d *wined3d);
HRESULT __cdecl wined3d_register_software_device(struct wined3d *wined3d, void *init_function);