[Wine] Re: OSX 10.5 - XQuartz 2.3.3 - GLX issue

rwoodsmall wineforum-user at winehq.org
Wed Mar 11 20:54:29 CDT 2009


I generally compile Wine from source, and install into /usr/local/software/wine/wine-1.X.X - this allows you to keep multiple versions around for testing.  Set paths appropriately in your shell, and using multiple versioned Wine installs is as easy as using multiple WINEPREFIXes.  Things to keep in mind: just because something is listed as platinum in one version doesn't mean it will be platinum in the version you're running; there could have been a regression in the devel version where a fixed bug causes another issue to pop up.  Keeping multiple versions around is a fantastic way to test for regressions.  I run my Steam games under a purchased copy of CrossOver Games Mac, Gothic I and II from http://gog.com under custom-compiled Wine 1.0.1 and Morrowind under another custom-compiled Wine built from CodeWeavers' CrossOver Games distributed source from http://www.codeweavers.com/products/source.  Find a platinum app on a newish version, and go with that for your testing; leave multiple versions around to check for regressions; etc.

All this being said, the easiest/most minimal workaround is to patch the file dlls/winex11.drv/opengl.c to force a certain GLX codepath.  Around line 486 in the file (at least in latest 1.1.16 devel) you can change this:


Code:
} else if(glxRequireExtension("GLX_SGIX_fbconfig")) {



to read something like this:


Code:
} else if(
#ifdef __APPLE__
              TRUE ||
#endif
glxRequireExtension("GLX_SGIX_fbconfig")) {



After making the change, recompile, making sure you're linking to the Xquartz OpenGL lib (/usr/X11/lib/libGL.dylib) and using the proper headers (/usr/X11/include).  If you're using MacPorts or Fink, make sure they're not in your environment - there can be strange conflicts if you're not careful.

GCC on Mac OS X defines "__APPLE__" so basically, if that's defined, it forces the setup for the more "flexed," stable SGIX_fbconfig GLX extension to be used instead of either finding the GLX 1.3+ config (which may or may not work, as Xquartz+OpenGL is a moving target) or dropping out with the "expect problems" message you first reported.

Saw your bug report on the Xquartz tracker - http://xquartz.macosforge.org/trac/ticket/122.  The SGIX_fbconfig code behaves much better with Xquartz than anything else I've found.  X11 on OS X has been something of a second-class citizen, and still remains so, though Jeremy and George are doing fantastic work.  The 2.3.3 and 2.4.0 beta/RC stuff, though, uses a completely retooled libGL for X11 that basically sits atop the system's OpenGL framework and utilizes it wherever possible.  I've used Wine happily on Linux/BSD in the past, but after months of reading code (Wine and Xquartz), Direct3D is finally in a nearly-working state - good enough for me to play my favorite games, anyway.

The CrossOver Games source is a pretty great reference as well.  If you want to see some workarounds to any Mac-specific problems, take a gander there and it can only help.  Some of the work around are not the cleanest, but hey, they're something.

If anyone else has a near-stock open source Wine install working with OpenGL/Direct3D on their Mac, holler this way.  I'd love to hear your experiences, workarounds, etc.!  And if you have any questions, I can at least try to answer them...

 -ryan







More information about the wine-users mailing list