d3d9: Implement d3d9_device_GetDisplayModeEx().

This commit is contained in:
Henri Verbeet 2012-06-27 19:02:29 +02:00 committed by Alexandre Julliard
parent 2c8834dffd
commit 0ce894f274
6 changed files with 40 additions and 17 deletions

View File

@ -421,7 +421,7 @@ static HRESULT WINAPI d3d8_device_GetDisplayMode(IDirect3DDevice8 *iface, D3DDIS
TRACE("iface %p, mode %p.\n", iface, mode);
wined3d_mutex_lock();
hr = wined3d_device_get_display_mode(device->wined3d_device, 0, &wined3d_mode);
hr = wined3d_device_get_display_mode(device->wined3d_device, 0, &wined3d_mode, NULL);
wined3d_mutex_unlock();
if (SUCCEEDED(hr))

View File

@ -363,7 +363,7 @@ static HRESULT WINAPI d3d9_device_GetDisplayMode(IDirect3DDevice9Ex *iface, UINT
TRACE("iface %p, swapchain %u, mode %p.\n", iface, swapchain, mode);
wined3d_mutex_lock();
hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain, &wined3d_mode);
hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain, &wined3d_mode, NULL);
wined3d_mutex_unlock();
if (SUCCEEDED(hr))
@ -2930,12 +2930,34 @@ static HRESULT WINAPI d3d9_device_ResetEx(IDirect3DDevice9Ex *iface,
return E_NOTIMPL;
}
static HRESULT WINAPI d3d9_device_GetDisplayModeEx(IDirect3DDevice9Ex *iface,
static HRESULT WINAPI d3d9_device_GetDisplayModeEx(IDirect3DDevice9Ex *iface,
UINT swapchain_idx, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation)
{
FIXME("iface %p, swapchain_idx %u, mode %p, rotation %p stub!\n", iface, swapchain_idx, mode, rotation);
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
struct wined3d_display_mode wined3d_mode;
HRESULT hr;
return E_NOTIMPL;
TRACE("iface %p, swapchain_idx %u, mode %p, rotation %p.\n",
iface, swapchain_idx, mode, rotation);
if (mode->Size != sizeof(*mode))
return D3DERR_INVALIDCALL;
wined3d_mutex_lock();
hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain_idx, &wined3d_mode,
(enum wined3d_display_rotation *)rotation);
wined3d_mutex_unlock();
if (SUCCEEDED(hr))
{
mode->Width = wined3d_mode.width;
mode->Height = wined3d_mode.height;
mode->RefreshRate = wined3d_mode.refresh_rate;
mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
mode->ScanLineOrdering = wined3d_mode.scanline_ordering;
}
return hr;
}
static const struct IDirect3DDevice9ExVtbl d3d9_device_vtbl =

View File

@ -175,7 +175,7 @@ static HRESULT WINAPI d3d9_swapchain_GetDisplayMode(IDirect3DSwapChain9 *iface,
TRACE("iface %p, mode %p.\n", iface, mode);
wined3d_mutex_lock();
hr = wined3d_swapchain_get_display_mode(swapchain->wined3d_swapchain, &wined3d_mode);
hr = wined3d_swapchain_get_display_mode(swapchain->wined3d_swapchain, &wined3d_mode, NULL);
wined3d_mutex_unlock();
if (SUCCEEDED(hr))

View File

@ -3715,17 +3715,18 @@ HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device
device->create_parms.device_type, caps);
}
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device,
UINT swapchain_idx, struct wined3d_display_mode *mode)
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx,
struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
{
struct wined3d_swapchain *swapchain;
HRESULT hr;
TRACE("device %p, swapchain_idx %u, mode %p.\n", device, swapchain_idx, mode);
TRACE("device %p, swapchain_idx %u, mode %p, rotation %p.\n",
device, swapchain_idx, mode, rotation);
if (SUCCEEDED(hr = wined3d_device_get_swapchain(device, swapchain_idx, &swapchain)))
{
hr = wined3d_swapchain_get_display_mode(swapchain, mode);
hr = wined3d_swapchain_get_display_mode(swapchain, mode, rotation);
wined3d_swapchain_decref(swapchain);
}

View File

@ -239,7 +239,7 @@ HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain
if (!QueryPerformanceCounter(&counter) || !QueryPerformanceFrequency(&freq_per_sec))
return WINED3DERR_INVALIDCALL;
if (FAILED(wined3d_swapchain_get_display_mode(swapchain, &mode)))
if (FAILED(wined3d_swapchain_get_display_mode(swapchain, &mode, NULL)))
return WINED3DERR_INVALIDCALL;
if (mode.refresh_rate == DEFAULT_REFRESH_RATE)
mode.refresh_rate = 60;
@ -261,14 +261,14 @@ HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain
}
HRESULT CDECL wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain,
struct wined3d_display_mode *mode)
struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
{
HRESULT hr;
TRACE("swapchain %p, mode %p.\n", swapchain, mode);
TRACE("swapchain %p, mode %p, rotation %p.\n", swapchain, mode, rotation);
hr = wined3d_get_adapter_display_mode(swapchain->device->wined3d,
swapchain->device->adapter->ordinal, mode, NULL);
swapchain->device->adapter->ordinal, mode, rotation);
TRACE("Returning w %u, h %u, refresh rate %u, format %s.\n",
mode->width, mode->height, mode->refresh_rate, debug_d3dformat(mode->format_id));

View File

@ -2117,8 +2117,8 @@ HRESULT __cdecl wined3d_device_get_creation_parameters(const struct wined3d_devi
HRESULT __cdecl wined3d_device_get_depth_stencil(const struct wined3d_device *device,
struct wined3d_surface **depth_stencil);
HRESULT __cdecl wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps);
HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device,
UINT swapchain_idx, struct wined3d_display_mode *mode);
HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx,
struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);
HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device *device,
UINT swapchain_idx, struct wined3d_surface *dst_surface);
void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device,
@ -2366,7 +2366,7 @@ HRESULT __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain
UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type, struct wined3d_surface **backbuffer);
struct wined3d_device * __cdecl wined3d_swapchain_get_device(const struct wined3d_swapchain *swapchain);
HRESULT __cdecl wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain,
struct wined3d_display_mode *mode);
struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);
HRESULT __cdecl wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain,
struct wined3d_surface *dst_surface);
HRESULT __cdecl wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain,