I'd like to implement the proposed glGetProcAddressEXT() function
in Mesa 3.1 ASAP. Since I hadn't seen a specification for this
extension yet I decided to write a draft for it. It's attached
below. Please review and send comments. Especially take note of
the Issues section.
Thanks.
-Brian
Name
EXT_get_proc_address
Name Strings
GL_EXT_get_proc_address
Contact
Brian Paul, (brian_paul 'at' mesa3d.org)
Status
Planned for Mesa 3.1 and other OpenGL implementations.
Version
$Id$
Number
???
Dependencies
The extension is written against the OpenGL 1.2 Specification.
Overview
This extension adds a function (GetProcAddressEXT) which returns
the address of extension functions, given the function name. Since
the availability of extensions (and their functions) cannot be
determined until runtime, the address of extension functions
should be queried at runtime. This function provides a simple,
portable way to do so.
Issues
* Is this extension properly named?
* Is void * the appropriate return type?
* Should GetProcAddressEXT allow querying of itself?
* There's a recursion problem with this feature. The purpose of
GetProcAddressEXT is to return pointers to extension functions
and GetProcAddressEXT is itself such a function! This presents
a puzzle to the application developer.
New Procedures and Functions
void *GetProcAddressEXT(const ubyte *procName)
New Tokens
None.
Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation)
None
Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization)
None
Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment
Operations and the Frame Buffer)
None
Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions)
None
Additions to Chapter 6 of the OpenGL 1.2 Specification (State and State
Requests)
Add a new section numbered 6.1.13:
6.1.13 Obtaining Extension Function Pointers
The GL extensions which are available to a client application can
only be determined at runtime. Therefore, the address of extension
functions should be queried at runtime.
The function
void *GetProcAddressEXT(const ubyte *procName);
returns the address of the extension function named by procName.
NULL is returned if the named function is not available.
The pointer returned by GetProcAddressEXT should be cast to a
function type which matches the extension function's definition.
Functions which are extensions to the GL window system interface
(such as GLX and WGL) are also obtainable with GetProcAddressEXT.
Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
None
Additions to the GLX / WGL / AGL Specifications
None
GLX Protocol
???
Errors
INVALID_OPERATION is generated if GetProcAddressEXT is called
between Begin and End.
New State
None
Revision History
* Revision 1.1 - initial draft