Jon Smirl wrote:
--- Ian Romanick <[EMAIL PROTECTED]> 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.


Why do you dynamically generate a dispatch for unknown functions instead of just
returning null? What does this dispatch dispatch to?

The linux OpenGL ABI requires that GetProcAddressARB return the same value in all contexts, including ones which haven't been created yet. Therefore you can't return NULL as someone might create a new context which has a different set of extensions enabled (direct vs. indirect, different heads, etc). If you had returned null, the new context wouldn't be able to add that extension.


Keith




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
--
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to