On Thu, Nov 04, 1999 at 08:34:00AM -0800, Ron Bielaski wrote:
> This appears to be the only occurence where OpenGL behavior is
> inconsistant. That is, calling the returned function without
> testing for null could cause a crash.
True, but so can e.g. querying the result of glGetString without
testing for NULL.
> I would prefer to see an error or nop function returned so when
> calling an ARB_get_proc_address functions the behavior is
> similiar to calling GL functions without a current context.
> I don't recall offhand what GL noncurrent context functions do.
In general, undefined. Since we can now query *any* entry point, and
since error semantics are different for GL, GLX, and GLU entry points,
the only meaningful consistent (e.g. specifiable) behavior you could
require is "termination" or "noop". I don't think "noop" is useful to
the ISV; consider the scenario:
#ifdef GL_ARB_multitexture
/* Verify that GL_EXTENSIONS contains ARB_multitexture */
if (gluCheckExtension("GL_ARB_multitexture",
glGetString(GL_EXTENSIONS))
{
/* Valid ptr to "noop" function returned (note typo)*/
activetexptr = glXGetProcAddressARB("glActiveTextureARV");
}
#endif
...
(*activetexptr)(GL_TEXTURE2_ARB); /* Oops, noop */
... further calls affect/use texture 0 instead of texture 2
Now the app silently gets incorrect behavior, yet when the ISV
attempts to debug it, the call succeeds and the actual problem is far
removed from where it *seems* to be! So having a checkable
success/failure flag (NULL return) on the call seems desirable to me.
Jon Leech
SGI