- wxDisplayInfo *info = new wxDisplayInfo();
-
- // we need hMonitor to be able to map display id to it which is needed for
- // MonitorXXX() functions, in particular MonitorFromPoint()
- info->m_hmon = hMonitor;
-
- // we also store the display geometry
- info->m_rect.SetX ( lprcMonitor->left );
- info->m_rect.SetY ( lprcMonitor->top );
- info->m_rect.SetWidth ( lprcMonitor->right - lprcMonitor->left );
- info->m_rect.SetHeight ( lprcMonitor->bottom - lprcMonitor->top );
-
- // now add this monitor to the array
- gs_displays->Add(info);
-
- // continue the enumeration
- return true;
-}
-
-BOOL PASCAL
-wxDDEnumExCallback(GUID *pGuid,
- LPTSTR WXUNUSED(driverDescription),
- LPTSTR driverName,
- LPVOID WXUNUSED(lpContext),
- HMONITOR hmon)
-{
- if ( pGuid )
- {
- wxDisplayInfo *info = new wxDisplayInfo();
-
- info->m_hmon = hmon;
- info->m_guid = *pGuid;
- info->m_devName = driverName;
-
- gs_displays->Add(info);
- }
- //else: we're called for the primary monitor, skip it
-
- // continue the enumeration
- return true;
-}
-
-HRESULT WINAPI wxDDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc,
- LPVOID lpContext)
-{
- // we need at least the mode size
- static const DWORD FLAGS_REQUIRED = DDSD_HEIGHT | DDSD_WIDTH;
- if ( (lpDDSurfaceDesc->dwFlags & FLAGS_REQUIRED) == FLAGS_REQUIRED )
- {
- wxArrayVideoModes * const modes = (wxArrayVideoModes *)lpContext;
-
- modes->Add(wxVideoMode(lpDDSurfaceDesc->dwWidth,
- lpDDSurfaceDesc->dwHeight,
- lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount,
- lpDDSurfaceDesc->dwRefreshRate));
- }
-
- // continue the enumeration
- return DDENUMRET_OK;
-}
-
-// ----------------------------------------------------------------------------
-// local functions
-// ----------------------------------------------------------------------------
-
-// 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"));