+
+ return resultModes;
+}
+
+wxVideoMode wxDisplayImplMacOSX::GetCurrentMode() const
+{
+ CFDictionaryRef theValue = CGDisplayCurrentMode( m_id );
+
+ return wxVideoMode(
+ wxCFDictKeyToInt( theValue, kCGDisplayWidth ),
+ wxCFDictKeyToInt( theValue, kCGDisplayHeight ),
+ wxCFDictKeyToInt( theValue, kCGDisplayBitsPerPixel ),
+ wxCFDictKeyToInt( theValue, kCGDisplayRefreshRate ));
+}
+
+bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode )
+{
+ // Changing to default mode (wxDefaultVideoMode) doesn't
+ // work because we don't have access to the system's 'scrn'
+ // resource which holds the user's mode which the system
+ // will return to after this app is done
+ boolean_t bExactMatch;
+ CFDictionaryRef theCGMode = CGDisplayBestModeForParametersAndRefreshRate(
+ m_id,
+ (size_t)mode.bpp,
+ (size_t)mode.w,
+ (size_t)mode.h,
+ (double)mode.refresh,
+ &bExactMatch );
+
+ bool bOK = bExactMatch;
+
+ if (bOK)
+ bOK = CGDisplaySwitchToMode( m_id, theCGMode ) == CGDisplayNoErr;
+
+ return bOK;
+}
+
+// ============================================================================
+// wxDisplay::CreateFactory()
+// ============================================================================
+
+/* static */ wxDisplayFactory *wxDisplay::CreateFactory()
+{
+ return new wxDisplayFactoryMacOSX;