--- Stephane Marchesin <[EMAIL PROTECTED]> wrote:
> Ian Romanick wrote:
> 
> >
> > Here's the deal.  glXGetProcAddress *NEVER* returns NULL.  It returns 
> > a pointer to a dispatch function.  If you request an unknown function,
> 
> > it will dynamically generate a dispatch for it.  Try calling 
> > 'glXGetProcAddressARB((const GLubyte*)"glThisFunctionDoesntExist");". 
> > Getting a pointer back isn't enough.  You have to look at the 
> > extension string to be sure the extension is supported.  If I'm not 
> > mistaken, the GLX spec says that calling a function for an unsupported
> 
> > extension give "undefined" behavior.
> >
> > There is no way, without great pain (I'm not even sure then), that we 
> > could prevent the segfault.  Using the pointer without checking for 
> > the extension is right up there with not checking the return from
> malloc.
> >
> >
> >
> I'm still after the SDL/glX/whatever bug with glXGetProcAddressARB, and 
> I read the extension specification at 
> http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt
> 
> . Here is an excerpt  :
> <<
> * Should the query return NULL for entry points not supported
> by the implementation, or a pointer to a function which
> generates an error?
> 
> NULL. There is no consistent way to generate errors
> when either GL or GLX functions may be queried.
>  >>
> 
> Do I misunderstand something, or does the spec for glXGetProcAddressARB 
> says the opposite ?
> 
> Stephane
> 

<<
    A return value of NULL indicates that the specified function does
    not exist for the implementation.

    A non-NULL return value for glXGetProcAddressARB does not guarantee
    that an extension function is actually supported at runtime. The
    client must must also query glGetString(GL_EXTENSIONS) or
    glXQueryExtensionsString to determine if an extension is supported
    by a particular context.
>>
It's true MESA dose NOT have any functions that do not exist for it's
implementation.  I.E. It will claim to implement
"glThisFunctionDoesntExist".  What your not seeing is that you MUST must
also query glGetString(GL_EXTENSIONS) or glXQueryExtensionsString to
determine if an extension is supported by a particular context.

As mesa dose not currently support "glThisFunctionDoesntExist" in any
context this test, glGetString or glXQueryExtensionsString, will NEVER
pass.



        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
--
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to