15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_pbuffer
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    WGL_EXT_pbuffer
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciVersion
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Date: 1/27/1999   Version 1.6
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNumber
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    171
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciDependencies
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    WGL_EXT_extensions_string is required.
205bd8deadSopenharmony_ci    WGL_EXT_pixel_format is required.
215bd8deadSopenharmony_ci    WGL_EXT_make_current_read affects the definition of this extension.
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciOverview
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    This extension defines pixel buffers (pbuffer for short). Pbuffers are
265bd8deadSopenharmony_ci    additional non-visible rendering buffers for an OpenGL renderer.
275bd8deadSopenharmony_ci    Pbuffers are equivalent to a window that has the same pixel format
285bd8deadSopenharmony_ci    descriptor with the following exceptions:
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    1.  There is no rendering to a pbuffer by GDI.
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    2.  The pixel format descriptors used for a pbuffer can only be those
335bd8deadSopenharmony_ci        that are supported by the ICD.  Generic formats are not valid.
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    4.  The allocation of a pbuffer can fail if there are insufficient
365bd8deadSopenharmony_ci        resources (i.e., all the pbuffer memory has been allocated).
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    The intent of the pbuffer semantics is to enable implementations to
395bd8deadSopenharmony_ci    allocate pbuffers in non-visible frame buffer memory.  These
405bd8deadSopenharmony_ci    pbuffers are intended to be "static" resources in that a program
415bd8deadSopenharmony_ci    will typically allocate them only once rather than as a part of its
425bd8deadSopenharmony_ci    rendering loop.  (Pbuffers should be deallocated when the program is
435bd8deadSopenharmony_ci    no longer using them -- for example, if the program is iconified.)
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    The frame buffer resources that are associated with a pbuffer are
465bd8deadSopenharmony_ci    also static and are deallocated only when the pbuffer is destroyed.
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ciNew Procedures and Functions
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    HPBUFFEREXT wglCreatePbufferEXT(HDC hDC,
515bd8deadSopenharmony_ci                                    int iPixelFormat,
525bd8deadSopenharmony_ci                                    int iWidth,
535bd8deadSopenharmony_ci                                    int iHeight,
545bd8deadSopenharmony_ci                                    const int *piAttribList);
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    HDC wglGetPbufferDCEXT(HPBUFFEREXT hPbuffer);
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    int wglReleasePbufferDCEXT(HPBUFFEREXT hPbuffer,
595bd8deadSopenharmony_ci                               HDC hDC);
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    BOOL wglDestroyPbufferEXT(HPBUFFEREXT hPbuffer);
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    BOOL wglQueryPbufferEXT(HPBUFFEREXT hPbuffer,
645bd8deadSopenharmony_ci                            int iAttribute,
655bd8deadSopenharmony_ci                            int *piValue);
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNew Tokens
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    Accepted by the <attribute> parameter of wglGetPixelFormatAttribivEXT,
705bd8deadSopenharmony_ci    wglGetPixelFormatAttribfvEXT, and wglChoosePixelFormatEXT:
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci      WGL_DRAW_TO_PBUFFER_EXT              0x202D
735bd8deadSopenharmony_ci      WGL_MAX_PBUFFER_PIXELS_EXT           0x202E
745bd8deadSopenharmony_ci      WGL_MAX_PBUFFER_WIDTH_EXT            0x202F
755bd8deadSopenharmony_ci      WGL_MAX_PBUFFER_HEIGHT_EXT           0x2030
765bd8deadSopenharmony_ci      WGL_OPTIMAL_PBUFFER_WIDTH_EXT        0x2031
775bd8deadSopenharmony_ci      WGL_OPTIMAL_PBUFFER_HEIGHT_EXT       0x2032
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    Accepted by the <piAttribList> parameter of wglCreatePbufferEXT:
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci      WGL_PBUFFER_LARGEST_EXT              0x2033
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    Accepted by the <iAttribute> parameter of wglQueryPbufferEXT:
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci      WGL_PBUFFER_WIDTH_EXT                0x2034
865bd8deadSopenharmony_ci      WGL_PBUFFER_HEIGHT_EXT               0x2035
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.2 Specification (OpenGL Operation)
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci    None
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2 Specification (Rasterization)
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    None
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations
975bd8deadSopenharmony_ciand the Frame buffer)
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    None
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2 Specification (Special Functions)
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    None
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2 Specification (State and State Requests)
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    None
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ciAdditions to the WGL Specification
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    A pixel buffer (pbuffer) can be created with wglCreatePbufferEXT
1125bd8deadSopenharmony_ci    which returns a handle associated with the pbuffer.
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci      HPBUFFEREXT wglCreatePbufferEXT(HDC hDC,
1155bd8deadSopenharmony_ci                                      int iPixelFormat,
1165bd8deadSopenharmony_ci                                      int iWidth,
1175bd8deadSopenharmony_ci                                      int iHeight,
1185bd8deadSopenharmony_ci                                      const int *piAttribList);
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci    <hDC> specifies a device context for the device on which the pbuffer
1215bd8deadSopenharmony_ci    is created. <iPixelFormat> specifies a non-generic pixel format
1225bd8deadSopenharmony_ci    descriptor index.  Support for pbuffers may be restricted to
1235bd8deadSopenharmony_ci    specific pixel formats.  Use wglGetPixelFormatAttribivEXT or
1245bd8deadSopenharmony_ci    wglGetPixelFormatAttribfvEXT to query the WGL_DRAW_TO_PBUFFER_EXT
1255bd8deadSopenharmony_ci    attribute to determine which pixel formats support the creation of
1265bd8deadSopenharmony_ci    pbuffers.
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    <iWidth> and <iHeight> specify the pixel width and height of the
1295bd8deadSopenharmony_ci    rectangular pbuffer.
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    <piAttribList> is a list of attributes {type, value} pairs containing
1325bd8deadSopenharmony_ci    integer attribute values.  All of the attributes in the <piAttribList>
1335bd8deadSopenharmony_ci    are followed by the corresponding required value.  The list is
1345bd8deadSopenharmony_ci    terminated with a value of 0.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    The following attributes are supported by wglCreatePbufferEXT:
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci      WGL_PBUFFER_LARGEST_EXT     If this attribute is set to a
1395bd8deadSopenharmony_ci                                  non-zero value, the largest
1405bd8deadSopenharmony_ci                                  available pbuffer is allocated
1415bd8deadSopenharmony_ci                                  when the allocation of the pbuffer
1425bd8deadSopenharmony_ci                                  would otherwise fail due to
1435bd8deadSopenharmony_ci                                  insufficient resources.  The width
1445bd8deadSopenharmony_ci                                  or height of the allocated pbuffer
1455bd8deadSopenharmony_ci                                  never exceeds <iWidth> and <iHeight>,
1465bd8deadSopenharmony_ci                                  respectively.  Use wglQueryPbufferEXT
1475bd8deadSopenharmony_ci                                  to retrieve the dimensions of the
1485bd8deadSopenharmony_ci                                  allocated pbuffer.
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ci    The resulting pbuffer will contain color buffers and ancillary
1515bd8deadSopenharmony_ci    buffers as specified by <iPixelFormat>.  Note that pbuffers use
1525bd8deadSopenharmony_ci    framebuffer resources so applications should consider deallocating
1535bd8deadSopenharmony_ci    them when they are not in use.
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    It is possible to create a pbuffer with back buffers and to swap
1565bd8deadSopenharmony_ci    the front and back buffers by calling wglSwapLayerBuffers.  The
1575bd8deadSopenharmony_ci    contents of the back buffers after the swap depends on the
1585bd8deadSopenharmony_ci    <iPixelFormat>.  (Pbuffers are the same as windows in this respect.)
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    When wglCreatePbufferEXT fails to create a pbuffer, NULL is returned.
1615bd8deadSopenharmony_ci    To get extended error information, call GetLastError.  Possible errors
1625bd8deadSopenharmony_ci    are as follows:
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci      ERROR_INVALID_PIXEL_FORMAT     Pixel format is not valid.
1655bd8deadSopenharmony_ci      ERROR_NO_SYSTEM_RESOURCES      Insufficient resources exist.
1665bd8deadSopenharmony_ci      ERROR_INVALID_DATA             <iWidth> or <iHeight> is negative
1675bd8deadSopenharmony_ci                                     or zero.
1685bd8deadSopenharmony_ci      ERROR_INVALID_DATA             <piAttribList> is not a valid attribute.
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    To create a device context for the pbuffer, call
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci      HDC wglGetPbufferDCEXT(HPBUFFEREXT hPbuffer);
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    where <hPbuffer> is a handle returned from a previous call to
1755bd8deadSopenharmony_ci    wglCreatePbufferEXT.  A device context is returned by
1765bd8deadSopenharmony_ci    wglGetPbufferDCEXT which can be used to associate a rendering
1775bd8deadSopenharmony_ci    context with the pbuffer.  Any rendering context created with
1785bd8deadSopenharmony_ci    a wglCreateContext that is "compatible" with the <iPixelFormat> may be
1795bd8deadSopenharmony_ci    used to render into the pbuffer. (See the description of
1805bd8deadSopenharmony_ci    wglCreateContext, wglMakeCurrent, and wglMakeCurrentReadEXT for a
1815bd8deadSopenharmony_ci    definition of "compatible".)
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    When wglGetPbufferDCEXT fails, NULL is returned.  To get extended
1845bd8deadSopenharmony_ci    error information, call GetLastError. Possible errors are as follows:
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci      ERROR_INVALID_HANDLE           <hPbuffer> is not a valid handle.
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    To release a device context obtained from a previous call to
1895bd8deadSopenharmony_ci    wglGetPbufferDCEXT, call
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci        int wglReleasePbufferDCEXT(HPBUFFEREXT hPbuffer,
1925bd8deadSopenharmony_ci                                   HDC hDC);
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci    If the return value is a value of 1, the device context was released.
1955bd8deadSopenharmony_ci    If the device context was not released, the return value is 0.  To get
1965bd8deadSopenharmony_ci    extended error information, call GetLastError. Possible errors are
1975bd8deadSopenharmony_ci    as follows:
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci      ERROR_INVALID_HANDLE           <hPbuffer> is not a valid handle.
2005bd8deadSopenharmony_ci      ERROR_DC_NOT_FOUND             <hDC> is not a valid DC.
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci    A pbuffer is destroyed by calling
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci      BOOL wglDestroyPbufferEXT(HPBUFFEREXT hPbuffer);
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci    The pbuffer is destroyed once it is no longer current to any rendering
2075bd8deadSopenharmony_ci    context.  When a pbuffer is destroyed, any memory resources that are
2085bd8deadSopenharmony_ci    attached to it are freed and its handle is no longer valid.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    If wglDestroyPbufferEXT fails, FALSE is returned.  To get extended
2115bd8deadSopenharmony_ci    error information, call GetLastError. Possible errors are as follows:
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci      ERROR_INVALID_HANDLE             <hPbuffer> is not a valid handle.
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    To query the maximum width, height, or number of pixels in any given
2165bd8deadSopenharmony_ci    pbuffer for a specific pixel format, use wglGetPixelFormatAttribivEXT
2175bd8deadSopenharmony_ci    or wglGetPixelFormatAttribfvEXT with <attribute> set to one of
2185bd8deadSopenharmony_ci    WGL_MAX_PBUFFER_WIDTH_EXT, WGL_MAX_PBUFFER_HEIGHT_EXT, or
2195bd8deadSopenharmony_ci    WGL_MAX_PBUFFER_PIXELS_EXT.
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci    WGL_MAX_PBUFFER_WIDTH_EXT and WGL_MAX_PBUFFER_HEIGHT_EXT indicate the
2225bd8deadSopenharmony_ci    maximum width and height that can be passed into wglCreatePbufferEXT
2235bd8deadSopenharmony_ci    and WGL_MAX_PBUFFER_PIXELS_EXT indicates the maximum number of pixels
2245bd8deadSopenharmony_ci    (width x height) for a pbuffer.  Note that an implementation may
2255bd8deadSopenharmony_ci    return a value for WGL_MAX_PBUFFER_PIXELS_EXT that is less than the
2265bd8deadSopenharmony_ci    maximum width times the maximum height.  Also, the value for
2275bd8deadSopenharmony_ci    WGL_MAX_PBUFFER_PIXELS_EXT is static and assumes that no other
2285bd8deadSopenharmony_ci    pbuffers are contending for the framebuffer memory.  Thus it may
2295bd8deadSopenharmony_ci    not be possible to allocate a pbuffer of the size given by
2305bd8deadSopenharmony_ci    WGL_MAX_PBUFFER_PIXELS_EXT.
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    On some implementations, there may be an optimum width and height
2335bd8deadSopenharmony_ci    to use when allocating a pbuffer. (For example, the implementation
2345bd8deadSopenharmony_ci    may use fixed size tiles to allocate pbuffers.)  Use
2355bd8deadSopenharmony_ci    WGL_OPTIMAL_PBUFFER_WIDTH_EXT and WGL_OPTIMAL_PBUFFER_HEIGHT to
2365bd8deadSopenharmony_ci    determine this width and height.  If the value returned is zero,
2375bd8deadSopenharmony_ci    there is no optimal width or height value.
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    To query an attribute associated with a specific pbuffer, call
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci      BOOL wglQueryPbufferEXT(HPBUFFEREXT hPbuffer,
2425bd8deadSopenharmony_ci                              int iAttribute,
2435bd8deadSopenharmony_ci                              int *piValue);
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    with <hPbuffer> set to a previously returned pbuffer handle.
2465bd8deadSopenharmony_ci    <iAttribute> must be set to one of WGL_PBUFFER_WIDTH_EXT or
2475bd8deadSopenharmony_ci    WGL_PBUFFER_HEIGHT_EXT.
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci    If wglQueryPbufferEXT fails, FALSE is returned.  To get extended
2505bd8deadSopenharmony_ci    error information, call GetLastError. Possible errors are as follows:
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci      ERROR_INVALID_HANDLE           <hPbuffer> is not a valid handle.
2535bd8deadSopenharmony_ci      ERROR_INVALID_DATA             <iAttribute> is not a valid attribute.
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    Because there is no way to extend wgl, these calls are defined in the
2565bd8deadSopenharmony_ci    ICD and can be called by obtaining the address with wglGetProcAddress.
2575bd8deadSopenharmony_ci    Because this is not a GL extension, it is not included in the
2585bd8deadSopenharmony_ci    GL_EXTENSIONS string.
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ciNew State
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    None
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ciNew Implementation Dependent State
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci    None
267