Re: [AD] OS X port depends on OS X 10.6

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 18 Jan 2011, at 12:13 , Trent Gamblin wrote:
> I may be wrong, but I can't (and the compiler can't) find these symbols
> when using the 10.5 SDK. Symbols such as CGDisplayCopyAllDisplayModes,
> CGDisplayModeRef, CGDisplayModeGetHeight, etc.

My first guess is that something is messed up about your project settings. The code has (or should have) things like

#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
   CGDisplayCapture(dpy->display_id);
   CFDictionaryRef mode = CGDisplayBestModeForParametersAndRefreshRate(dpy->display_id, dpy->depth, w, h, dpy->parent.refresh_rate, NULL);
   CGDisplaySwitchToMode(dpy->display_id, mode);
#else
   CGDisplayModeRef mode = NULL;
   CFArrayRef modes = NULL;
   CFStringRef pixel_format = NULL;
   int i;

   /* Set pixel format string */
   if (dpy->depth == 32)
      pixel_format = CFSTR(IO32BitDirectPixels);
   if (dpy->depth == 16)
      pixel_format = CFSTR(IO16BitDirectPixels);
   if (dpy->depth == 8)
      pixel_format = CFSTR(IO8BitIndexedPixels);
   modes = CGDisplayCopyAllDisplayModes(dpy->display_id, NULL);

etc.

(Example from osxgl.m, looking for CGDisplayCopyAllDisplayModes).
Make sure the VERSION_MIN_REQUIRED matches the SDK you're linking against and you should be fine.

The only reason for using that long (and ugly) bit of code in that particular section, by the way, is that CGDisplayBestModeForParametersAndRefreshRate is deprecated in 10.6...

Evert



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/