On Sat, 11 Sep 1999, Bernd Kreimeier wrote:

> Exactly. So intead of one entry point, we have several. 
> 
>  > I'm in favor of separate glGetProcAddressEXT, gluGetProcAddressEXT,
>  > glxGetProcAddress, etc functions.
> 
> There has to be a good technical reason then why 
> glxGetProcAddress isn't sufficient?

Yes, two reasons I think:

1) A program may choose not to link to glu. Hence
   glxGetProcAddress cannot tell the address of
   a glu function by having code like:

     if ( strcmp ( s, "gluEndCurve" ) ) return gluEndCurve ;

   ...so glu functions have to be interrogated by gluGetFuncAddressEXT

   Similarly, it is still desired by some people to use OpenGL
   under Linux without X. Those people won't take kindly to
   the inability to query gl functions because the query
   routine is in glX.

2) We might fondly imagine a day when this extension
   is universally adopted - even under Windoze, Apple, OS/2
   implementations.

   When that happens, portable programs will be able to call
   glGetFuncAddress and gluGetFuncAddress without nasty compile
   time hacks...In fact, the only time you'd need such hacks
   would be if you needed to check for glX/agl/pgl or wgl
   extensions...which are by definition not portable anyway.

I think it's worth the tiny amount of extra hassle to
keep things clean.

You can still legally say:

#ifndef WINDOZE
  void *wglGetFuncAddress ( char *s )
  {
    void *f ;

    if(!(f= glGetFuncAddress(s))) return f;
    if(!(f=gluGetFuncAddress(s))) return f;
#ifdef X_WIN
    if(!(f=glXGetFuncAddress(s))) return f;
#endif
#ifdef MAC_OS
    if(!(f=aglGetFuncAddress(s))) return f;
#endif
#ifdef OS2
    if(!(f=pglGetFuncAddress(s))) return f;
#endif
    return NULL ;
  }
#endif

...which covers all the bases in the meantime.

Steve Baker                (817)619-2657 (Vox/Vox-Mail)
Raytheon Systems Inc.      (817)619-2466 (Fax)
Work: [EMAIL PROTECTED]      http://www.hti.com
Home: [EMAIL PROTECTED] http://web2.airmail.net/sjbaker1

Reply via email to