d3d8 / wined3d, missing prototypes

H. Verbeet hverbeet at gmail.com
Sun Sep 25 13:05:10 CDT 2005


When compiling d3d8 and wined3d I get quite a few warnings about
missing function prototypes. Eg, "warning: implicit declaration of
function `glMultiTexCoord1f'" etc.
This in turn causes things like texture coordinates to be all messed
up (screenshot attached). I'm using the nVidia OpenGL headers.

In the case of wined3d it seems to be caused by GL_GLEXT_PROTOTYPES
being defined to late.

In include/wine/wined3d_gl.h:
#define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
#include <GL/gl.h>
#define GL_GLEXT_PROTOTYPES
#define GLX_GLXEXT_PROTOTYPES
#include <GL/glx.h>
#ifdef HAVE_GL_GLEXT_H
# include <GL/glext.h>
#endif
#undef  XMD_H

Seems ok, but gl.h actually includes glext.h:
#ifndef GL_GLEXT_LEGACY
#include <GL/glext.h>
#endif

Moving the #define GL_GLEXT_PROTOTYPES up to before the #include
<GL/gl.h> fixes it. Pretty much the same goes for d3d8, except that
for d3d8 GL_GLEXT_PROTOTYPES doesn't appear to be defined at all.

In both include/wine/wined3d_gl.h and dlls/d3d8/d3d8_private.h the
relevant section should then become:
#define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#define GLX_GLXEXT_PROTOTYPES
#include <GL/glx.h>
#ifdef HAVE_GL_GLEXT_H
# include <GL/glext.h>
#endif
#undef  XMD_H
-------------- next part --------------
A non-text attachment was scrubbed...
Name: u2xmp_0.png
Type: image/png
Size: 11187 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20050925/7ca87113/u2xmp_0.png


More information about the wine-devel mailing list