// Modified by: VZ (resolutions enumeration/change support, DirectDraw, ...)
// Created: 06/21/02
// RCS-ID: $Id$
-// Copyright: (c) wxWindows team
+// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// headers
// ---------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "display.h"
#endif
#if wxUSE_DISPLAY
#ifndef WX_PRECOMP
+ #include "wx/app.h"
#include "wx/dynarray.h"
+ #include "wx/frame.h"
#endif
#include "wx/dynload.h"
return true;
}
-HRESULT WINAPI wxDDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc,
+HRESULT WINAPI wxDDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc,
LPVOID lpContext)
{
// we need at least the mode size
- static const int FLAGS_REQUIRED = DDSD_HEIGHT | DDSD_WIDTH;
+ static const DWORD FLAGS_REQUIRED = DDSD_HEIGHT | DDSD_WIDTH;
if ( (lpDDSurfaceDesc->dwFlags & FLAGS_REQUIRED) == FLAGS_REQUIRED )
{
wxArrayVideoModes * const modes = (wxArrayVideoModes *)lpContext;
// initialize gs_displays using DirectX functions
static bool DoInitDirectX()
{
+#if wxUSE_LOG
// suppress the errors if ddraw.dll is not found
wxLog::EnableLogging(false);
+#endif
wxDynamicLibrary dllDX(_T("ddraw.dll"));
- wxLog::EnableLogging(true);
+#if wxUSE_LOG
+ wxLog::EnableLogging();
+#endif
if ( !dllDX.IsLoaded() )
return false;
wxZeroMemory(monInfo);
monInfo.cbSize = sizeof(monInfo);
- if ( !::GetMonitorInfo(dpyInfo.m_hmon, &monInfo) )
+ // NB: Cast from MONITORINFOEX* to MONITORINFO* is done because
+ // Mingw headers - unlike the ones from Microsoft's Platform SDK -
+ // don't derive the former from the latter in C++ mode and so
+ // the pointer's type is not converted implicitly.
+ if ( !::GetMonitorInfo(dpyInfo.m_hmon, (LPMONITORINFO)&monInfo) )
{
wxLogLastError(_T("GetMonitorInfo"));
}
return false;
}
-
+
return true;
}