15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    SGIX_pbuffer
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GLX_SGIX_pbuffer
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciVersion
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Version 1.29, 2009/11/19
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNumber
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    50
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciDependencies
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    SGIX_FBConfig is required
205bd8deadSopenharmony_ci    SGIS_multisample affects the definition of this extension
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciOverview
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    This extension defines pixel buffers (GLXPbuffers, or pbuffer for
255bd8deadSopenharmony_ci    short). GLXPbuffers are additional non-visible rendering buffers for an
265bd8deadSopenharmony_ci    OpenGL renderer.  GLXPbuffers are equivalent to GLXPixmaps with the
275bd8deadSopenharmony_ci    following exceptions:
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    1.	There is no associated X pixmap. Also, since a GLXPbuffer is a GLX
305bd8deadSopenharmony_ci        resource, it may not be possible to render to it using X or an 
315bd8deadSopenharmony_ci   	X extension other than GLX.
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    2.	The format of the color buffers and the type and size of any
345bd8deadSopenharmony_ci     	associated ancillary buffers for a GLXPbuffer can only be
355bd8deadSopenharmony_ci        described with a GLXFBConfig -- an X Visual cannot be used.
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    3.	It is possible to create a GLXPbuffer whose contents may be 
385bd8deadSopenharmony_ci	asynchronously lost at any time.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    4.  GLXPbuffers can be rendered to using either direct or indirect
415bd8deadSopenharmony_ci        rendering contexts.
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    5.  The allocation of a GLXPbuffer can fail if there are insufficient
445bd8deadSopenharmony_ci	resources (i.e., all the pbuffer memory has been allocated and 
455bd8deadSopenharmony_ci	the implementation does not virtualize pbuffer memory.)
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    The intent of the pbuffer semantics is to enable implementations to
485bd8deadSopenharmony_ci    allocate pbuffers in non-visible frame buffer memory.  These
495bd8deadSopenharmony_ci    pbuffers are intended to be "static" resources, in that a program
505bd8deadSopenharmony_ci    will typically allocate them only once, rather than as a part of its
515bd8deadSopenharmony_ci    rendering loop.  (But they should be deallocated when the program is
525bd8deadSopenharmony_ci    no longer using them -- for example, if the program is iconified.)
535bd8deadSopenharmony_ci    The frame buffer resources that are associated with a pbuffer are 
545bd8deadSopenharmony_ci    also static, and are deallocated only when the pbuffer is destroyed, 
555bd8deadSopenharmony_ci    or, in the case of a "unpreserved" pbuffer, as a result of X server 
565bd8deadSopenharmony_ci    activity that changes its frame buffer requirements.
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ciIssues
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    *   Should the optimum width and height be fixed sizes or a multiple?
625bd8deadSopenharmony_ci   
635bd8deadSopenharmony_ci    *   Any better names for GLX_BUFFER_CLOBBER_MASK_SGIX, etc?
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    UM  Should we add a command so an application can set the behavior
665bd8deadSopenharmony_ci        when a deep window buffer (e.g., depth buffer or multisample buffer)
675bd8deadSopenharmony_ci        is clobbered by a pbuffer? The choices would be "preserved" or
685bd8deadSopenharmony_ci        "unpreserved". 
695bd8deadSopenharmony_ci 
705bd8deadSopenharmony_ci    *   When a pbuffer interferes with a window's ancillary buffer should
715bd8deadSopenharmony_ci        the action -- swapped or saved -- be specified or left as
725bd8deadSopenharmony_ci	implementation dependent?
735bd8deadSopenharmony_ci    
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ciNew Procedures and Functions
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    GLXPbuffer glXCreateGLXPbufferSGIX(Display *dpy,
785bd8deadSopenharmony_ci				       GLXFBConfig config,
795bd8deadSopenharmony_ci				       unsigned int width,
805bd8deadSopenharmony_ci				       unsigned int height,
815bd8deadSopenharmony_ci				       int *attrib_list);
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    void glXDestroyGLXPbufferSGIX(Display *dpy,
845bd8deadSopenharmony_ci			          GLXPbuffer pbuf);
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    void glXQueryGLXPbufferSGIX(Display *dpy,
875bd8deadSopenharmony_ci			        GLXPbuffer pbuf,
885bd8deadSopenharmony_ci			        int attribute,
895bd8deadSopenharmony_ci			        unsigned int *value);
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    void glXSelectEventSGIX(Display *dpy,
925bd8deadSopenharmony_ci	  		    GLXDrawable drawable,
935bd8deadSopenharmony_ci			    unsigned long mask);
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    void glXGetSelectedEventSGIX(Display *dpy,
965bd8deadSopenharmony_ci  		                 GLXDrawable drawable,
975bd8deadSopenharmony_ci			         unsigned long *mask);
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ciNew Tokens
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci    Accepted by the <attribute> parameter of glXGetFBConfigAttribSGIX:
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci        GLX_MAX_PBUFFER_WIDTH_SGIX		0x8016
1055bd8deadSopenharmony_ci        GLX_MAX_PBUFFER_HEIGHT_SGIX		0x8017
1065bd8deadSopenharmony_ci        GLX_MAX_PBUFFER_PIXELS_SGIX		0x8018
1075bd8deadSopenharmony_ci        GLX_OPTIMAL_PBUFFER_WIDTH_SGIX		0x8019
1085bd8deadSopenharmony_ci        GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX		0x801A
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    Returned by glXGetFBConfigAttribSGIX (when <attribute> is set to 
1115bd8deadSopenharmony_ci    GLX_DRAWABLE_TYPE_SGIX) and accepted by the <attrib_list> parameter of 
1125bd8deadSopenharmony_ci    glXChooseFBConfigSGIX (following the GLX_DRAWABLE_TYPE_SGIX token):
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci	GLX_PBUFFER_BIT_SGIX			0x00000004
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    Accepted by the <attrib_list> parameter of glXCreateGLXPbufferSGIX
1175bd8deadSopenharmony_ci    and by the <attribute> parameter of glXQueryGLXPbufferSGIX:
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci        GLX_PRESERVED_CONTENTS_SGIX		0x801B
1205bd8deadSopenharmony_ci        GLX_LARGEST_PBUFFER_SGIX		0x801C
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci    Accepted by the <attribute> parameter of glXQueryGLXPbufferSGIX:
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci        GLX_WIDTH_SGIX 				0x801D
1255bd8deadSopenharmony_ci        GLX_HEIGHT_SGIX				0x801E
1265bd8deadSopenharmony_ci	GLX_EVENT_MASK_SGIX			0x801F
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    Accepted by the <mask> parameter of glXSelectEventSGIX and returned
1295bd8deadSopenharmony_ci    in the <mask> parameter of glXGetSelectedEventSGIX:
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci	GLX_BUFFER_CLOBBER_MASK_SGIX  		0x08000000
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci    Returned in the <event_type> field of a "buffer clobber" event:
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci	GLX_DAMAGED_SGIX 			0x8020
1365bd8deadSopenharmony_ci	GLX_SAVED_SGIX				0x8021
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci    Returned in the <draw_type> field of a "buffer clobber" event:
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci        GLX_WINDOW_SGIX				0x8022
1415bd8deadSopenharmony_ci	GLX_PBUFFER_SGIX			0x8023
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci    Returned in the <mask> field of a "buffer clobber" event:
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci	GLX_FRONT_LEFT_BUFFER_BIT_SGIX		0x00000001
1465bd8deadSopenharmony_ci	GLX_FRONT_RIGHT_BUFFER_BIT_SGIX		0x00000002
1475bd8deadSopenharmony_ci	GLX_BACK_LEFT_BUFFER_BIT_SGIX		0x00000004
1485bd8deadSopenharmony_ci	GLX_BACK_RIGHT_BUFFER_BIT_SGIX		0x00000008
1495bd8deadSopenharmony_ci	GLX_AUX_BUFFERS_BIT_SGIX		0x00000010
1505bd8deadSopenharmony_ci	GLX_DEPTH_BUFFER_BIT_SGIX		0x00000020
1515bd8deadSopenharmony_ci	GLX_STENCIL_BUFFER_BIT_SGIX		0x00000040
1525bd8deadSopenharmony_ci	GLX_ACCUM_BUFFER_BIT_SGIX		0x00000080
1535bd8deadSopenharmony_ci	GLX_SAMPLE_BUFFERS_BIT_SGIX		0x00000100
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    None
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization)
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    None
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
1645bd8deadSopenharmony_ciand the Frame buffer)
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    None
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions)
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    None
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests)
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    None
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ciAdditions to the GLX Specification
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci    [Add the following to section 3.2.2 on Configuration Management]
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    [Add to glXGetFBConfigAttribSGIX]:
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci    GLX_MAX_PBUFFER_WIDTH_SGIX and GLX_MAX_PBUFFER_HEIGHT_SGIX indicate the
1835bd8deadSopenharmony_ci    maximum width and height that can be passed into glXCreateGLXPbufferSGIX and
1845bd8deadSopenharmony_ci    GLX_MAX_PBUFFER_PIXELS_SGIX indicates the maximum number of pixels (width x
1855bd8deadSopenharmony_ci    hieght) for a GLXPbuffer. Note that an implementation may return a value for
1865bd8deadSopenharmony_ci    GLX_MAX_PBUFFER_PIXELS_SGIX that is less than the maximum width times the
1875bd8deadSopenharmony_ci    maximum height. Also, the value for GLX_MAX_PBUFFER_PIXELS_SGIX is static
1885bd8deadSopenharmony_ci    and assumes that no other pbuffers or X resources are contending for the
1895bd8deadSopenharmony_ci    framebuffer memory. Thus it may not be possible to allocate a pbuffer of
1905bd8deadSopenharmony_ci    the size given by GLX_MAX_PBUFFER_PIXELS_SGIX.
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    On some implementations, there may be an optimum width and height to use
1935bd8deadSopenharmony_ci    when allocating a pbuffer. (For example, the implementation may use fixed
1945bd8deadSopenharmony_ci    size tiles to allocate pbuffers.) Use GLX_OPTIMAL_PBUFFER_WIDTH_SGIX and
1955bd8deadSopenharmony_ci    GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX to determine this width and height. If the
1965bd8deadSopenharmony_ci    values are zero then there is no optimal value.
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci    [Add to glXChooseFBConfigSGIX]:
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    If GLX_OPTIMAL_PBUFFER_WIDTH_SGIX and/or GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 
2015bd8deadSopenharmony_ci    are specified in <attrib_list> then they are ignored.
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    [Additions to tables 2 and 3, given in SGIX_FBConfig]
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci      Attribute                       Type        Description
2065bd8deadSopenharmony_ci      ---------                       ----        -----------
2075bd8deadSopenharmony_ci      GLX_BUFFER_SIZE                 integer     depth of the color buffer
2085bd8deadSopenharmony_ci      GLX_LEVEL                       integer     frame buffer level
2095bd8deadSopenharmony_ci      GLX_DOUBLEBUFFER                boolean     True if color buffers have
2105bd8deadSopenharmony_ci						  front/back pairs
2115bd8deadSopenharmony_ci      GLX_STEREO                      boolean     True if color buffers have
2125bd8deadSopenharmony_ci				      		  left/right pairs
2135bd8deadSopenharmony_ci      GLX_AUX_BUFFERS                 integer     number of auxiliary color
2145bd8deadSopenharmony_ci						  buffers 
2155bd8deadSopenharmony_ci      GLX_RED_SIZE                    integer     number of bits of Red if in
2165bd8deadSopenharmony_ci      						  RGB mode
2175bd8deadSopenharmony_ci      GLX_GREEN_SIZE                  integer     number of bits of Green if in
2185bd8deadSopenharmony_ci      						  RGB mode
2195bd8deadSopenharmony_ci      GLX_BLUE_SIZE                   integer     number of bits of Blue if in
2205bd8deadSopenharmony_ci      						  RGB mode
2215bd8deadSopenharmony_ci      GLX_ALPHA_SIZE                  integer     number of bits of Alpha if in
2225bd8deadSopenharmony_ci      						  RGB mode
2235bd8deadSopenharmony_ci      GLX_DEPTH_SIZE                  integer     number of bits in the depth
2245bd8deadSopenharmony_ci      						  buffer
2255bd8deadSopenharmony_ci      GLX_STENCIL_SIZE                integer     number of bits in the stencil
2265bd8deadSopenharmony_ci      						  buffer
2275bd8deadSopenharmony_ci      GLX_ACCUM_RED_SIZE              integer     number of bits of Red in the
2285bd8deadSopenharmony_ci       						  accumulation buffer
2295bd8deadSopenharmony_ci      GLX_ACCUM_GREEN_SIZE            integer     number of bits of Green in the
2305bd8deadSopenharmony_ci      						  accumulation buffer
2315bd8deadSopenharmony_ci      GLX_ACCUM_BLUE_SIZE             integer     number of bits of Blue in the
2325bd8deadSopenharmony_ci      accumulation buffer
2335bd8deadSopenharmony_ci      GLX_ACCUM_ALPHA_SIZE            integer     number of bits of Alpha in the
2345bd8deadSopenharmony_ci      						  accumulation buffer
2355bd8deadSopenharmony_ci      GLX_SAMPLE_BUFFERS_SGIS         integer     number of multisample buffers
2365bd8deadSopenharmony_ci      GLX_SAMPLES_SGIS                integer     number of samples stored in
2375bd8deadSopenharmony_ci						  each multisample buffer
2385bd8deadSopenharmony_ci      GLX_X_VISUAL_TYPE_EXT           integer     X visual type of the
2395bd8deadSopenharmony_ci						  associated visual
2405bd8deadSopenharmony_ci      GLX_TRANSPARENT_TYPE_EXT        enum        GLX_NONE_EXT,
2415bd8deadSopenharmony_ci                                                  TRANSPARENT_RGB_EXT, or 
2425bd8deadSopenharmony_ci                                                  TRANSPARENT_INDEX_EXT
2435bd8deadSopenharmony_ci      GLX_TRANSPARENT_INDEX_VALUE_EXT integer     transparent index value.
2445bd8deadSopenharmony_ci      GLX_TRANSPARENT_RED_VALUE_EXT   color       transparent color value.
2455bd8deadSopenharmony_ci      GLX_TRANSPARENT_GREEN_VALUE_EXT color       transparent color value.
2465bd8deadSopenharmony_ci      GLX_TRANSPARENT_BLUE_VALUE_EXT  color       transparent color value.
2475bd8deadSopenharmony_ci      GLX_TRANSPARENT_ALPHA_VALUE_EXT color       transparent color value.
2485bd8deadSopenharmony_ci      GLX_VISUAL_CAVEAT_EXT           enum        GLX_NONE_EXT or
2495bd8deadSopenharmony_ci      						  GLX_SLOW_VISUAL_EXT
2505bd8deadSopenharmony_ci      GLX_DRAWABLE_TYPE_SGIX          bitmask     mask indicating which GLX
2515bd8deadSopenharmony_ci      						  drawables are supported. Valid
2525bd8deadSopenharmony_ci						  bits are GLX_WINDOW_BIT_SGIX and
2535bd8deadSopenharmony_ci                                                  GLX_PIXMAP_BIT_SGIX
2545bd8deadSopenharmony_ci      GLX_RENDER_TYPE_SGIX            bitmask     mask indicating which OpenGL
2555bd8deadSopenharmony_ci      						  rendering modes are supported.
2565bd8deadSopenharmony_ci						  Valid bits are GLX_RGBA_BIT_SGIX
2575bd8deadSopenharmony_ci						  and GLX_COLOR_INDEX_SGIX.
2585bd8deadSopenharmony_ci      GLX_X_RENDERABLE_SGIX           boolean     True if X can render to drawable
2595bd8deadSopenharmony_ci      GLX_MAX_PBUFFER_WIDTH_SGIX      integer	  maximum width of GLXPbuffer
2605bd8deadSopenharmony_ci      GLX_MAX_PBUFFER_HEIGHT_SGIX     integer	  maximum height of GLXPbuffer
2615bd8deadSopenharmony_ci      GLX_MAX_PBUFFER_PIXELS_SGIX     integer	  maximum size of GLXPbuffer
2625bd8deadSopenharmony_ci      GLX_OPTIMAL_PBUFFER_WIDTH_SGIX  integer     best width to use when
2635bd8deadSopenharmony_ci						  creating pbuffer, or zero if
2645bd8deadSopenharmony_ci						  all widths are equally good.
2655bd8deadSopenharmony_ci      GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX integer     best height to use when creating 
2665bd8deadSopenharmony_ci						  pbuffer, or zero if all
2675bd8deadSopenharmony_ci						  heights are equally good.
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ci      Table 3: GLX configuration attributes for GLXFBConfigs (Note that
2705bd8deadSopenharmony_ci               GLX_RGBA and GLX_USE_GL are not supported)
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci      Attribute                               Default             Match Criteria
2735bd8deadSopenharmony_ci      ---------                               -------             --------------
2745bd8deadSopenharmony_ci      GLX_BUFFER_SIZE                         0                   minimum
2755bd8deadSopenharmony_ci      GLX_LEVEL                               0                   exact
2765bd8deadSopenharmony_ci      GLX_DOUBLEBUFFER                        don't care          exact
2775bd8deadSopenharmony_ci      GLX_STEREO                              False               exact
2785bd8deadSopenharmony_ci      GLX_AUX_BUFFERS                         0                   minimum
2795bd8deadSopenharmony_ci      GLX_RED_SIZE                            0                   minimum
2805bd8deadSopenharmony_ci      GLX_GREEN_SIZE                          0                   minimum
2815bd8deadSopenharmony_ci      GLX_BLUE_SIZE                           0                   minimum
2825bd8deadSopenharmony_ci      GLX_ALPHA_SIZE                          0                   minimum
2835bd8deadSopenharmony_ci      GLX_DEPTH_SIZE                          0                   minimum
2845bd8deadSopenharmony_ci      GLX_STENCIL_SIZE                        0                   minimum
2855bd8deadSopenharmony_ci      GLX_ACCUM_RED_SIZE                      0                   minimum
2865bd8deadSopenharmony_ci      GLX_ACCUM_GREEN_SIZE                    0                   minimum
2875bd8deadSopenharmony_ci      GLX_ACCUM_BLUE_SIZE                     0                   minimum
2885bd8deadSopenharmony_ci      GLX_ACCUM_ALPHA_SIZE                    0                   minimum
2895bd8deadSopenharmony_ci      GLX_SAMPLE_BUFFERS_SGIS                 0                   minimum
2905bd8deadSopenharmony_ci      GLX_SAMPLES_SGIS                        0                   minimum
2915bd8deadSopenharmony_ci      GLX_X_VISUAL_TYPE_EXT                   don't care          exact
2925bd8deadSopenharmony_ci      GLX_TRANSPARENT_PIXEL_EXT               GLX_NONE_EXT        exact
2935bd8deadSopenharmony_ci      GLX_TRANSPARENT_INDEX_VALUE_EXT         don't care          exact
2945bd8deadSopenharmony_ci      GLX_TRANSPARENT_RED_VALUE_EXT           don't care          exact
2955bd8deadSopenharmony_ci      GLX_TRANSPARENT_GREEN_VALUE_EXT         don't care          exact
2965bd8deadSopenharmony_ci      GLX_TRANSPARENT_BLUE_VALUE_EXT          don't care          exact
2975bd8deadSopenharmony_ci      GLX_TRANSPARENT_ALPHA_VALUE_EXT         don't care          exact
2985bd8deadSopenharmony_ci      GLX_VISUAL_CAVEAT_EXT                   don't care          exact
2995bd8deadSopenharmony_ci      GLX_DRAWABLE_TYPE_SGIX                  GLX_WINDOW_BIT_SGIX minimum
3005bd8deadSopenharmony_ci      GLX_RENDER_TYPE_SGIX                    GLX_RGBA_BIT_SGIX   minimum
3015bd8deadSopenharmony_ci      GLX_X_RENDERABLE_SGIX                   don't care          exact
3025bd8deadSopenharmony_ci      GLX_FBCONFIG_ID_SGIX                    don't care          exact
3035bd8deadSopenharmony_ci      GLX_MAX_PBUFFER_WIDTH_SGIX      	      0 		  minimum
3045bd8deadSopenharmony_ci      GLX_MAX_PBUFFER_HEIGHT_SGIX    	      0			  minimum
3055bd8deadSopenharmony_ci      GLX_MAX_PBUFFER_PIXELS_SGIX             0 		  minimum
3065bd8deadSopenharmony_ci      GLX_OPTIMAL_PBUFFER_WIDTH_SGIX          ignored		  ignored
3075bd8deadSopenharmony_ci      GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX         ignored		  ignored
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci      Table 4: Default values and match criteria for GLX configuration
3105bd8deadSopenharmony_ci               attributes for GLXFBConfigs 
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci    [Add the following to section 3.2.3 on Offscreen Rendering]
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ci    To create a GLXPbuffer call:
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci        GLXPbuffer glXCreateGLXPbufferSGIX(Display *dpy,
3185bd8deadSopenharmony_ci				           GLXFBConfig config,
3195bd8deadSopenharmony_ci				           unsigned int width,
3205bd8deadSopenharmony_ci				           unsigned int height,
3215bd8deadSopenharmony_ci				           int *attrib_list);
3225bd8deadSopenharmony_ci
3235bd8deadSopenharmony_ci    This creates a single GLXPbuffer and returns its XID. <width> and <height>
3245bd8deadSopenharmony_ci    specify the pixel width and height of the rectangular pbuffer and
3255bd8deadSopenharmony_ci    <attrib_list> specifies a list of attributes for the pbuffer. Currently
3265bd8deadSopenharmony_ci    only two attributes can be specified in <attrib_list>:
3275bd8deadSopenharmony_ci    GLX_PRESERVED_CONTENTS_SGIX and GLX_LARGEST_PBUFFER_SGIX.
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci    <attrib_list> can be either NULL, in which case all the attributes assume
3305bd8deadSopenharmony_ci    their default values as described below.  If it not NULL then its format is
3315bd8deadSopenharmony_ci    similar to the attribute list paramter of glXChooseFBConfigSGIX: each
3325bd8deadSopenharmony_ci    attribute is immediately followed by the corresponding desired value and the
3335bd8deadSopenharmony_ci    list is terminated with None.
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci    Use GLX_LARGEST_PBUFFER_SGIX to get the largest available pbuffer when
3365bd8deadSopenharmony_ci    the allocation of the pbuffer would otherwise fail.  The width or height
3375bd8deadSopenharmony_ci    of the allocated pbuffer never exceed <width> and <height>,
3385bd8deadSopenharmony_ci    respectively. Use glXQueryGLXPbufferSGIX to retrieve the dimensions of the
3395bd8deadSopenharmony_ci    allocated pbuffer.  By default, GLX_LARGEST_PBUFFER_SGIX is False.
3405bd8deadSopenharmony_ci    
3415bd8deadSopenharmony_ci    If the GLX_PRESERVED_CONTENTS_SGIX attribute is set to False in
3425bd8deadSopenharmony_ci    <attrib_list>, then an "unpreserved" pbuffer is created and the contents
3435bd8deadSopenharmony_ci    of the pbuffer may be lost at any time. If this attribute is not
3445bd8deadSopenharmony_ci    specified, or if it is specified as True in <attrib_list>, then when a
3455bd8deadSopenharmony_ci    resource conflict occurs the contents of the pbuffer will be preserved
3465bd8deadSopenharmony_ci    (most likely by swapping out portions of the buffer to main memory).  In
3475bd8deadSopenharmony_ci    either case, the client can register to receive a "buffer clobber" event
3485bd8deadSopenharmony_ci    which is generated when the pbuffer contents have been preserved or have
3495bd8deadSopenharmony_ci    been damaged. (See the event description.)
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci    The resulting pbuffer will contain color buffers and ancillary as
3525bd8deadSopenharmony_ci    specified by <config>.  Note that pbuffers use framebuffer
3535bd8deadSopenharmony_ci    resources so applications should consider deallocating them when
3545bd8deadSopenharmony_ci    they are not in use.
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci    It is possible to create a pbuffer with back buffers and to swap
3575bd8deadSopenharmony_ci    the front and back buffers by calling glXSwapBuffers.  The contents
3585bd8deadSopenharmony_ci    of the back buffers are undefined after such a swap.  (Pbuffers are
3595bd8deadSopenharmony_ci    the same as windows in this respect.)
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    Any GLX rendering context created with a GLXFBConfig or X Visual that is
3625bd8deadSopenharmony_ci    "compatible" with the <config> may be used to render into the pbuffer. (See
3635bd8deadSopenharmony_ci    description of glXCreateContextWithConfigSGIX, glXMakeCurrent and
3645bd8deadSopenharmony_ci    glXMakeCurrentReadSGI for definition of "compatible".)  If a pbuffer is
3655bd8deadSopenharmony_ci    created with GLX_PRESERVED_CONTENTS_SGIX set to False, then portion of the
3665bd8deadSopenharmony_ci    buffer contents may be lost at any time due to frame buffer resource
3675bd8deadSopenharmony_ci    conflicts.  Once the contents of a "non preserved" pbuffer has been lost it
3685bd8deadSopenharmony_ci    is considered to be in a "damaged" state.  It is not an error to render to a
3695bd8deadSopenharmony_ci    pbuffer that is in this state but the effect of rendering to it is
3705bd8deadSopenharmony_ci    undefined. It is also not an error to query the pixel contents of such a
3715bd8deadSopenharmony_ci    pbuffer, but the values of the returned pixels are undefined.  Note, that
3725bd8deadSopenharmony_ci    while this specification allows for non preserved pbuffers to be damaged as
3735bd8deadSopenharmony_ci    a result of other pbuffer activity, the intent is to only have visible
3745bd8deadSopenharmony_ci    windows activity "damage" pbuffers.
3755bd8deadSopenharmony_ci
3765bd8deadSopenharmony_ci    Since the contents of a "unpreserved" pbuffer can be lost at anytime 
3775bd8deadSopenharmony_ci    with only asynchronous notification (via the "buffer clobber" event), the 
3785bd8deadSopenharmony_ci    only way a client can guarantee that valid pixels are read back with 
3795bd8deadSopenharmony_ci    glReadPixels is by grabbing the X server. (Note that this operation is 
3805bd8deadSopenharmony_ci    potentially expensive and should not be done frequently. Also, since this 
3815bd8deadSopenharmony_ci    locks out other X clients, it should only be done for short periods of 
3825bd8deadSopenharmony_ci    time.) Clients that don't wish to do this can check if the data returned 
3835bd8deadSopenharmony_ci    by glReadPixels is valid by calling XSync and then checking the event 
3845bd8deadSopenharmony_ci    queue for "buffer clobber" events (assuming that these events had been 
3855bd8deadSopenharmony_ci    pulled off of the queue prior to the glReadPixels call). 
3865bd8deadSopenharmony_ci    
3875bd8deadSopenharmony_ci    When glXCreateGLXPbufferSGIX fails to create a GLXPbuffer due to
3885bd8deadSopenharmony_ci    insufficient resources, a BadAlloc error is generated and None is
3895bd8deadSopenharmony_ci    returned. If <config> is not a valid GLXFBConfig then a GLXBadFBConfigSGIX
3905bd8deadSopenharmony_ci    error is generated; if <config> does not support GLXPbuffers then a BadMatch
3915bd8deadSopenharmony_ci    error is generated.
3925bd8deadSopenharmony_ci
3935bd8deadSopenharmony_ci    A GLXPbuffer is destroyed by calling:
3945bd8deadSopenharmony_ci
3955bd8deadSopenharmony_ci        void glXDestroyGLXPbufferSGIX(Display *dpy,
3965bd8deadSopenharmony_ci			              GLXPbuffer pbuf);
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ci    The GLXPbuffer will be destroyed once it is no longer current to any
3995bd8deadSopenharmony_ci    client. When a GLXPbuffer is destroyed, any memory resources that are
4005bd8deadSopenharmony_ci    attached to it are freed, and its XID is made available for reuse.
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ci    If <pbuf> is not a valid GLXPbuffer then a GLXBadPbufferSGIX error
4035bd8deadSopenharmony_ci    is generated.
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci    To query an attribute associated with a GLXPbuffer call
4065bd8deadSopenharmony_ci
4075bd8deadSopenharmony_ci        void glXQueryGLXPbufferSGIX(Display* dpy,
4085bd8deadSopenharmony_ci			            GLXPbuffer pbuf,
4095bd8deadSopenharmony_ci			            int attribute,
4105bd8deadSopenharmony_ci			            unsigned int *value);
4115bd8deadSopenharmony_ci
4125bd8deadSopenharmony_ci    <attribute> must be set to one of GLX_WIDTH_SGIX, GLX_HEIGHT_SGIX,
4135bd8deadSopenharmony_ci    GLX_PRESERVED_CONTENTS_SGIX, GLX_LARGEST_PBUFFER_SGIX, or
4145bd8deadSopenharmony_ci    GLX_FBCONFIG_ID_SGIX.
4155bd8deadSopenharmony_ci
4165bd8deadSopenharmony_ci    To get the GLXFBConfig for a GLXPbuffer, first retrieve the i.d.  for the
4175bd8deadSopenharmony_ci    FBConfig and then call glXChooseFBConfigSGIX.
4185bd8deadSopenharmony_ci
4195bd8deadSopenharmony_ci    If <pbuf> is not a valid GLXPbuffer then a GLXBadPbufferSGIX error is
4205bd8deadSopenharmony_ci    generated.
4215bd8deadSopenharmony_ci
4225bd8deadSopenharmony_ci
4235bd8deadSopenharmony_ci    [Add new section, Events]
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci    A client can ask to receive GLX events on a window or GLXPbuffer.
4265bd8deadSopenharmony_ci
4275bd8deadSopenharmony_ci      void glXSelectEventSGIX(Display *dpy,
4285bd8deadSopenharmony_ci	  		      GLXDrawable drawable,
4295bd8deadSopenharmony_ci			      unsigned long mask);
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci    Currently only one GLX event, GLX_BUFFER_CLOBBER_MASK_SGIX, can be selected:
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci      typdef struct {
4345bd8deadSopenharmony_ci	int event_type;	      /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
4355bd8deadSopenharmony_ci        int draw_type;        /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
4365bd8deadSopenharmony_ci	unsigned long serial; /* # of last request processed by server */
4375bd8deadSopenharmony_ci	Bool send_event;      /* event was generated by a SendEvent request */
4385bd8deadSopenharmony_ci        Display *display;     /* display the event was read from */
4395bd8deadSopenharmony_ci        GLXDrawable drawable; /* i.d. of Drawable */
4405bd8deadSopenharmony_ci        unsigned int mask;    /* mask indicating which buffers are affected*/
4415bd8deadSopenharmony_ci        int x, y;
4425bd8deadSopenharmony_ci        int width, height;
4435bd8deadSopenharmony_ci        int count;            /* if nonzero, at least this many more */
4445bd8deadSopenharmony_ci      } GLXBufferClobberEventSGIX;
4455bd8deadSopenharmony_ci
4465bd8deadSopenharmony_ci    A single X server operation can cause several "buffer clobber" events to be
4475bd8deadSopenharmony_ci    sent. (e.g., a single pbuffer may be damaged and cause multiple "buffer
4485bd8deadSopenharmony_ci    clobber" events to be generated). Each event specifies one region of the
4495bd8deadSopenharmony_ci    GLXDrawable that was affected by the X Server operation. <mask> indicates
4505bd8deadSopenharmony_ci    which color or ancillary buffers were affected. All the "buffer clobber"
4515bd8deadSopenharmony_ci    events generated by a single X server action are guaranteed to be contiguous
4525bd8deadSopenharmony_ci    in the event queue. The conditions under which this event is generated and
4535bd8deadSopenharmony_ci    the event <type> varies, depending on the type of the GLXDrawable.
4545bd8deadSopenharmony_ci
4555bd8deadSopenharmony_ci    For "preserved" pbuffers, a "buffer clobber" event, with <type>
4565bd8deadSopenharmony_ci    GLX_SAVED_SGIX, is generated whenever the contents of a pbuffer has to be
4575bd8deadSopenharmony_ci    moved to avoid being damaged.  The event(s) describes which portions of the
4585bd8deadSopenharmony_ci    pbuffer were affected. Clients who receive many "buffer clobber" events,
4595bd8deadSopenharmony_ci    referring to different save actions, should consider freeing the pbuffer
4605bd8deadSopenharmony_ci    resource in order to prevent the system from thrashing due to insufficient
4615bd8deadSopenharmony_ci    resources.
4625bd8deadSopenharmony_ci
4635bd8deadSopenharmony_ci    For an "unpreserved" pbuffer a "buffer clobber" event, with <type>
4645bd8deadSopenharmony_ci    GLX_DAMAGED_SGIX, is generated whenever a portion of the pbuffer becomes
4655bd8deadSopenharmony_ci    invalid.
4665bd8deadSopenharmony_ci
4675bd8deadSopenharmony_ci    For Windows, "buffer clobber" events, with <type> GLX_DAMAGED_SGIX or
4685bd8deadSopenharmony_ci    GLX_SAVED_SGIX, occur whenever an ancillary buffer, associated with the
4695bd8deadSopenharmony_ci    window, gets clobbered or moved out of offscreen memory. The event contains
4705bd8deadSopenharmony_ci    information indicating which color or ancillary buffers, and which
4715bd8deadSopenharmony_ci    portions of those buffers, were affected.
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ci    Calling glXSelectEventSGIX overrides any previous event mask that was set by
4745bd8deadSopenharmony_ci    the client for <drawable>. Note that a separate event mask is maintained for
4755bd8deadSopenharmony_ci    each client that requested "clobber events" for <drawable>.
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci    If <drawable> is not a valid GLXPbuffer or a valid Window, a GLXBadDrawable
4785bd8deadSopenharmony_ci    error is generated.
4795bd8deadSopenharmony_ci
4805bd8deadSopenharmony_ci    To find out which GLX events are selected for a window or GLXPbuffer call
4815bd8deadSopenharmony_ci
4825bd8deadSopenharmony_ci      void glXGetSelectedEventSGIX(Display *dpy,
4835bd8deadSopenharmony_ci	  		           GLXDrawable drawable,
4845bd8deadSopenharmony_ci			           unsigned long *mask);
4855bd8deadSopenharmony_ci
4865bd8deadSopenharmony_ci
4875bd8deadSopenharmony_ciGLX Protocol
4885bd8deadSopenharmony_ci
4895bd8deadSopenharmony_ci	Four new GLX protocol commands are added.
4905bd8deadSopenharmony_ci
4915bd8deadSopenharmony_ci	CreateGLXPbufferSGIX
4925bd8deadSopenharmony_ci	    1		CARD8		opcode (X assigned)
4935bd8deadSopenharmony_ci	    1		17		GLX opcode (glXVendorPrivateWithReply)
4945bd8deadSopenharmony_ci	    2		8 + 2n		request length
4955bd8deadSopenharmony_ci	    4		65543		vendor specific opcode
4965bd8deadSopenharmony_ci	    4				unused
4975bd8deadSopenharmony_ci	    4		CARD32		screen
4985bd8deadSopenharmony_ci	    4		GLX_FBCONFIG	fbconfig
4995bd8deadSopenharmony_ci	    4		GLX_PBUFFER	pbuffer
5005bd8deadSopenharmony_ci	    4		CARD32		width
5015bd8deadSopenharmony_ci	    4		CARD32		height
5025bd8deadSopenharmony_ci	    8 * n	LISTofATTRIB	properties
5035bd8deadSopenharmony_ci	   
5045bd8deadSopenharmony_ci	     Where n is the number of token/value pairs.  Each token value is
5055bd8deadSopenharmony_ci	     either a CARD32, BOOL32, or INT32, followed by an attribute
5065bd8deadSopenharmony_ci	     value which is also either a CARD32, BOOL32, or INT32.
5075bd8deadSopenharmony_ci
5085bd8deadSopenharmony_ci
5095bd8deadSopenharmony_ci	DestroyGLXPbufferSGIX
5105bd8deadSopenharmony_ci	    1		CARD8		opcode (X assigned)
5115bd8deadSopenharmony_ci	    1		17		GLX opcode (glXVendorPrivateWithReply)
5125bd8deadSopenharmony_ci	    2		4		request length
5135bd8deadSopenharmony_ci	    4		65544		vendor specific opcode
5145bd8deadSopenharmony_ci	    4				unused
5155bd8deadSopenharmony_ci	    4		GLX_PBUFFER	pbuffer
5165bd8deadSopenharmony_ci
5175bd8deadSopenharmony_ci	
5185bd8deadSopenharmony_ci	ChangeDrawableAttributesSGIX
5195bd8deadSopenharmony_ci	    1		CARD8		opcode (X assigned)
5205bd8deadSopenharmony_ci	    1		17		GLX opcode (glXVendorPrivateWithReply)
5215bd8deadSopenharmony_ci	    2		4 + 2*n		request length
5225bd8deadSopenharmony_ci	    4		65545		vendor specific opcode
5235bd8deadSopenharmony_ci	    4				unused
5245bd8deadSopenharmony_ci	    4		GLX_DRAWABLE	drawable
5255bd8deadSopenharmony_ci	    8 * n	LISTofATTRIB	properties
5265bd8deadSopenharmony_ci
5275bd8deadSopenharmony_ci	     Where n is the number of token/value pairs.  Each token value is
5285bd8deadSopenharmony_ci	     either a CARD32, BOOL32, or INT32, followed by an attribute
5295bd8deadSopenharmony_ci	     value which is also either a CARD32, BOOL32, or INT32.
5305bd8deadSopenharmony_ci
5315bd8deadSopenharmony_ci
5325bd8deadSopenharmony_ci	GetDrawableAttributesSGIX
5335bd8deadSopenharmony_ci	    1		CARD8		opcode (X assigned)
5345bd8deadSopenharmony_ci	    1		17		GLX opcode (glXVendorPrivateWithReply)
5355bd8deadSopenharmony_ci	    2		4 + 2n		request length
5365bd8deadSopenharmony_ci	    4		65546		vendor specific opcode
5375bd8deadSopenharmony_ci	    4				unused
5385bd8deadSopenharmony_ci	    4		GLX_DRAWABLE	drawable
5395bd8deadSopenharmony_ci	  =>
5405bd8deadSopenharmony_ci	    1		1		reply
5415bd8deadSopenharmony_ci	    1				unused
5425bd8deadSopenharmony_ci	    2		CARD16		sequence number
5435bd8deadSopenharmony_ci	    4		2*n		length
5445bd8deadSopenharmony_ci	    4		CARD32		numAttribs
5455bd8deadSopenharmony_ci	    20				unused
5465bd8deadSopenharmony_ci	    8 * n	LISTofATTRIB	properties
5475bd8deadSopenharmony_ci	
5485bd8deadSopenharmony_ci	     Where n is the number of token/value pairs.  Each token value is
5495bd8deadSopenharmony_ci	     either a CARD32, BOOL32, or INT32, followed by an attribute
5505bd8deadSopenharmony_ci	     value which is also either a CARD32, BOOL32, or INT32.
5515bd8deadSopenharmony_ci
5525bd8deadSopenharmony_ci    One new event is added:
5535bd8deadSopenharmony_ci
5545bd8deadSopenharmony_ci	BEC is the base event code for the extension, as returned by
5555bd8deadSopenharmony_ci	XQueryExtension.
5565bd8deadSopenharmony_ci
5575bd8deadSopenharmony_ci	GLX_BUFFER_CLOBBER_MASK_SGIX
5585bd8deadSopenharmony_ci	    1		BEC+16		code
5595bd8deadSopenharmony_ci	    1				unused
5605bd8deadSopenharmony_ci	    2		CARD16		sequence number
5615bd8deadSopenharmony_ci	    2		CARD16		event_type
5625bd8deadSopenharmony_ci			0x8017		GLX_DAMAGED_SGIX
5635bd8deadSopenharmony_ci			0x8018		GLX_SAVED_SGIX
5645bd8deadSopenharmony_ci	    2		CARD16		draw_type
5655bd8deadSopenharmony_ci			0x8019		GLX_WINDOW_SGIX
5665bd8deadSopenharmony_ci                        0x801A		GLX_PBUFFER_SGIX
5675bd8deadSopenharmony_ci	    4		GLX_DRAWABLE    drawable
5685bd8deadSopenharmony_ci            4		BITFIELD	mask
5695bd8deadSopenharmony_ci	    2		CARD16		x
5705bd8deadSopenharmony_ci	    2		CARD16		y
5715bd8deadSopenharmony_ci	    2		CARD16		width
5725bd8deadSopenharmony_ci	    2		CARD16		height
5735bd8deadSopenharmony_ci	    2		CARD16		count
5745bd8deadSopenharmony_ci	    6				unused
5755bd8deadSopenharmony_ci
5765bd8deadSopenharmony_ciDependencies on SGIS_multisample
5775bd8deadSopenharmony_ci
5785bd8deadSopenharmony_ci    If SGIS_multisample is not supported, references to
5795bd8deadSopenharmony_ci    GLX_SAMPLE_BUFFERS_BIT_SGIX in this document are invalid and should be
5805bd8deadSopenharmony_ci    ignored.
5815bd8deadSopenharmony_ci
5825bd8deadSopenharmony_ciErrors
5835bd8deadSopenharmony_ci
5845bd8deadSopenharmony_ci    One new GLX errors is introduced:
5855bd8deadSopenharmony_ci
5865bd8deadSopenharmony_ci        GLXBadPbufferSGIX
5875bd8deadSopenharmony_ci
5885bd8deadSopenharmony_ciNew State
5895bd8deadSopenharmony_ci
5905bd8deadSopenharmony_ci    None
5915bd8deadSopenharmony_ci
5925bd8deadSopenharmony_ciNew Implementation Dependent State
5935bd8deadSopenharmony_ci
5945bd8deadSopenharmony_ci    None
5955bd8deadSopenharmony_ci
5965bd8deadSopenharmony_ciRevision History
5975bd8deadSopenharmony_ci
5985bd8deadSopenharmony_ci    Version 1.29, 2009/11/19 - clarify that BEC in the
5995bd8deadSopenharmony_ci    GLX_BUFFER_CLOBBER_MASK_SGIX event protocol is returned from
6005bd8deadSopenharmony_ci    XQueryExtension, matching the GLX_ARB_create_context spec language.
6015bd8deadSopenharmony_ci
6025bd8deadSopenharmony_ci    Version 1.28, 1997/03/20 - final spec as shipped by SGI.
603