-wxArrayVideoModes wxDisplay::GetModes(const wxVideoMode& modeMatch) const
-{
-#ifdef HAVE_DDRAW_H
- return gs_useDirectX ? DoGetModesDirectX(modeMatch)
- : DoGetModesWindows(modeMatch);
-#else
- return DoGetModesWindows(modeMatch);
-#endif
-}
-
-wxVideoMode wxDisplay::GetCurrentMode() const
-{
- wxVideoMode mode;
-
- // The first parameter of EnumDisplaySettings() must be NULL under Win95
- // according to MSDN. The version of GetName() we implement for Win95
- // returns an empty string.
- const wxString name = GetName();
- const wxChar * const deviceName = name.empty() ? NULL : name.c_str();
-
- DEVMODE dm;
- dm.dmSize = sizeof(dm);
- dm.dmDriverExtra = 0;
- if ( !::EnumDisplaySettings(deviceName, ENUM_CURRENT_SETTINGS, &dm) )
- {
- wxLogLastError(_T("EnumDisplaySettings(ENUM_CURRENT_SETTINGS)"));
- }
- else
- {
- mode = ConvertToVideoMode(dm);
- }
-
- return mode;
-}
-
-// ----------------------------------------------------------------------------
-// video mode switching
-// ----------------------------------------------------------------------------
-
-#ifdef HAVE_DDRAW_H
-bool wxDisplay::DoChangeModeDirectX(const wxVideoMode& mode)
-{
- IDirectDraw2 *pDD = (*gs_displays)[m_index].m_pDD2;
- if ( !pDD )
- return false;
-
- wxWindow *winTop = wxTheApp->GetTopWindow();
- wxCHECK_MSG( winTop, false, _T("top level window required for DirectX") );
-
- HRESULT hr = pDD->SetCooperativeLevel
- (
- GetHwndOf(winTop),
- DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN
- );
- if ( FAILED(hr) )
- {
- wxLogApiError(_T("IDirectDraw::SetCooperativeLevel"), hr);
-
- return false;
- }
-
- hr = pDD->SetDisplayMode(mode.w, mode.h, mode.bpp, mode.refresh, 0);
- if ( FAILED(hr) )
- {
- wxLogApiError(_T("IDirectDraw::SetDisplayMode"), hr);
-
- return false;
- }
-
-
- return true;
-}
-#endif
-
-bool wxDisplay::DoChangeModeWindows(const wxVideoMode& mode)