15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_get_proc_address
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GLX_ARB_get_proc_address
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Brian Paul (brian_paul 'at' mesa3d.org)
125bd8deadSopenharmony_ci    Jon Leech (ljp 'at' sgi.com)
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciNotice
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Copyright (c) 1999-2013 The Khronos Group Inc. Copyright terms at
175bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciSpecification Update Policy
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
225bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
235bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
245bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
255bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
265bd8deadSopenharmony_ci    described in more detail at
275bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ciStatus
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ci    Complete. Approved by ARB on 12/8/1999
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciVersion
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    Last Modified Date: January 3, 2000
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciNumber
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    ARB Extension #2
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciDependencies
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    The extension is written against the GLX 1.3 Specification.
445bd8deadSopenharmony_ci    May be implemented in any version of GLX and OpenGL.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ciOverview
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    This extension adds a function to return the address of GLX
495bd8deadSopenharmony_ci    and GL extension functions, given the function name. This is
505bd8deadSopenharmony_ci    necessary with (for example) heterogenous implementations where
515bd8deadSopenharmony_ci    hardware drivers may implement extension functions not known to the
525bd8deadSopenharmony_ci    link library; a similar situation on Windows implementations
535bd8deadSopenharmony_ci    resulted in the wglGetProcAddress function.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ciIP Status
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    No IP is believed to be involved (dynamic querying of library entry
585bd8deadSopenharmony_ci    points is supported in all modern operating systems).
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ciIssues
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci    * Is this extension properly named?
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci        Yes. If it does not achieve ARB approval, it will be implemented
655bd8deadSopenharmony_ci        as an EXT.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    * Should a typedef be used for the return type?
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci        typedef void (*GLfunction)();
705bd8deadSopenharmony_ci        extern GLfunction glXGetProcAddressARB(const GLubyte *procName);
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci        Not needed - see the function declaration
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci        void (*glXGetProcAddressARB(const GLubyte *procName))();
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    * Should GetProcAddressARB allow querying of itself?
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci        Yes, for sake of completeness.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    * There's a recursion problem with this feature. The purpose of
815bd8deadSopenharmony_ci      GetProcAddressARB is to return pointers to extension functions and
825bd8deadSopenharmony_ci      GetProcAddressARB is itself such a function! This presents a
835bd8deadSopenharmony_ci      puzzle to the application developer.
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci        Implementations must export the glXGetProcAddressARB entry point
865bd8deadSopenharmony_ci        statically.
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    * Should extension functions in GLU and GLX be queryable through
895bd8deadSopenharmony_ci      this extension?
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci        GLX: Yes. GLU: No. Because the pointers returned are
925bd8deadSopenharmony_ci        context-independent, the query was lifted from GL (in which all
935bd8deadSopenharmony_ci        behavior is necessarily context-dependent) into GLX, where
945bd8deadSopenharmony_ci        context management occurs. Since GLU is a client library using
955bd8deadSopenharmony_ci        GL, GLU extensions are unlikely to need to be dynamically
965bd8deadSopenharmony_ci        queryable. This capability could be added in a future extension.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    * GLU library may not be loaded at runtime, making GLU queries fail
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci        No longer relevant, since GLU functions cannot be queries now.
1015bd8deadSopenharmony_ci        The previous resolution was:
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci        True. However, the GL/GLX/GLU specifications say nothing about
1045bd8deadSopenharmony_ci        "libraries" and link/runtime issues in any event, and the same
1055bd8deadSopenharmony_ci        criticism might be applied to GL or GLX queries depending on how
1065bd8deadSopenharmony_ci        the development and runtime tools on a particular platform
1075bd8deadSopenharmony_ci        operate. Requiring a link against a "GLU library" in this case
1085bd8deadSopenharmony_ci        should be in the release notes for a platform.
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    * Should corresponding functions exist in the window-system specific
1115bd8deadSopenharmony_ci      layer on non-GLX implementations?
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci        Yes. wglGetProcAddress already exists for Microsoft Windows, and
1145bd8deadSopenharmony_ci        Apple has stated they will support aglGetProcAddress.
1155bd8deadSopenharmony_ci        Unfortunately, there is an unavoidable inconsistency with
1165bd8deadSopenharmony_ci        wglGetProcAddress, which returns context-dependent pointers.
1175bd8deadSopenharmony_ci        This should be made abundantly clear in the documentation, so
1185bd8deadSopenharmony_ci        that portable applications assume context-dependent behavior.
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci    * Should the core functions added to GL and GLX since their 1.0
1215bd8deadSopenharmony_ci      versions be queryable?
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci        Yes. This will allow maximum portability of applications across
1245bd8deadSopenharmony_ci        OpenGL 1.1 and 1.2 library implementations.
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci    * Should the core functions in GL 1.0 and GLX 1.0 be queryable?
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci        Yes. Adds consistency at the cost of a much larger lookup
1295bd8deadSopenharmony_ci        mechanism.
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    * Are function pointers context-independent?
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci        Yes. The pointer to an extension function can be used with any
1345bd8deadSopenharmony_ci        context which supports the extension. Concern was expressed that
1355bd8deadSopenharmony_ci        function dispatch for context-independent pointers would incur
1365bd8deadSopenharmony_ci        overheads compared to context-dependent pointers.
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci        The working group has proposed several implementation strategies
1395bd8deadSopenharmony_ci        which would make this overhead negligible to nonexistent, and
1405bd8deadSopenharmony_ci        the benefits of lifting the context/pointer management burden
1415bd8deadSopenharmony_ci        from applications were considerable. The implementation
1425bd8deadSopenharmony_ci        strategies are moderately complex and reach down all the way to
1435bd8deadSopenharmony_ci        the toplevel dispatch mechanism used by drivers.
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    * Should the pointers returned be required to be equal to the
1465bd8deadSopenharmony_ci      addresses of the corresponding static functions (if they exist?)
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci        No. This may make implementation more difficult and is of little
1495bd8deadSopenharmony_ci        apparent value to applications.
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci    * Should the query return NULL for entry points not supported
1525bd8deadSopenharmony_ci      by the implementation, or a pointer to a function which
1535bd8deadSopenharmony_ci      generates an error?
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci        NULL. There is no consistent way to generate errors
1565bd8deadSopenharmony_ci        when either GL or GLX functions may be queried.
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ciNew Procedures and Functions
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    void (*glXGetProcAddressARB(const GLubyte *procName))(...)
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ciNew Tokens
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci    None.
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation)
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci    None
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization)
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    None
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment
1755bd8deadSopenharmony_ciOperations and the Frame Buffer)
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci    None
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.2.1 Specification (Special
1805bd8deadSopenharmony_ciFunctions)
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci    None
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.2.1 Specification (State and State
1855bd8deadSopenharmony_ciRequests)
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci    None
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    None
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ciAdditions to the GLX Specification
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    Add a new section numbered 3.3.12:
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    3.3.12 Obtaining Extension Function Pointers
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci    The GL and GLX extensions which are available to a client
2005bd8deadSopenharmony_ci    application may vary at runtime. Therefore, the address of extension
2015bd8deadSopenharmony_ci    functions may be queried at runtime. The function
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci        void (*glXGetProcAddressARB(const ubyte *procName)();
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci    returns the address of the extension function named by procName. The
2065bd8deadSopenharmony_ci    pointer returned should be cast to a function pointer type matching
2075bd8deadSopenharmony_ci    the extension function's definition in that extension specification.
2085bd8deadSopenharmony_ci    A return value of NULL indicates that the specified function does
2095bd8deadSopenharmony_ci    not exist for the implementation.
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci    A non-NULL return value for glXGetProcAddressARB does not guarantee
2125bd8deadSopenharmony_ci    that an extension function is actually supported at runtime. The
2135bd8deadSopenharmony_ci    client must must also query glGetString(GL_EXTENSIONS) or
2145bd8deadSopenharmony_ci    glXQueryExtensionsString to determine if an extension is supported
2155bd8deadSopenharmony_ci    by a particular context.
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    GL function pointers returned by glXGetProcAddressARB are
2185bd8deadSopenharmony_ci    independent of the currently bound context and may be used by any
2195bd8deadSopenharmony_ci    context which supports the extension.
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci    glXGetProcAddressARB may be queried for all of the following functions:
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci      - All GL and GLX extension functions supported by the
2245bd8deadSopenharmony_ci        implementation (whether those extensions are supported by the
2255bd8deadSopenharmony_ci        current context or not).
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci      - All core (non-extension) functions in GL and GLX from version
2285bd8deadSopenharmony_ci        1.0 up to and including the versions of those specifications
2295bd8deadSopenharmony_ci        supported by the implementation, as determined by
2305bd8deadSopenharmony_ci        glGetString(GL_VERSION) and glXQueryVersion queries.
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ciGLX Protocol
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci    None
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ciErrors
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci    None
2395bd8deadSopenharmony_ci
2405bd8deadSopenharmony_ciNew State
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    None
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ciConformance Testing
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ci    Rather than testing directly, the existing tkProcInit() mechanism in
2475bd8deadSopenharmony_ci    the OpenGL 1.2 conformance tests will be modified to use
2485bd8deadSopenharmony_ci    glXGetProcAddress when it's available, so that other ARB extensions
2495bd8deadSopenharmony_ci    will fail conformance if the query does not work.
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ci    An alternative method which directly tests the query is to perform
2525bd8deadSopenharmony_ci    an extremely simple rendering test (e.g. glClearColor/glClear) using
2535bd8deadSopenharmony_ci    GL core function pointers returned by the query.
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ciRevision History
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci    * Revision 1.1 (January 3, 2000) - Final ARB-approved version.
2585bd8deadSopenharmony_ci      Specify that GL function pointers are context independent. Specify
2595bd8deadSopenharmony_ci      that all core and extension GL and GLX functions may be queried.
260