On Wed, Aug 17, 2016 at 8:58 AM, Ken Thomases ken@codeweavers.com wrote:
On Aug 16, 2016, at 11:46 PM, Ruslan Kabatsayev b7.10110111@gmail.com wrote:
On Wed, Aug 17, 2016 at 6:27 AM, Ken Thomases ken@codeweavers.com wrote:
You need to *not* include the system header and instead include <wgl.h> and, usually, <wglext.h>.
OK, this does appear to work. But I seem to now have to manually declare gluPerspective and other GLU functions I use, since Wine doesn't have anything like <wglu.h>, and the system header <GL/glu.h> conflicts with <wine/wgl.h> and <wine/wglext.h>. Am I missing something?
I don't think you're missing anything. Wine implements glu32, but doesn't seem to have the header. That achieves binary compatibility but not source compatibility. Your best bet for a quick and dirty fix is, as you've surmised, to declare those yourself. Probably best to copy the needed function signatures from dlls/glu32 so they're exact matches, but be sure to copy the ones prefixed with "wine_" to get the proper declspecs and remove the prefix. So, for example, gluPerspective() is implemented as:
int WINAPI wine_gluPerspective(double arg0,double arg1,double arg2,double arg3) { … }
So you would need to declare:
int WINAPI gluPerspective(double arg0,double arg1,double arg2,double arg3);
The "WINAPI" is critical to get the calling convention correct.
As a related issue, Wine's glu32 implementation is actually intimately tied to X11. It links against the the libGLU from XQuartz or X.org. Therefore, it won't work with the Mac driver. You have to use the X11 driver.
Would it be critical if I intend to send my addition as a patch for Wine? Should I avoid using glu32?
-Ken