home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / System / Mesa-3.1 / docs / GL_EXT_get_proc_address.spec < prev    next >
Text File  |  1999-10-21  |  6KB  |  198 lines

  1. Name
  2.  
  3.     EXT_get_proc_address
  4.  
  5. Name Strings
  6.  
  7.     GL_EXT_get_proc_address
  8.  
  9. Contact
  10.  
  11.     Brian Paul, (brian_paul 'at' mesa3d.org)
  12.  
  13. Status
  14.  
  15.     Planned for Mesa 3.1 and other OpenGL implementations.
  16.  
  17. Version
  18.  
  19.     $Id: GL_EXT_get_proc_address.spec,v 1.5 1999/10/13 19:10:50 brianp Exp $
  20.  
  21. Number
  22.  
  23.     ???
  24.  
  25. Dependencies
  26.  
  27.     The extension is written against the OpenGL 1.2 Specification.
  28.  
  29. Overview
  30.  
  31.     This extension adds a function (GetProcAddressEXT) which returns
  32.     the address of extension functions, given the function name.  Since
  33.     the availability of extensions (and their functions) cannot be
  34.     determined until runtime, the address of extension functions
  35.     should be queried at runtime.  This function provides a simple,
  36.     portable way to do so.
  37.  
  38. Issues
  39.  
  40.   * Is this extension properly named?
  41.  
  42.         Yes.  EXT_get_func_address would be another option though.
  43.  
  44.   * Should a typedef be used for the return type?
  45.  
  46.         typedef void (*GLfunction)();
  47.         extern GLfunction glGetProcAddressEXT( const GLubyte *procName );
  48.  
  49.         Not needed.  The following works:
  50.  
  51.         void (*glGetProcAddressEXT(const GLubyte *procName))();
  52.  
  53.   * Should GetProcAddressEXT allow querying of itself?
  54.  
  55.         Yes, for sake of completeness.
  56.  
  57.   * There's a recursion problem with this feature.  The purpose of
  58.     GetProcAddressEXT is to return pointers to extension functions
  59.     and GetProcAddressEXT is itself such a function!  This presents
  60.     a puzzle to the application developer.
  61.  
  62.         A Linux/OpenGL Standard Base-compliant OpenGL library will
  63.         always have GetProcAddressEXT.
  64.  
  65.   * Should extension functions in GLU, GLX, WGL, etc. be queryable through
  66.     this extension?
  67.  
  68.         No, the companion functions gluGetProcAddressEXT,
  69.         glXGetProcAddressEXT, etc. should be used instead.
  70.         Otherwise, all sorts of module abstraction violations have
  71.         to be dealt with.
  72.  
  73.   * Should the core functions added in OpenGL 1.1 and 1.2 also be queryable?
  74.  
  75.         Yes.  This will allow maximum portability of applications across
  76.         OpenGL 1.0, 1.1 and 1.2 library implementations.
  77.  
  78.   * Are function pointers context-dependent?
  79.  
  80.         No.  The pointer to an extension function can be used with any
  81.         context which supports the extension.
  82.  
  83.         There was concern that function dispatch for context-independent
  84.         pointers wouldn't be as efficient as context-dependent pointers.
  85.         After discussion it was agreed that the performance difference
  86.         would be negligible or nonexistant.
  87.  
  88. New Procedures and Functions
  89.  
  90.     void (*GetProcAddressEXT(const GLubyte *procName))()
  91.  
  92. New Tokens
  93.  
  94.     None.
  95.  
  96. Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation)
  97.  
  98.     None
  99.  
  100. Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization)
  101.  
  102.     None
  103.  
  104. Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment
  105. Operations and the Frame Buffer)
  106.  
  107.     None
  108.  
  109. Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special 
  110. Functions)
  111.  
  112.     None
  113.  
  114. Additions to Chapter 6 of the OpenGL 1.2 Specification (State and State
  115. Requests)
  116.  
  117.     Add a new section numbered 6.1.13:
  118.  
  119.     6.1.13 Obtaining Extension Function Pointers
  120.  
  121.     The GL extensions which are available to a client application can
  122.     only be determined at runtime.  Therefore, the address of extension
  123.     functions should be queried at runtime.
  124.  
  125.     The function
  126.         void (*)() GetProcAddressEXT(const ubyte *procName);
  127.     returns the address of the extension function named by procName.
  128.  
  129.     The pointer returned by GetProcAddressEXT should be cast to a
  130.     function type which matches the extension function's definition.
  131.  
  132.     If GetProcAddressEXT returns a non-NULL pointer it is not guaranteed
  133.     that the particular extension is available.  The client application
  134.     must also query GetString(EXTENSIONS) to determine if the extension
  135.     is present.
  136.  
  137.     The address returned by GetProcAddressEXT is independent of the
  138.     currently bound context and may be used by any context which supports
  139.     the extension.  Furthermore, if the function entrypoint is also
  140.     exported by the library, the following is true:
  141.  
  142.         GetProcAddressEXT(<function>) = &<function>
  143.  
  144.     For example:
  145.         GetProcAddressEXT("glActiveTextureARB") = &glActiveTextureARB
  146.  
  147.     GetProcAddressEXT can only be used to query functions inside the
  148.     main GL library.  Specifically, extension functions in GLU, GLX, WGL,
  149.     etc. are not obtainable with this function.
  150.  
  151. Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
  152.  
  153.     None
  154.  
  155. Additions to the GLX / WGL / AGL Specifications
  156.  
  157.     None
  158.  
  159. GLX Protocol
  160.  
  161.     ???
  162.  
  163. Errors
  164.  
  165.     As with other client-side queries, calling GetProcAddressEXT between
  166.     Begin and End is not allowed but may or may not generate an
  167.     INVALID_OPERATION error.  If an error is not generated, GL operation
  168.     is undefined.
  169.  
  170. New State
  171.  
  172.     None
  173.  
  174. Revision History
  175.  
  176.   * Revision 1.1 - initial draft (8 Sep 1999)
  177.  
  178.   * Revision 1.2 - (9 Sep 1999)
  179.                  - don't allow querying of GLU, GLX, WGL functions
  180.                  - changed return type to void (*)()
  181.                  - allow querying of all core functions except those
  182.                    defined since version 1.0
  183.                  - clarification of GetProcAddressEXT behavior with
  184.                    respect to GL contexts
  185.                  - updated the Issues section
  186.  
  187.   * Revision 1.3 - (16 Sep 1999)
  188.                  - clarification of the return type issue
  189.  
  190.   * Revision 1.4 - (13 Oct 1999)
  191.                  - function pointers are now context independent and
  192.                    equivalent to the address of the function if it's
  193.                    exported by the GL library.
  194.  
  195.   * Revision 1.5 - (13 Oct 1999)
  196.                  - calling GetProcAddressEXT between Begin/End may or may
  197.                    not generate an error.
  198.