15bd8deadSopenharmony_ciName 
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_render_texture 
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings 
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    WGL_ARB_render_texture 
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact 
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Bimal Poddar, Intel, bimal.poddar@intel.com
125bd8deadSopenharmony_ci    Paula Womack, Nvidia, PWomack@nvidia.com
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciNotice
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Copyright (c) 2001-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 June 13, 2001
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciVersion 
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    Last Modified Date: July 16, 2001
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciNumber 
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    ARB Extension #20 
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciDependencies 
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    OpenGL 1.1 is required. 
445bd8deadSopenharmony_ci    WGL_ARB_extension_string is required. 
455bd8deadSopenharmony_ci    WGL_ARB_pixel_format is required. 
465bd8deadSopenharmony_ci    WGL_ARB_pbuffer is required. 
475bd8deadSopenharmony_ci    WGL_ARB_make_current_read affects the definition of this extension. 
485bd8deadSopenharmony_ci    GL_ARB_texture_cube_map affects the definition of this extension 
495bd8deadSopenharmony_ci    The extension is written against the OpenGL 1.2.1 Specification. 
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciOverview 
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension allows a color buffer to be used for both rendering and
545bd8deadSopenharmony_ci    texturing. When a color buffer is bound to a texture target it cannot 
555bd8deadSopenharmony_ci    be rendered to. Once it has been released from the texture it can be 
565bd8deadSopenharmony_ci    rendered to once again. 
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    This extension may provide a performance boost and reduce memory 
595bd8deadSopenharmony_ci    requirements on architectures that support rendering to the same 
605bd8deadSopenharmony_ci    memory where textures reside and in the same memory format and layout
615bd8deadSopenharmony_ci    required by texturing. The functionality is similar to CopyTexImage1D
625bd8deadSopenharmony_ci    and CopyTexImage2D. However, some changes were made to make it easier 
635bd8deadSopenharmony_ci    to avoid copying data: 
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    -   Only color buffers of a pbuffer can be bound as a texture. It is 
665bd8deadSopenharmony_ci        not possible to use the color buffer of a window as a texture. 
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    -   The texture internal format is determined when the color buffer 
695bd8deadSopenharmony_ci        is associated with the texture, guaranteeing that the color 
705bd8deadSopenharmony_ci        buffer format is equivalent to the texture internal format. 
715bd8deadSopenharmony_ci        
725bd8deadSopenharmony_ci    -   When a color buffer of a pbuffer is being used as a texture, 
735bd8deadSopenharmony_ci        the pbuffer can not be used for rendering; this makes it 
745bd8deadSopenharmony_ci        easier for implementations to avoid a copy of the image 
755bd8deadSopenharmony_ci        since the semantics of the pointer swap are clear. 
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    -   The application must release the color buffer from the texture 
785bd8deadSopenharmony_ci        before it can render to the pbuffer again. When the color buffer 
795bd8deadSopenharmony_ci        is bound as a texture, draw and read operations on the pbuffer 
805bd8deadSopenharmony_ci        are undefined. 
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    -   A mipmap attribute can be set, in which case memory will be 
835bd8deadSopenharmony_ci        allocated up front for mipmaps. The application can render 
845bd8deadSopenharmony_ci        the mipmap images or, if SGIS_generate_mipmap is supported, 
855bd8deadSopenharmony_ci        they can be automatically generated when the color buffer is 
865bd8deadSopenharmony_ci        bound as a texture. 
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    -   A texture target is associated with the pbuffer, so that cubemap 
895bd8deadSopenharmony_ci        images can be rendered into a single color buffer. 
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    Note that this extension may be used in conjunction with other 
925bd8deadSopenharmony_ci    extensions to associate video images/buffers to pbuffers.  Once the 
935bd8deadSopenharmony_ci    video image is associated with a pbuffer it can be used as a texture.
945bd8deadSopenharmony_ci    Also, if SGIX_generate_mipmap is supported, it is possible to 
955bd8deadSopenharmony_ci    create a complete set of mipmap images from a single color buffer. 
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ciIP Status 
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    There are no known IP issues. 
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ciIssues 
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci 1. Should we support 3D textures? What about 1D textures? 
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci    3D textures - No. This adds a lot of implementation burden without 
1065bd8deadSopenharmony_ci    having a good usage model.
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    1D textures - Yes. Just a special case of 2D texture.
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci 2. Should we allow a portion of the color buffer to be used as a texture? 
1115bd8deadSopenharmony_ci    No, if a different size texture is needed the application can just 
1125bd8deadSopenharmony_ci    create another pbuffer. 
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci 3. Do we need the MIPMAP_TEXTURE attribute? 
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    Yes this is good to have since some architectures may require all or 
1175bd8deadSopenharmony_ci    some of the mipmaps to be stored together in memory. 
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci 4. Should we require power of 2 textures? 
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    Yes, we will allow an implementation to fail if the texture size is 
1225bd8deadSopenharmony_ci    not a power of 2. This restriction can be relaxed later by the
1235bd8deadSopenharmony_ci    exension that allows non-power of 2 texture.
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ci 5. Should the render texture attributes be per color buffer or per drawable? 
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    There really isn't a mechanism for associating attributes with the color
1285bd8deadSopenharmony_ci    buffer. Also, allowing different render texture attributes for each 
1295bd8deadSopenharmony_ci    color buffer makes the extension more difficult to implement without 
1305bd8deadSopenharmony_ci    providing a very useful tool for applications. 
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ci 6. What should happen if the color buffer is used for rendering before it 
1335bd8deadSopenharmony_ci    is released from the texture? 
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    There are three reasonable options: generate an error, create another 
1365bd8deadSopenharmony_ci    buffer or have the rendering results be undefined.  Since this is an 
1375bd8deadSopenharmony_ci    error condition, and not a useful feature, we should pick the option 
1385bd8deadSopenharmony_ci    that is easiest to implement.  For now, we choose to have the rendering 
1395bd8deadSopenharmony_ci    results be undefined--the rendering commands will be processed and the 
1405bd8deadSopenharmony_ci    context will be updated but the pbuffer may or may  not be updated. 
1415bd8deadSopenharmony_ci    Note that the pbuffer that contains the color buffer can be bound to a 
1425bd8deadSopenharmony_ci    different context, so the invalid state must be stored with the pbuffer,
1435bd8deadSopenharmony_ci    not the context.. (Also the texture object that contains the 
1445bd8deadSopenharmony_ci    color buffer's image may be released from the current context). 
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci 7. Should the new pbuffer attributes be available through GL queries? 
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    No, like other pbuffer attributes you need to query them through the 
1495bd8deadSopenharmony_ci    window system extension. This extension does not make any changes to 
1505bd8deadSopenharmony_ci    OpenGL. 
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci 8. Should we allow a subset of mipmaps to be defined? 
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci    No. 
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci 9. What happens when a pbuffer is bound as a texture and then a mode 
1575bd8deadSopenharmony_ci    change occurs and the pbuffer is lost? 
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci    The texture is not lost in this case. OpenGL doesn't have the notion 
1605bd8deadSopenharmony_ci    of volatile textures and this extension should not introduce them. 
1615bd8deadSopenharmony_ci    (It may be an interesting additional extension). When a color buffer 
1625bd8deadSopenharmony_ci    is bound to a texture, it must be saved and restored by the driver, 
1635bd8deadSopenharmony_ci    whenever texture memory is lost (even on a windows mode change). 
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci10. Should there be any restrictions on the texture operations that 
1665bd8deadSopenharmony_ci    can be performed on a color buffer? 
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci    Yes. We allow TexSubImage and CopyTexSubImage calls but disallow 
1695bd8deadSopenharmony_ci    TexImage and CopyTexImage calls. When a TexImage or CopyTexImage call 
1705bd8deadSopenharmony_ci    is made then the color buffer is released back to the pbuffer and 
1715bd8deadSopenharmony_ci    new memory is allocated for the texture. No mixing and matching of 
1725bd8deadSopenharmony_ci    images is allowed. In other words, it is not possible to render a 
1735bd8deadSopenharmony_ci    non-mipmapped image to a pbuffer, bind it to a texture and then 
1745bd8deadSopenharmony_ci    call TexImage2D to create the other mipmap levels. Modifying any 
1755bd8deadSopenharmony_ci    mipmap level via TexImage or CopyTexImage will cause the color 
1765bd8deadSopenharmony_ci    buffer to be released back to the pbuffer, even if that level 
1775bd8deadSopenharmony_ci    was not defined by the color buffer. 
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    Also, if DeleteTextures is called on the texture target, then the 
1805bd8deadSopenharmony_ci    color buffer that is bound to the texture target is released back 
1815bd8deadSopenharmony_ci    to the pbuffer.
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    The implicit release of the color buffer is intended to work just
1845bd8deadSopenharmony_ci    like an explicit release - i.e. the color buffer is available for
1855bd8deadSopenharmony_ci    rendering without the app having to call ReleaseTexImage.
1865bd8deadSopenharmony_ci    
1875bd8deadSopenharmony_ci11. When the color buffer is released from the texture (back to the pbuffer)
1885bd8deadSopenharmony_ci    should the contents be preserved? 
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    No, this may prove difficult to implement on some architectures. 
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci12. Should releasing the color buffer from the texture (back to the pbuffer)
1935bd8deadSopenharmony_ci    affect the scissor or viewport? 
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    No, since releasing the color buffer, does not change its size, it 
1965bd8deadSopenharmony_ci    should not affect the scissor or viewport. The application is also 
1975bd8deadSopenharmony_ci    responsible for updating the viewport and scissor when changing which 
1985bd8deadSopenharmony_ci    mipmap level it is rendering to (this is similar to window resize, 
1995bd8deadSopenharmony_ci    where the application is responsible for updating the scissor and 
2005bd8deadSopenharmony_ci    viewport).
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci13. How should swap buffers work when a color buffer is bound as a texture? 
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci    Since a color buffer (not a pbuffer) is bound to a texture, swap buffers
2055bd8deadSopenharmony_ci    should be a no-op. Otherwise the name of the bound buffer (FRONT, BACK) 
2065bd8deadSopenharmony_ci    will change while it is bound. Note that swap buffers works just as
2075bd8deadSopenharmony_ci    for a pbuffer when the color buffer is not bound as a texture.
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci14. What happens when the application binds one color buffer of a pbuffer 
2105bd8deadSopenharmony_ci    to a texture and then tries to render to another color buffer of the 
2115bd8deadSopenharmony_ci    pbuffer? 
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    If any of the pbuffer's color buffers are bound to a texture, then 
2145bd8deadSopenharmony_ci    rendering results are undefined for all color buffers of the pbuffer. 
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci15. Should it be an error to bind a color buffer of a pbuffer to a 
2175bd8deadSopenharmony_ci    texture, if that pbuffer is current to another thread? 
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    No. It is not an error to make a drawable current to two threads right 
2205bd8deadSopenharmony_ci    now. Read and draw operations produce indeterminate results when the 
2215bd8deadSopenharmony_ci    pbuffer is bound to a texture. 
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci16. Should we allow color buffers of all drawables (pbuffers and windows)
2245bd8deadSopenharmony_ci    to be bound to textures? 
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci    For now we just allow pbuffers. This is simpler since they are not 
2275bd8deadSopenharmony_ci    shared with the window system and the color buffers are not part of the 
2285bd8deadSopenharmony_ci    visible framebuffer. Also, windows can be resized at any time and 
2295bd8deadSopenharmony_ci    handling this resize would unnecessarily complicate this extension. 
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci17. Should we allow depth buffers to be bound as textures? 
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci    This extension does not provide for this but it would be an interesting 
2345bd8deadSopenharmony_ci    additional extension. When a color buffer is bound to a texture, only 
2355bd8deadSopenharmony_ci    the color buffer is moved--ancillary buffers continue to be bound to 
2365bd8deadSopenharmony_ci    the pbuffer. 
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci    This extension is written such that adding depth textures should
2395bd8deadSopenharmony_ci    be very easy.
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci18. What happens when a color buffer is bound to a shared texture object? 
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci    Since the color buffer is associated with the texture object itself, 
2445bd8deadSopenharmony_ci    it should be shared. 
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ci19. Should we specify how this extension interacts with SGIS_generate_mipmap? 
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    No, since this is a potential ARB extension and SGIS_generate_mipmap 
2495bd8deadSopenharmony_ci    is not. If SGIS_generate_mipmap is supported along with this extension,
2505bd8deadSopenharmony_ci    then if wglBindTexImageARB is called and both GENERATE_MIPMAP_SGIS and 
2515bd8deadSopenharmony_ci    WGL_MIPMAP_TEXTURE_ARB are TRUE, then a set of mipmaps should be 
2525bd8deadSopenharmony_ci    generated. This behaviour needs to be documented in the 
2535bd8deadSopenharmony_ci    SGIS_generate_mipmap (or equivalent) extension. 
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci20. Should we support borders on render textures? 
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci    No. Although borders are part of 1.2.1, they are often not supported 
2585bd8deadSopenharmony_ci    and better techniques (such as virtual textures) are starting to 
2595bd8deadSopenharmony_ci    become available for paging in large textures. 
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci21. Should wglBindTexImageARB take an attribute indicating whether 
2625bd8deadSopenharmony_ci    mipmaps are defined or should this be implied from the 
2635bd8deadSopenharmony_ci    WGL_MIPMAP_TEXTURE_ARB attribute of the pbuffer? 
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ci    This should be implied from the WGL_MIPMAP_TEXTURE_ARB attribute 
2665bd8deadSopenharmony_ci    since GL allows controls for the applications to use only level zero 
2675bd8deadSopenharmony_ci    image even if the pbuffer has been defined large enough to
2685bd8deadSopenharmony_ci    store mipmaps.
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci22. This extension introduces pbuffer attributes that can be modified. 
2715bd8deadSopenharmony_ci    (Previously all pbuffer attributes were static and could not be 
2725bd8deadSopenharmony_ci    changed.) Should we allow the non-static attributes to be set when the 
2735bd8deadSopenharmony_ci    pbuffer is created or should we require the application to call 
2745bd8deadSopenharmony_ci    wglSetPbufferAttribARB? 
2755bd8deadSopenharmony_ci
2765bd8deadSopenharmony_ci    We require the application to call wglSetPbufferAttribARB to set 
2775bd8deadSopenharmony_ci    non-static Pbuffer attributes since this seems to be more consistent 
2785bd8deadSopenharmony_ci    with OpenGL specification.
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci23. Do we need WGL_TEXTURE_FORMAT_ARB or is WGL_ALPHA_BITS_ARB enough
2815bd8deadSopenharmony_ci    to distinguish between selecting RGB vs. RGBA textures? Additionally,
2825bd8deadSopenharmony_ci    how is this parameter defined for non texture buffers.
2835bd8deadSopenharmony_ci
2845bd8deadSopenharmony_ci    Resolved: In order to accommodate RGBA visuals to support RGB textures
2855bd8deadSopenharmony_ci    (i.e. ignore alpha) and to allow the specification to be extensible
2865bd8deadSopenharmony_ci    for depth textures, WGL_TEXTURE_FORMAT_ARB is required in this
2875bd8deadSopenharmony_ci    specification. This parameter is defined as WGL_NO_TEXTURE_ARB for
2885bd8deadSopenharmony_ci    non texture buffers.
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci24. Should luminance and Intensity texture formats be allowed?
2915bd8deadSopenharmony_ci
2925bd8deadSopenharmony_ci    No. WGL doesn't support single-channel framebuffer formats. Allowing
2935bd8deadSopenharmony_ci    these formats would require a copy to reformat a RGB/RGBA framebuffer
2945bd8deadSopenharmony_ci    to a Luminance or Intensity format. If luminance framebuffer gets
2955bd8deadSopenharmony_ci    added to WGL, then this feature can be added at that time.
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ciImplementation Notes
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci 1. In order to prevent releases of a pbuffer from the texture object
3005bd8deadSopenharmony_ci    and to deal with implicit release followed by an explicit release,
3015bd8deadSopenharmony_ci    the GL implementation can keep a reference to any texture pbuffer
3025bd8deadSopenharmony_ci    in the texture object. When the pbuffer is released, this handle
3035bd8deadSopenharmony_ci    is set to NULL. Subsequent requests for releasing the texture
3045bd8deadSopenharmony_ci    pbuffer are ignored.
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci 2. The implicit release of the color buffers has been specifed to 
3075bd8deadSopenharmony_ci    work just like the explicit release so that the implementation
3085bd8deadSopenharmony_ci    can delete a texture object (one of the implicit free cases) without 
3095bd8deadSopenharmony_ci    having to track whether the texture was associated with any color buffers.
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ciIntended Usage 
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci    To define a cube map texture, single threaded case 
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ci    1)  Create the rendering window. Call wglChoosePixelFormatARB and 
3165bd8deadSopenharmony_ci        find a suitable pixel format for rendering the image. Set the pixel 
3175bd8deadSopenharmony_ci        format for the rendering window to this pixel format. 
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci    2)  Create the pbuffer. Call wglChoosePixelFormatARB and find a 
3205bd8deadSopenharmony_ci        suitable pixel format for rendering the texture.  
3215bd8deadSopenharmony_ci        WGL_DRAW_TO_PBUFFER and WGL_BIND_TO_TEXTURE_RGB_ARB or 
3225bd8deadSopenharmony_ci        WGL_BIND_TO_TEXTURE_RGBA_ARB must be TRUE. Create the pbuffer 
3235bd8deadSopenharmony_ci        with this pixel format. Set the pbuffer width and height to the 
3245bd8deadSopenharmony_ci        width and height of the level zero image. Set WGL_TEXTURE_FORMAT_ARB 
3255bd8deadSopenharmony_ci        to be WGL_TEXTURE_RGB_ARB or WGL_TEXTURE_RGBA_ARB. Also set 
3265bd8deadSopenharmony_ci        WGL_TEXTURE_TARGET_ARB to WGL_TEXTURE_CUBE_MAP_ARB. 
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci    3)  Create a context for the pbuffer. Make the context current to the 
3295bd8deadSopenharmony_ci        pbuffer and initialize the context's attributes. 
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci    4)  Render all the cube map faces to the pbuffer. Call 
3325bd8deadSopenharmony_ci        wglSetPbufferAttribARB to set the cube map face before rendering
3335bd8deadSopenharmony_ci        each face. Call glFlush. 
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci    5)  Create a context for the window. Make the context current to the 
3365bd8deadSopenharmony_ci        window and intialize the contexts attributes. Bind a texture object 
3375bd8deadSopenharmony_ci        to the TEXTURE_CUBE_MAP_ARB target and set the texture parameters 
3385bd8deadSopenharmony_ci        to the desired values. 
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ci    6)  Call wglBindTexImageARB to bind the pbuffer drawable to the cube 
3415bd8deadSopenharmony_ci        map texture. Set <iBuffer> to WGL_FRONT or WGL_BACK depending upon
3425bd8deadSopenharmony_ci        which color buffer was used for rendering the cube map.
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ci    7)  Render to the window using the cube map texture. 
3455bd8deadSopenharmony_ci
3465bd8deadSopenharmony_ci    8)  Call wglReleaseTexImageARB to release the color buffer of the 
3475bd8deadSopenharmony_ci        pbuffer. Goto step 4 to generate more frames. 
3485bd8deadSopenharmony_ci
3495bd8deadSopenharmony_ci    To define a 2D texture, single threaded case 
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci    In step 2, set the WGL_TEXTURE_TARGET_ARB to WGL_TEXTURE_2D_ARB.
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ci    Since a 2D texture does not have multiple faces, in step 5
3545bd8deadSopenharmony_ci    there is no need to call wglSetPbufferAttribARB. 
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci    In addition, if mipmaps are to be generated, the step 5 should
3575bd8deadSopenharmony_ci    be repeated multiple times with calls to wglSetPbufferAttribARB
3585bd8deadSopenharmony_ci    to set different mip levels.
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ciNew Procedures and Functions 
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ci    BOOL wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer)
3635bd8deadSopenharmony_ci
3645bd8deadSopenharmony_ci    BOOL wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer) 
3655bd8deadSopenharmony_ci
3665bd8deadSopenharmony_ci    BOOL wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, 
3675bd8deadSopenharmony_ci        const int *piAttribList) 
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ciNew Tokens 
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci    Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB, 
3725bd8deadSopenharmony_ci    wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList>
3735bd8deadSopenharmony_ci    parameters of wglChoosePixelFormatARB: 
3745bd8deadSopenharmony_ci
3755bd8deadSopenharmony_ci        WGL_BIND_TO_TEXTURE_RGB_ARB         0x2070
3765bd8deadSopenharmony_ci        WGL_BIND_TO_TEXTURE_RGBA_ARB        0x2071
3775bd8deadSopenharmony_ci
3785bd8deadSopenharmony_ci    Accepted by the <piAttribList> parameter of wglCreatePbufferARB and
3795bd8deadSopenharmony_ci    by the <iAttribute> parameter of wglQueryPbufferARB: 
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci        WGL_TEXTURE_FORMAT_ARB              0x2072
3825bd8deadSopenharmony_ci        WGL_TEXTURE_TARGET_ARB              0x2073
3835bd8deadSopenharmony_ci        WGL_MIPMAP_TEXTURE_ARB              0x2074
3845bd8deadSopenharmony_ci
3855bd8deadSopenharmony_ci    Accepted as a value in the <piAttribList> parameter of 
3865bd8deadSopenharmony_ci    wglCreatePbufferARB and returned in the value parameter of
3875bd8deadSopenharmony_ci    wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_FORMAT_ARB: 
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci        WGL_TEXTURE_RGB_ARB                 0x2075
3905bd8deadSopenharmony_ci        WGL_TEXTURE_RGBA_ARB                0x2076
3915bd8deadSopenharmony_ci        WGL_NO_TEXTURE_ARB                  0x2077
3925bd8deadSopenharmony_ci
3935bd8deadSopenharmony_ci    Accepted as a value in the <piAttribList> parameter of 
3945bd8deadSopenharmony_ci    wglCreatePbufferARB and returned in the value parameter of
3955bd8deadSopenharmony_ci    wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_TARGET_ARB: 
3965bd8deadSopenharmony_ci
3975bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_ARB            0x2078
3985bd8deadSopenharmony_ci        WGL_TEXTURE_1D_ARB                  0x2079
3995bd8deadSopenharmony_ci        WGL_TEXTURE_2D_ARB                  0x207A
4005bd8deadSopenharmony_ci        WGL_NO_TEXTURE_ARB                  0x2077
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ci    Accepted by the <piAttribList> parameter of wglSetPbufferAttribARB and 
4035bd8deadSopenharmony_ci    by the <iAttribute> parameter of wglQueryPbufferARB: 
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci        WGL_MIPMAP_LEVEL_ARB                0x207B
4065bd8deadSopenharmony_ci        WGL_CUBE_MAP_FACE_ARB               0x207C
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci    Accepted as a value in the <piAttribList> parameter of 
4095bd8deadSopenharmony_ci    wglSetPbufferAttribARB and returned in the value parameter of
4105bd8deadSopenharmony_ci    wglQueryPbufferARB when <iAttribute> is WGL_CUBE_MAP_FACE_ARB: 
4115bd8deadSopenharmony_ci
4125bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB     0x207D
4135bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB     0x207E
4145bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB     0x207F
4155bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB     0x2080
4165bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB     0x2081 
4175bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB     0x2082
4185bd8deadSopenharmony_ci
4195bd8deadSopenharmony_ci    Accepted by the <iBuffer> parameter of wglBindTexImageARB and 
4205bd8deadSopenharmony_ci    wglReleaseTexImageARB: 
4215bd8deadSopenharmony_ci
4225bd8deadSopenharmony_ci        WGL_FRONT_LEFT_ARB                  0x2083
4235bd8deadSopenharmony_ci        WGL_FRONT_RIGHT_ARB                 0x2084
4245bd8deadSopenharmony_ci        WGL_BACK_LEFT_ARB                   0x2085
4255bd8deadSopenharmony_ci        WGL_BACK_RIGHT_ARB                  0x2086
4265bd8deadSopenharmony_ci        WGL_AUX0_ARB                        0x2087 
4275bd8deadSopenharmony_ci        WGL_AUX1_ARB                        0x2088 
4285bd8deadSopenharmony_ci        WGL_AUX2_ARB                        0x2089 
4295bd8deadSopenharmony_ci        WGL_AUX3_ARB                        0x208A 
4305bd8deadSopenharmony_ci        WGL_AUX4_ARB                        0x208B 
4315bd8deadSopenharmony_ci        WGL_AUX5_ARB                        0x208C 
4325bd8deadSopenharmony_ci        WGL_AUX6_ARB                        0x208D
4335bd8deadSopenharmony_ci        WGL_AUX7_ARB                        0x208E 
4345bd8deadSopenharmony_ci        WGL_AUX8_ARB                        0x208F 
4355bd8deadSopenharmony_ci        WGL_AUX9_ARB                        0x2090
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) 
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ci    None. 
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 
4425bd8deadSopenharmony_ci
4435bd8deadSopenharmony_ci    None. 
4445bd8deadSopenharmony_ci
4455bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 
4465bd8deadSopenharmony_ciOperations and the Frame Buffer) 
4475bd8deadSopenharmony_ci
4485bd8deadSopenharmony_ci    None. 
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 
4515bd8deadSopenharmony_ci
4525bd8deadSopenharmony_ci    None. 
4535bd8deadSopenharmony_ci
4545bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.2.1 Specification (State and State 
4555bd8deadSopenharmony_ciRequests) 
4565bd8deadSopenharmony_ci
4575bd8deadSopenharmony_ci    None. 
4585bd8deadSopenharmony_ci
4595bd8deadSopenharmony_ciAdditions to the WGL Specification 
4605bd8deadSopenharmony_ci
4615bd8deadSopenharmony_ci    Add to the description of <piAttributes> in wglGetPixelFormatAttribivARB 
4625bd8deadSopenharmony_ci    and <pfAttributes> in wglGetPixelFormatfv: 
4635bd8deadSopenharmony_ci
4645bd8deadSopenharmony_ci        WGL_BIND_TO_TEXTURE_RGB_ARB
4655bd8deadSopenharmony_ci        WGL_BIND_TO_TEXTURE_RGBA_ARB
4665bd8deadSopenharmony_ci
4675bd8deadSopenharmony_ci        True if the color buffers can be bound to a RGB/RGBA texture. 
4685bd8deadSopenharmony_ci        Currently only pbuffers can be bound as textures so this attribute 
4695bd8deadSopenharmony_ci        will only be TRUE if WGL_DRAW_TO_PBUFFER is also TRUE. It is
4705bd8deadSopenharmony_ci        possible to bind a RGBA visual to a RGB texture in
4715bd8deadSopenharmony_ci        which case the values in the alpha component of the visual
4725bd8deadSopenharmony_ci        are ignored when the color buffer is used as a RGB texture.
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ci        Implementations may choose not to support WGL_BIND_TO_TEXTURE_RGB_ARB
4755bd8deadSopenharmony_ci        for RGBA visuals.
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci    Add new table entries to match criteria in description of 
4785bd8deadSopenharmony_ci    wglChoosePixelFormatARB: 
4795bd8deadSopenharmony_ci
4805bd8deadSopenharmony_ci        Attribute                       Type             Match Criteria 
4815bd8deadSopenharmony_ci
4825bd8deadSopenharmony_ci        WGL_BIND_TO_TEXTURE_RGB_ARB     boolean             exact
4835bd8deadSopenharmony_ci        WGL_BIND_TO_TEXTURE_RGBA_ARB    boolean             exact
4845bd8deadSopenharmony_ci
4855bd8deadSopenharmony_ci    Modify wglCreatePbufferARB: 
4865bd8deadSopenharmony_ci
4875bd8deadSopenharmony_ci        HPBUFFERARB wglCreatePbufferARB (HDC hDC, int iPixelFormat, 
4885bd8deadSopenharmony_ci            int iWidth, int iHeight, const int *piAttribList); 
4895bd8deadSopenharmony_ci
4905bd8deadSopenharmony_ci        ... 
4915bd8deadSopenharmony_ci
4925bd8deadSopenharmony_ci        <iWidth> and <iHeight> specify the pixel width and height of the 
4935bd8deadSopenharmony_ci        rectangular pbuffer. If the texture format is set to
4945bd8deadSopenharmony_ci        WGL_TEXTURE_RGB_ARB or WGL_TEXTURE_RGBA_ARB using 
4955bd8deadSopenharmony_ci        WGL_TEXTURE_FORMAT_ARB, then the pbuffer width and height 
4965bd8deadSopenharmony_ci        specify the size of the level zero texture image or, in the 
4975bd8deadSopenharmony_ci        case of a cube map texture, each level zero image. 
4985bd8deadSopenharmony_ci
4995bd8deadSopenharmony_ci        <piAttribList> is a list of attribute {type, value} pairs containing 
5005bd8deadSopenharmony_ci        integer attribute values.  All of the attributes in <piAttribList>
5015bd8deadSopenharmony_ci        are followed by the corresponding required value. The list is 
5025bd8deadSopenharmony_ci        terminated with a value of 0. 
5035bd8deadSopenharmony_ci
5045bd8deadSopenharmony_ci        <piAttribList> may be NULL or empty in which case all attributes assume
5055bd8deadSopenharmony_ci        their default values as described below. 
5065bd8deadSopenharmony_ci
5075bd8deadSopenharmony_ci        The following attributes are supported by wglCreatePbufferARB: 
5085bd8deadSopenharmony_ci
5095bd8deadSopenharmony_ci        WGL_TEXTURE_FORMAT_ARB
5105bd8deadSopenharmony_ci
5115bd8deadSopenharmony_ci        This attribute indicates the format of the texture that will be
5125bd8deadSopenharmony_ci        created when a pbuffer is bound to a texture map.
5135bd8deadSopenharmony_ci        It can be set to WGL_TEXTURE_RGB_ARB, WGL_TEXTURE_RGBA_ARB or
5145bd8deadSopenharmony_ci        WGL_NO_TEXTURE_ARB. The default value is WGL_NO_TEXTURE_ARB.
5155bd8deadSopenharmony_ci
5165bd8deadSopenharmony_ci        WGL_TEXTURE_TARGET_ARB 
5175bd8deadSopenharmony_ci
5185bd8deadSopenharmony_ci        This attribute indicates the target for the texture that will be 
5195bd8deadSopenharmony_ci        created when the pbuffer is created with a texture format of
5205bd8deadSopenharmony_ci        WGL_TEXTURE_RGB_ARB or WGL_TEXTURE_RGBA_ARB.  This attribute can
5215bd8deadSopenharmony_ci        be set to WGL_NO_TEXTURE_ARB, WGL_TEXTURE_1D_ARB, WGL_TEXTURE_2D_ARB 
5225bd8deadSopenharmony_ci        or WGL_TEXTURE_CUBE_MAP_ARB. The default value is WGL_NO_TEXTURE_ARB. 
5235bd8deadSopenharmony_ci
5245bd8deadSopenharmony_ci        WGL_MIPMAP_TEXTURE_ARB 
5255bd8deadSopenharmony_ci
5265bd8deadSopenharmony_ci        If this attribute is set to a non-zero value, and the texture format 
5275bd8deadSopenharmony_ci        is set to WGL_TEXTURE_RGB_ARB or WGL_TEXTURE_RGBA_ARB, then storage 
5285bd8deadSopenharmony_ci        for mipmaps will be allocated. The default value is FALSE. 
5295bd8deadSopenharmony_ci
5305bd8deadSopenharmony_ci        WGL_PBUFFER_LARGEST_ARB 
5315bd8deadSopenharmony_ci
5325bd8deadSopenharmony_ci        If this attribute is set to a non-zero value, the largest 
5335bd8deadSopenharmony_ci        available pbuffer is allocated when the allocation of the pbuffer 
5345bd8deadSopenharmony_ci        would otherwise fail due to insufficient resources.  The width or 
5355bd8deadSopenharmony_ci        height of the allocated pbuffer never exceeds <iWidth> and <iHeight>, 
5365bd8deadSopenharmony_ci        respectively. Also, if the pbuffer will be used as a texture 
5375bd8deadSopenharmony_ci        (i.e., the value of the WGL_TEXTURE_TARGET_ARB attribute is
5385bd8deadSopenharmony_ci        WGL_TEXTURE_1D_ARB, WGL_TEXTURE_2D_ARB or WGL_TEXTURE_CUBE_MAP_ARB
5395bd8deadSopenharmony_ci        and texture format is WGL_TEXTURE_RGB_ARB or WGL_TEXTURE_RGBA_ARB),
5405bd8deadSopenharmony_ci        then the aspect ratio will be preserved and the new width and 
5415bd8deadSopenharmony_ci        height will be valid sizes for the corresponding texture target. 
5425bd8deadSopenharmony_ci        (e.g. Both the width and height will be a power of 2 if the 
5435bd8deadSopenharmony_ci        implementation only supports power of 2 textures. Similarily, 
5445bd8deadSopenharmony_ci        the width and height will be equal for a cube map texture). 
5455bd8deadSopenharmony_ci        Use wglQueryPbufferARB to retrieve the dimensions of the 
5465bd8deadSopenharmony_ci        allocated pbuffer. The default value for this attribute is FALSE. 
5475bd8deadSopenharmony_ci
5485bd8deadSopenharmony_ci        The resulting pbuffer will contain color buffers and ancillary 
5495bd8deadSopenharmony_ci        buffers as specified by <iPixelFormat>.  Note that pbuffers use 
5505bd8deadSopenharmony_ci        framebuffer resources so applications should consider deallocating 
5515bd8deadSopenharmony_ci        them when they are not in use. 
5525bd8deadSopenharmony_ci
5535bd8deadSopenharmony_ci        It is possible to create a pbuffer with back buffers and to swap the 
5545bd8deadSopenharmony_ci        front and back buffers by calling wglSwapLayerBuffers.  The 
5555bd8deadSopenharmony_ci        contents of the back buffers after the swap depends on the 
5565bd8deadSopenharmony_ci        <iPixelFormat>.  (Pbuffers are the same as windows in this respect.) 
5575bd8deadSopenharmony_ci
5585bd8deadSopenharmony_ci        The contents of the depth and stencil buffers may not be preserved 
5595bd8deadSopenharmony_ci        when rendering a texture to the pbuffer and switching which image 
5605bd8deadSopenharmony_ci        of the texture is rendered to (e.g., switching from rendering one 
5615bd8deadSopenharmony_ci        mipmap level to rendering another). 
5625bd8deadSopenharmony_ci
5635bd8deadSopenharmony_ci        When wglCreatePbufferARB fails to create a pbuffer, NULL is returned.
5645bd8deadSopenharmony_ci        To get extended error information, call GetLastError. Possible 
5655bd8deadSopenharmony_ci        errors are as follows: 
5665bd8deadSopenharmony_ci
5675bd8deadSopenharmony_ci        ERROR_INVALID_PIXEL_FORMAT  Pixel format is not valid. 
5685bd8deadSopenharmony_ci
5695bd8deadSopenharmony_ci        ERROR_NO_SYSTEM_RESOURCES   Insufficient resources exist. 
5705bd8deadSopenharmony_ci
5715bd8deadSopenharmony_ci        ERROR_INVALID_DATA          <iWidth> or <iHeight> is negative or zero. 
5725bd8deadSopenharmony_ci
5735bd8deadSopenharmony_ci        ERROR_INVALID_DATA          WGL_TEXTURE_TARGET_ARB attribute is 
5745bd8deadSopenharmony_ci                                    set to WGL_TEXTURE_CUBE_MAP_ARB, and 
5755bd8deadSopenharmony_ci                                    iWidth does not equal iHeight.
5765bd8deadSopenharmony_ci
5775bd8deadSopenharmony_ci        ERROR_INVALID_DATA          WGL_TEXTURE_TARGET_ARB attribute is set 
5785bd8deadSopenharmony_ci                                    to WGL_TEXTURE_1D_ARB, and iHeight is 
5795bd8deadSopenharmony_ci                                    not set to one. 
5805bd8deadSopenharmony_ci
5815bd8deadSopenharmony_ci        ERROR_INVALID_DATA          The pixel format attribute 
5825bd8deadSopenharmony_ci                                    WGL_TEXTURE_FORMAT_ARB is 
5835bd8deadSopenharmony_ci                                    WGL_TEXTURE_RGB_ARB or WGL_TEXTURE_RGBA_ARB
5845bd8deadSopenharmony_ci                                    and WGL_PBUFFER_WIDTH and/or 
5855bd8deadSopenharmony_ci                                    WGL_PBUFFER_HEIGHT specify an invalid 
5865bd8deadSopenharmony_ci                                    size for the implementation (e.g., the 
5875bd8deadSopenharmony_ci                                    texture size is not a power of 2). 
5885bd8deadSopenharmony_ci
5895bd8deadSopenharmony_ci        ERROR_INVALID_DATA          An attribute in <piAttribList> is not a 
5905bd8deadSopenharmony_ci                                    valid attribute.
5915bd8deadSopenharmony_ci
5925bd8deadSopenharmony_ci        ERROR_INVALID_DATA          The texture format is set to 
5935bd8deadSopenharmony_ci                                    WGL_NO_TEXTURE_ARB and texture target
5945bd8deadSopenharmony_ci                                    is set to something other than 
5955bd8deadSopenharmony_ci                                    WGL_NO_TEXTURE_ARB.
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ci        ERROR_INVALID_DATA          The texture format is set to some target
5985bd8deadSopenharmony_ci                                    besides WGL_NO_TEXTURE_ARB and texture 
5995bd8deadSopenharmony_ci                                    target is set to WGL_NO_TEXTURE_ARB.
6005bd8deadSopenharmony_ci
6015bd8deadSopenharmony_ci        .... 
6025bd8deadSopenharmony_ci
6035bd8deadSopenharmony_ci    Modify wglDestroyPbufferARB: 
6045bd8deadSopenharmony_ci
6055bd8deadSopenharmony_ci        A pbuffer is destroyed by calling 
6065bd8deadSopenharmony_ci
6075bd8deadSopenharmony_ci        BOOL wglDestroyPbufferARB(HPBUFFERARB hPbuffer); 
6085bd8deadSopenharmony_ci
6095bd8deadSopenharmony_ci        The pbuffer is destroyed once it is no longer current to any 
6105bd8deadSopenharmony_ci        rendering context and once all color buffers that are bound to a
6115bd8deadSopenharmony_ci        texture object have been released.  When a pbuffer is destroyed, 
6125bd8deadSopenharmony_ci        any memory resources that are attached to it are freed
6135bd8deadSopenharmony_ci        and its handle is no longer valid. 
6145bd8deadSopenharmony_ci
6155bd8deadSopenharmony_ci        ....
6165bd8deadSopenharmony_ci
6175bd8deadSopenharmony_ci    Add wglSetPbufferAttribARB: 
6185bd8deadSopenharmony_ci
6195bd8deadSopenharmony_ci        To set an attribute of a pbuffer call 
6205bd8deadSopenharmony_ci
6215bd8deadSopenharmony_ci        BOOL wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, 
6225bd8deadSopenharmony_ci                                     const int *piAttribList); 
6235bd8deadSopenharmony_ci
6245bd8deadSopenharmony_ci        with <hPbuffer> set to a previously returned pbuffer handle. 
6255bd8deadSopenharmony_ci        <piAttribList> is a list of attribute {type, value} pairs containing
6265bd8deadSopenharmony_ci        integer values. All the attributes in <piAttribList> are followed by 
6275bd8deadSopenharmony_ci        the corresponding desired value. The list is terminated with 0. 
6285bd8deadSopenharmony_ci        If <piAttribList> is NULL or empty then this function is a no-op. 
6295bd8deadSopenharmony_ci
6305bd8deadSopenharmony_ci        The following values are accepted: 
6315bd8deadSopenharmony_ci
6325bd8deadSopenharmony_ci        WGL_MIPMAP_LEVEL_ARB 
6335bd8deadSopenharmony_ci
6345bd8deadSopenharmony_ci        For mipmap textures, this attribute indicates which level of the 
6355bd8deadSopenharmony_ci        mipmap should be rendered. The default value is zero. If the value
6365bd8deadSopenharmony_ci        of this attribute is outside the range of supported mipmap level, 
6375bd8deadSopenharmony_ci        the closest valid mipmap level is selected for rendering.
6385bd8deadSopenharmony_ci
6395bd8deadSopenharmony_ci        WGL_CUBE_MAP_FACE_ARB 
6405bd8deadSopenharmony_ci
6415bd8deadSopenharmony_ci        For cube map textures, this attribute indicates which face of the 
6425bd8deadSopenharmony_ci        cube map should be rendered; it must be set to one of 
6435bd8deadSopenharmony_ci
6445bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 
6455bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 
6465bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 
6475bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 
6485bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 
6495bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB.
6505bd8deadSopenharmony_ci
6515bd8deadSopenharmony_ci        The default value is WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB. 
6525bd8deadSopenharmony_ci
6535bd8deadSopenharmony_ci        If wglSetPbufferAttribARB fails, FALSE is returned.  To get extended
6545bd8deadSopenharmony_ci        error information, call GetLastError. Possible errors are as follows: 
6555bd8deadSopenharmony_ci
6565bd8deadSopenharmony_ci        ERROR_INVALID_HANDLE        <hPbuffer> is not a valid handle. 
6575bd8deadSopenharmony_ci
6585bd8deadSopenharmony_ci        ERROR_INVALID_DATA          Bad attribute specified in <piAttribList>.
6595bd8deadSopenharmony_ci
6605bd8deadSopenharmony_ci        ERROR_INVALID_DATA          WGL_MIPMAP_LEVEL_ARB does not specify
6615bd8deadSopenharmony_ci                                    a valid mipmap level.
6625bd8deadSopenharmony_ci
6635bd8deadSopenharmony_ci        ERROR_INVALID_DATA          WGL_CUBE_MAP_IMAGE_ARB is not set to a
6645bd8deadSopenharmony_ci                                    valid value.
6655bd8deadSopenharmony_ci
6665bd8deadSopenharmony_ci        ....
6675bd8deadSopenharmony_ci
6685bd8deadSopenharmony_ci    Modify wglQueryPbufferARB: 
6695bd8deadSopenharmony_ci
6705bd8deadSopenharmony_ci        To query an attribute associated with a specific pbuffer, call 
6715bd8deadSopenharmony_ci
6725bd8deadSopenharmony_ci        BOOL wglQueryPbufferARB(HPBUFFERARB hPbuffer, int iAttribute, 
6735bd8deadSopenharmony_ci                                int *piValue); 
6745bd8deadSopenharmony_ci
6755bd8deadSopenharmony_ci        with <hPbuffer> set to a previously returned pbuffer handle. 
6765bd8deadSopenharmony_ci        <iAttribute> must be set to one of WGL_PBUFFER_WIDTH_ARB, 
6775bd8deadSopenharmony_ci        WGL_PBUFFER_HEIGHT_ARB, WGL_PBUFFER_LOST_ARB, WGL_TEXTURE_TARGET_ARB, 
6785bd8deadSopenharmony_ci        WGL_MIPMAP_TEXTURE_ARB, WGL_MIPMAP_LEVEL_ARB, WGL_CUBE_MAP_FACE_ARB
6795bd8deadSopenharmony_ci        or WGL_TEXTURE_FORMAT_ARB.
6805bd8deadSopenharmony_ci
6815bd8deadSopenharmony_ci        The WGL_PBUFFER_LOST_ARB query can be used to determine if the pixel 
6825bd8deadSopenharmony_ci        buffer memory was lost due to a display mode change.  A value of 
6835bd8deadSopenharmony_ci        TRUE is returned in buffer <piValue> if the display mode change lost  
6845bd8deadSopenharmony_ci        the memory for the pixel buffer. It is not an error to render to a 
6855bd8deadSopenharmony_ci        pixel buffer in this state, but the effect of rendering to it is the
6865bd8deadSopenharmony_ci        same as if the pixel buffer was destroyed:  the context state will 
6875bd8deadSopenharmony_ci        be updated, but the values of the returned pixels are undefined.  
6885bd8deadSopenharmony_ci        The pixel buffer must be destroyed and recreated if the pixel buffer
6895bd8deadSopenharmony_ci        memory has been lost.  A value of FALSE is returned to indicate 
6905bd8deadSopenharmony_ci        that the contents of the pixel buffer are unaffected by the display 
6915bd8deadSopenharmony_ci        mode change. 
6925bd8deadSopenharmony_ci
6935bd8deadSopenharmony_ci        When a color buffer of a pbuffer is bound as a texture, then the 
6945bd8deadSopenharmony_ci        contents of that texture must be preserved until the color buffer is 
6955bd8deadSopenharmony_ci        released. If the pbuffer is lost, any color buffers that are bound 
6965bd8deadSopenharmony_ci        to textures will be freed when they are released back to the pbuffer
6975bd8deadSopenharmony_ci        by calling wglReleaseTexImage. 
6985bd8deadSopenharmony_ci
6995bd8deadSopenharmony_ci        If  wglPbufferAttribARB fails, FALSE is returned.  To get extended 
7005bd8deadSopenharmony_ci        error information, call GetLastError. Possible errors are as follows: 
7015bd8deadSopenharmony_ci
7025bd8deadSopenharmony_ci        ERROR_INVALID_HANDLE        <hPbuffer> is not a valid handle. 
7035bd8deadSopenharmony_ci
7045bd8deadSopenharmony_ci        ERROR_INVALID_DATA          <iAttribute> is not a valid attribute.
7055bd8deadSopenharmony_ci
7065bd8deadSopenharmony_ci        .... 
7075bd8deadSopenharmony_ci
7085bd8deadSopenharmony_ci    Add wglBindTexImageARB and wglReleaseTexImageARB: 
7095bd8deadSopenharmony_ci
7105bd8deadSopenharmony_ci        The command 
7115bd8deadSopenharmony_ci
7125bd8deadSopenharmony_ci        BOOL wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer)
7135bd8deadSopenharmony_ci
7145bd8deadSopenharmony_ci        defines a one-dimensional texture image or two-dimensional 
7155bd8deadSopenharmony_ci        texture image or a set of two-dimensional cube map texture images.  
7165bd8deadSopenharmony_ci        The texture image or images consist of the image data in <iBuffer>
7175bd8deadSopenharmony_ci        for the specified pbuffer, <hPbuffer>, and need not be copied.
7185bd8deadSopenharmony_ci        The texture target, the texture format and the size of the 
7195bd8deadSopenharmony_ci        texture components are derived from attributes of pbuffer 
7205bd8deadSopenharmony_ci        specified by <hPbuffer>. 
7215bd8deadSopenharmony_ci        
7225bd8deadSopenharmony_ci        Note that any existing images associated with the different 
7235bd8deadSopenharmony_ci        mipmap levels of the texture object are freed (it is as if 
7245bd8deadSopenharmony_ci        TexImage was called with an image of zero width).
7255bd8deadSopenharmony_ci
7265bd8deadSopenharmony_ci        The pbuffer attribute WGL_TEXTURE_FORMAT_ARB determines the base 
7275bd8deadSopenharmony_ci        internal format of the texture. The component sizes are also 
7285bd8deadSopenharmony_ci        determined by pbuffer attributes as shown in the table below. 
7295bd8deadSopenharmony_ci  
7305bd8deadSopenharmony_ci        Texture Component           Size
7315bd8deadSopenharmony_ci
7325bd8deadSopenharmony_ci            R                   WGL_RED_BITS_ARB
7335bd8deadSopenharmony_ci            G                   WGL_GREEN_BITS_ARB
7345bd8deadSopenharmony_ci            B                   WGL_BLUE_BITS_ARB
7355bd8deadSopenharmony_ci            A                   WGL_ALPHA_BITS_ARB
7365bd8deadSopenharmony_ci
7375bd8deadSopenharmony_ci
7385bd8deadSopenharmony_ci        Table x.x: Size of texture components 
7395bd8deadSopenharmony_ci
7405bd8deadSopenharmony_ci        The texture targets are derived from the WGL_TEXTURE_TARGET_ARB 
7415bd8deadSopenharmony_ci        attribute of <hPbuffer>. If the texture target for the pbuffer is 
7425bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_ARB then <iBuffer> defines a set of cubemap 
7435bd8deadSopenharmony_ci        images for the cube map texture objects which are bound to the 
7445bd8deadSopenharmony_ci        current context (hereafter referred to as the current texture 
7455bd8deadSopenharmony_ci        object).  Note that when the texture target is 
7465bd8deadSopenharmony_ci        WGL_TEXTURE_CUBE_MAP_ARB, all cube map texture targets are defined
7475bd8deadSopenharmony_ci        by a single call to wglBindTexImageARB. If the texture target is 
7485bd8deadSopenharmony_ci        WGL_TEXTURE_2D_ARB, then <iBuffer> defines a 2D texture for the 
7495bd8deadSopenharmony_ci        current 2D texture object; if the texture target is WGL_TEXTURE_1D_ARB, 
7505bd8deadSopenharmony_ci        then <iBuffer> defines a 1D texture for the current 1D texture object. 
7515bd8deadSopenharmony_ci
7525bd8deadSopenharmony_ci        The possible values for <iBuffer> are WGL_FRONT_LEFT_ARB, 
7535bd8deadSopenharmony_ci        WGL_FRONT_RIGHT_ARB, WGL_BACK_LEFT_ARB, WGL_BACK_RIGHT_ARB, and 
7545bd8deadSopenharmony_ci        WGL_AUX0_ARB through WGL_AUXn_ARB. 
7555bd8deadSopenharmony_ci
7565bd8deadSopenharmony_ci        If <hPbuffer> is the calling thread's current drawable, 
7575bd8deadSopenharmony_ci        wglBindTexImageARB performs an implicit glFlush. 
7585bd8deadSopenharmony_ci
7595bd8deadSopenharmony_ci        After this function is called, the pbuffer associated with <iBuffer> 
7605bd8deadSopenharmony_ci        is no longer available for reading or writing. Any read
7615bd8deadSopenharmony_ci        operation, such as glReadPixels, which reads values from any of the 
7625bd8deadSopenharmony_ci        pbuffer's color buffers or ancillary buffers, will produce 
7635bd8deadSopenharmony_ci        indeterminate results. In addition, any draw operation that is 
7645bd8deadSopenharmony_ci        done to the pbuffer prior to wglReleaseTexImageARB being called, 
7655bd8deadSopenharmony_ci        produces indeterminant results.  Specifically, if the pbuffer is 
7665bd8deadSopenharmony_ci        current to a context and thread then rendering commands will be 
7675bd8deadSopenharmony_ci        processed and the context state will be updated but the pbuffer may 
7685bd8deadSopenharmony_ci        or may not be written. Also, SwapBuffers is a no-op if it is called 
7695bd8deadSopenharmony_ci        on this pbuffer. 
7705bd8deadSopenharmony_ci
7715bd8deadSopenharmony_ci        Note that the color buffer is bound to a texture object. If the
7725bd8deadSopenharmony_ci        texture object is shared between contexts, then the 
7735bd8deadSopenharmony_ci        color buffer is also shared. If a texture object is deleted
7745bd8deadSopenharmony_ci        before wglReleaseTexImageARB is called, then the color buffer is 
7755bd8deadSopenharmony_ci        released and the pbuffer is made available for reading and writing. 
7765bd8deadSopenharmony_ci
7775bd8deadSopenharmony_ci        It is not an error to call TexImage2D, TexImage1D, 
7785bd8deadSopenharmony_ci        CopyTexImage1D or CopyTexImage2D to replace an image of a texture 
7795bd8deadSopenharmony_ci        object that has a color buffer bound to it. However, these calls 
7805bd8deadSopenharmony_ci        will cause the color buffer to be released back to the pbuffer and 
7815bd8deadSopenharmony_ci        new memory will be allocated for the texture. Note that the color 
7825bd8deadSopenharmony_ci        buffer is released even if the image that is being defined is a 
7835bd8deadSopenharmony_ci        mipmap level that was not defined by the color buffer. 
7845bd8deadSopenharmony_ci
7855bd8deadSopenharmony_ci        wglBindTexImageARB is ignored if there is no current rendering 
7865bd8deadSopenharmony_ci        context. 
7875bd8deadSopenharmony_ci
7885bd8deadSopenharmony_ci        If  wglBindTexImageARB fails, FALSE is returned.  To get extended 
7895bd8deadSopenharmony_ci        error information, call GetLastError. Possible errors are as follows: 
7905bd8deadSopenharmony_ci
7915bd8deadSopenharmony_ci        ERROR_INVALID_HANDLE        <hPbuffer> is not a valid handle. 
7925bd8deadSopenharmony_ci
7935bd8deadSopenharmony_ci        ERROR_INVALID_DATA          <iBuffer> is not a valid value. 
7945bd8deadSopenharmony_ci
7955bd8deadSopenharmony_ci        ERROR_INVALID_OPERATION     The pbuffer attribute 
7965bd8deadSopenharmony_ci                                    WGL_TEXTURE_FORMAT_ARB is set to
7975bd8deadSopenharmony_ci                                    WGL_NO_TEXTURE_ARB.
7985bd8deadSopenharmony_ci
7995bd8deadSopenharmony_ci        ERROR_INVALID_OPERATION     <iBuffer> is already bound to the texture
8005bd8deadSopenharmony_ci
8015bd8deadSopenharmony_ci
8025bd8deadSopenharmony_ci    To release a color buffer that is being used as a texture call 
8035bd8deadSopenharmony_ci
8045bd8deadSopenharmony_ci        BOOL wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer) 
8055bd8deadSopenharmony_ci
8065bd8deadSopenharmony_ci        This releases the specified color buffer back to the pbuffer. The 
8075bd8deadSopenharmony_ci        pbuffer is made available for reading and writing when it no
8085bd8deadSopenharmony_ci        longer has any color buffers bound as textures. 
8095bd8deadSopenharmony_ci
8105bd8deadSopenharmony_ci        <iBuffer> must be one of WGL_FRONT_LEFT_ARB, WGL_FRONT_RIGHT_ARB, 
8115bd8deadSopenharmony_ci        WGL_BACK_LEFT_ARB, WGL_BACK_RIGHT_ARB, or WGL_AUX0_ARB through 
8125bd8deadSopenharmony_ci        WGL_AUXn_ARB. 
8135bd8deadSopenharmony_ci
8145bd8deadSopenharmony_ci        The contents of the color buffer are undefined when it is first 
8155bd8deadSopenharmony_ci        released. In particular there is no guarantee that the texture
8165bd8deadSopenharmony_ci        image is still present. However, the contents of other color 
8175bd8deadSopenharmony_ci        buffers is unaffected by this call. Also, the contents of the depth,
8185bd8deadSopenharmony_ci        stencil and accumulation buffers are not affected by 
8195bd8deadSopenharmony_ci        wglBindTexImageARB and wglReleaseTexImageARB. 
8205bd8deadSopenharmony_ci        
8215bd8deadSopenharmony_ci        If the specified color buffer is no longer bound to a texture (e.g.,
8225bd8deadSopenharmony_ci        because the texture object was deleted) then this call is a
8235bd8deadSopenharmony_ci        noop; no error is generated. 
8245bd8deadSopenharmony_ci
8255bd8deadSopenharmony_ci        After a color buffer is released from a texture (either explicitly
8265bd8deadSopenharmony_ci        by calling wglReleaseTexImageARB or implicitly by calling a 
8275bd8deadSopenharmony_ci        routine such as TexImage2D), all texture images that were defined
8285bd8deadSopenharmony_ci        by the color buffer become NULL (it is as if TexImage was 
8295bd8deadSopenharmony_ci        called with an image of zero width).
8305bd8deadSopenharmony_ci
8315bd8deadSopenharmony_ci        If  wglReleaseTexImageARB fails, FALSE is returned. To get extended 
8325bd8deadSopenharmony_ci        error information, call GetLastError. Possible errors are as follows: 
8335bd8deadSopenharmony_ci
8345bd8deadSopenharmony_ci        ERROR_INVALID_HANDLE        <hPbuffer> is not a valid handle. 
8355bd8deadSopenharmony_ci
8365bd8deadSopenharmony_ci        ERROR_INVALID_DATA          <iBuffer> is not a valid value. 
8375bd8deadSopenharmony_ci        
8385bd8deadSopenharmony_ci        ERROR_INVALID_OPERATION     The pbuffer attribute 
8395bd8deadSopenharmony_ci                                    WGL_TEXTURE_FORMAT_ARB is set to
8405bd8deadSopenharmony_ci                                    WGL_NO_TEXTURE_ARB.
8415bd8deadSopenharmony_ci
8425bd8deadSopenharmony_ciNew State 
8435bd8deadSopenharmony_ci
8445bd8deadSopenharmony_ci    None 
8455bd8deadSopenharmony_ci
8465bd8deadSopenharmony_ciDependencies on GL_ARB_texture_cube_map 
8475bd8deadSopenharmony_ci
8485bd8deadSopenharmony_ci    If GL_ARB_texture_cube_map is not supported then all references to
8495bd8deadSopenharmony_ci    WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
8505bd8deadSopenharmony_ci    WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
8515bd8deadSopenharmony_ci    WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 
8525bd8deadSopenharmony_ci    WGL_TEXTURE_CUBE_MAP_ARB and WGL_CUBE_MAP_FACE_ARB are deleted. 
8535bd8deadSopenharmony_ci  
8545bd8deadSopenharmony_ciRevision History 
8555bd8deadSopenharmony_ci    07/16/01    bpoddar     1. Added WGL_TEXTURE_CUBE_MAP_POSITIVE_*_ARB 
8565bd8deadSopenharmony_ci                               enums to the new tokens section.
8575bd8deadSopenharmony_ci                            2. Added clarification on MIPMAP_LEVEL_ARB usage.
8585bd8deadSopenharmony_ci                            3. Removed 1 invalid error condition from
8595bd8deadSopenharmony_ci                               wglBindTexImage.
8605bd8deadSopenharmony_ci                            4. Changed parameter references to <parameter>.
8615bd8deadSopenharmony_ci
8625bd8deadSopenharmony_ci    07/12/01    bpoddar     Fixed minor typos and added enum values.
8635bd8deadSopenharmony_ci        
8645bd8deadSopenharmony_ci    06/22/01    bpoddar     Minor language edits from ARB participants.
8655bd8deadSopenharmony_ci
8665bd8deadSopenharmony_ci    04/09/01    bpoddar     1. Renamed WGL_TEXTURE_TYPE_ARB to 
8675bd8deadSopenharmony_ci                               WGL_TEXTURE_TARGET_ARB.
8685bd8deadSopenharmony_ci                            2. Cleaned up behavior of WGL_TEXTURE_FORMAT_ARB.
8695bd8deadSopenharmony_ci
8705bd8deadSopenharmony_ci    03/23/01    bpoddar     1. Updated the implementation notes section
8715bd8deadSopenharmony_ci                               with the discussion at the ARB. 
8725bd8deadSopenharmony_ci                            2. Replaced ERROR_??? with specified errors
8735bd8deadSopenharmony_ci                            3. Clarified width and height selection rules
8745bd8deadSopenharmony_ci                               for WGL_PBUFFER_LARGEST.
8755bd8deadSopenharmony_ci                            4. Added policy for dealing with mip levels
8765bd8deadSopenharmony_ci                               both on Bind and Release.
8775bd8deadSopenharmony_ci                            5. Specified behavior for implicit release and
8785bd8deadSopenharmony_ci                               added comment to implementation section.
8795bd8deadSopenharmony_ci                            6. Added couple of errors to SetPbufferAttrib. 
8805bd8deadSopenharmony_ci
8815bd8deadSopenharmony_ci    03/06/01    bpoddar     1. Deleted references to 3D texture
8825bd8deadSopenharmony_ci                            2. Deleted references to LUMINANCE, INTENSITY
8835bd8deadSopenharmony_ci                               textures.
8845bd8deadSopenharmony_ci                            3. wglBindTexImageARB no longer provides a
8855bd8deadSopenharmony_ci                               separate mipmap attribute (issue #21).
8865bd8deadSopenharmony_ci                            4. Removed references to multiple texture 
8875bd8deadSopenharmony_ci                               objects for cube maps.
8885bd8deadSopenharmony_ci                            5. Added issue # 23.
8895bd8deadSopenharmony_ci                            6. Added implementation notes section.
8905bd8deadSopenharmony_ci
8915bd8deadSopenharmony_ci    12/01/00    pwomack     Updated issues list. Require non-static pbuffer 
8925bd8deadSopenharmony_ci                            attributes to be set via SetPbufferAttrib (they 
8935bd8deadSopenharmony_ci                            cannot be set when the pbuffer is created.) 
8945bd8deadSopenharmony_ci                            The WGL_TEXTURE_TARGET_ARB attribute now takes 
8955bd8deadSopenharmony_ci                            WGL_NO_TEXTURE_ARB as a value, so the app can 
8965bd8deadSopenharmony_ci                            indicate that the pbuffer will never be bound 
8975bd8deadSopenharmony_ci                            as a texture. If a pbuffer is created with 
8985bd8deadSopenharmony_ci                            WGL_TEXTURE_TARGET_ARB set to WGL_NO_TEXTURE_ARB, 
8995bd8deadSopenharmony_ci                            then an error results if an attempt is made to 
9005bd8deadSopenharmony_ci                            bind it as a texture. Specified default values 
9015bd8deadSopenharmony_ci                            for all attribute lists. When a color buffer is 
9025bd8deadSopenharmony_ci                            bound as a texture then drawing to the pbuffer 
9035bd8deadSopenharmony_ci                            gives undefined results (previously the 
9045bd8deadSopenharmony_ci                            rendering was lost). When a color buffer is 
9055bd8deadSopenharmony_ci                            bound as a texture, calling TexImage or 
9065bd8deadSopenharmony_ci                            CopyTexImage releases the color buffer back to 
9075bd8deadSopenharmony_ci                            the pbuffer. 
9085bd8deadSopenharmony_ci
9095bd8deadSopenharmony_ci    11/12/00    pwomack     Created. Copied from GLX extension. Added WGL 
9105bd8deadSopenharmony_ci                            calls and removed all GLX-centric stuff. 
911