[Top] [All Lists]

glxext.h: missing typedef

To: ogl-sample@xxxxxxxxxxx
Subject: glxext.h: missing typedef
From: jmichaud@xxxxxxxxxxxxxxxxxxxx (Joseph Michaud)
Date: Mon, 18 Aug 2003 19:54:05 -0400
Sender: ogl-sample-bounce@xxxxxxxxxxx
1) Is glXGetProcAddress() (and glXGetProcAddressARB()) supposed to be
   defined as specified

     void (*glXGetProcAddressARB(const GLubyte *procName))(...)

   or as listed in the current glxext.h file (dated 2002/03/22)

     typedef void (*__GLXextFuncPtr)(void);
     extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);

   I ask because...

2) The __GLXextFuncPtr typedef is unavailable if glxext.h is
   used in conjunction with GL/gl.h.

   The current glxext.h defines the __GLXextFuncPtr typedef and the
   glXGetProcAddress() prototype:

     #ifndef GLX_ARB_get_proc_address
     typedef void (*__GLXextFuncPtr)(void);

     #ifndef GLX_VERSION_1_4
     #define GLX_VERSION_1_4 1
     extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
     #endif /* GLX_GLXEXT_PROTOTYPES */
     typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte 

   Unfortunately, an implementation (such as XFree86-devel-4.2.0-8) which
   defines the glXGetProcAddress() prototype will also define the
   GLX_ARB_get_proc_address macro in GL/gl.h, and the GLXextFuncPtr
   typedef won't get defined, causing a compile error.

   With the latest glxext.h, the following simple source file
   (foo.c) generates an error:
     cc -I. -c foo.c
     In file included from foo.c:13:
     glxext.h:362: parse error before `*'
     glxext.h:362: `__GLXextFuncPtr' declared as function returning a function
     #include <GL/glx.h>
     #include <glxext.h>
     void foo(void)


Joseph Michaud           SGI Applications Eng           jmichaud@xxxxxxx
vmail: 650-933-9455      office: 781-839-2100

<Prev in Thread] Current Thread [Next in Thread>
  • glxext.h: missing typedef, Joseph Michaud <=