From 230c62a978a6fd236e0b8073b5fac34defe94571 Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Tue, 20 Jul 2010 22:34:49 +0200 Subject: wined3d: Try to retrieve displayorientation and scanlineordering in IWineD3DImpl_GetAdapterDisplayMode. Tests show we can use EnumDisplaySettingsExW to retrieve the displayorinetation but wine's EnumDisplaySettingsExW isn't that smart yet, so we will fall back to WINED3DDISPLAYROTATION_IDENTITY for now. Not sure if we can retrieve the scanlineordering in wine, so for now fall back to WINED3DSCANLINEORDERING_PROGRESSIVE; --- dlls/wined3d/directx.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index b809087..de6cb64 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -25,6 +25,13 @@ #include "config.h" #include +#include + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" + #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); @@ -2862,7 +2869,7 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte static HRESULT WINAPI IWineD3DImpl_GetAdapterDisplayMode(IWineD3D *iface, UINT Adapter, WINED3DDISPLAYMODE *pMode, struct wined3d_adapter_info_ex *adapterinfo) { - TRACE("iface %p, adapter_idx %u, display_mode %p.\n", iface, Adapter, pMode); + TRACE("iface %p, adapter_idx %u, display_mode %p, adapterinfo %p.\n", iface, Adapter, pMode, adapterinfo); if (NULL == pMode || Adapter >= IWineD3D_GetAdapterCount(iface)) { @@ -2876,7 +2883,7 @@ static HRESULT WINAPI IWineD3DImpl_GetAdapterDisplayMode(IWineD3D *iface, UINT A ZeroMemory(&DevModeW, sizeof(DevModeW)); DevModeW.dmSize = sizeof(DevModeW); - EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &DevModeW, 0); + EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &DevModeW, adapterinfo ? EDS_ROTATEDMODE : 0); pMode->Width = DevModeW.dmPelsWidth; pMode->Height = DevModeW.dmPelsHeight; bpp = DevModeW.dmBitsPerPel; @@ -2887,6 +2894,14 @@ static HRESULT WINAPI IWineD3DImpl_GetAdapterDisplayMode(IWineD3D *iface, UINT A } pMode->Format = pixelformat_for_depth(bpp); + + if (adapterinfo) + { + adapterinfo->Rotation = DevModeW.dmDisplayOrientation ? DevModeW.dmDisplayOrientation : WINED3DDISPLAYROTATION_IDENTITY; + /* FIXME: how can we retrieve the ScanLineOrdering?*/ + adapterinfo->ScanLineOrdering = WINED3DSCANLINEORDERING_PROGRESSIVE; + } + } else { FIXME_(d3d_caps)("Adapter not primary display\n"); } -- 1.7.0.4