Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- v2: Style changes. Supersede 179851~179855
dlls/wined3d/directx.c | 10 ++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 3 +++ 3 files changed, 14 insertions(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 4d6f63c2ffb..f710e85687f 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -865,6 +865,16 @@ enum wined3d_pci_device wined3d_gpu_from_feature_level(enum wined3d_pci_vendor * return device_id; }
+struct wined3d_adapter * CDECL wined3d_get_adapter(const struct wined3d *wined3d, unsigned int idx) +{ + TRACE("wined3d %p, idx %u.\n", wined3d, idx); + + if (idx >= wined3d->adapter_count) + return NULL; + + return wined3d->adapters[idx]; +} + UINT CDECL wined3d_get_adapter_count(const struct wined3d *wined3d) { TRACE("wined3d %p, reporting %u adapters.\n", diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 8538b3dcd6e..0c30ffeac24 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -11,6 +11,7 @@ @ cdecl wined3d_decref(ptr) @ cdecl wined3d_enum_adapter_modes(ptr long long long long ptr) @ cdecl wined3d_find_closest_matching_adapter_mode(ptr long ptr) +@ cdecl wined3d_get_adapter(ptr long) @ cdecl wined3d_get_adapter_count(ptr) @ cdecl wined3d_get_adapter_display_mode(ptr long ptr ptr) @ cdecl wined3d_get_adapter_identifier(ptr long long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 908a1c92668..2841aa2f2e9 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2178,6 +2178,7 @@ struct wined3d_parent_ops };
struct wined3d; +struct wined3d_adapter; struct wined3d_blend_state; struct wined3d_buffer; struct wined3d_device; @@ -2262,6 +2263,8 @@ HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT a UINT mode_idx, struct wined3d_display_mode *mode); HRESULT __cdecl wined3d_find_closest_matching_adapter_mode(const struct wined3d *wined3d, unsigned int adapter_idx, struct wined3d_display_mode *mode); +struct wined3d_adapter * __cdecl wined3d_get_adapter(const struct wined3d *wined3d, + unsigned int idx); UINT __cdecl wined3d_get_adapter_count(const struct wined3d *wined3d); HRESULT __cdecl wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);