Commit 8d89d0ec authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

dxgi: Implement dxgi_output_FindClosestMatchingMode().

parent 41d29a79
......@@ -228,9 +228,42 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
static HRESULT STDMETHODCALLTYPE dxgi_output_FindClosestMatchingMode(IDXGIOutput *iface,
const DXGI_MODE_DESC *mode, DXGI_MODE_DESC *closest_match, IUnknown *device)
{
FIXME("iface %p, mode %p, closest_match %p, device %p stub!\n", iface, mode, closest_match, device);
struct dxgi_output *output = impl_from_IDXGIOutput(iface);
struct wined3d_display_mode wined3d_mode;
struct dxgi_adapter *adapter;
struct wined3d *wined3d;
HRESULT hr;
TRACE("iface %p, mode %p, closest_match %p, device %p.\n", iface, mode, closest_match, device);
if ((!mode->Width && mode->Height) || (mode->Width && !mode->Height))
return DXGI_ERROR_INVALID_CALL;
if (mode->Format == DXGI_FORMAT_UNKNOWN && !device)
return DXGI_ERROR_INVALID_CALL;
TRACE("Mode: %s.\n", debug_dxgi_mode(mode));
if (mode->Format == DXGI_FORMAT_UNKNOWN)
{
FIXME("Matching formats to device not implemented.\n");
return E_NOTIMPL;
}
adapter = output->adapter;
wined3d = adapter->factory->wined3d;
wined3d_mutex_lock();
wined3d_display_mode_from_dxgi(&wined3d_mode, mode);
hr = wined3d_find_closest_matching_adapter_mode(wined3d, adapter->ordinal, &wined3d_mode);
wined3d_mutex_unlock();
if (SUCCEEDED(hr))
{
dxgi_mode_from_wined3d(closest_match, &wined3d_mode);
TRACE("Returning %s.\n", debug_dxgi_mode(closest_match));
}
return hr;
}
static HRESULT STDMETHODCALLTYPE dxgi_output_WaitForVBlank(IDXGIOutput *iface)
......
......@@ -225,7 +225,7 @@ static void compute_expected_swapchain_fullscreen_state_after_fullscreen_change_
mode_desc.Width = new_width;
mode_desc.Height = new_height;
hr = IDXGIOutput_FindClosestMatchingMode(target, &mode_desc, &mode_desc, NULL);
todo_wine ok_(__FILE__, line)(SUCCEEDED(hr), "FindClosestMatchingMode failed, hr %#x.\n", hr);
ok_(__FILE__, line)(SUCCEEDED(hr), "FindClosestMatchingMode failed, hr %#x.\n", hr);
new_width = mode_desc.Width;
new_height = mode_desc.Height;
}
......
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