• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    SGI_make_current_read
4
5Name Strings
6
7    GLX_SGI_make_current_read
8
9Version
10
11    $Date: 1997/03/20 02:19:19 $ $$
12
13Number
14
15    42
16
17Dependencies
18
19    EXT_copy_texture is affected by this specification.
20    EXT_convolution is affected by this specification.
21    SGI_color_table is affected by this specification.
22
23Overview
24
25    The association of the current context with a drawable is extended to allow
26    separate write and read drawables.  This paves the way for allowing
27    preprocessing of image data in an "off screen" window which is then read
28    into the visible window for final display.  Similarly it sets the
29    frame-work for direct transfer of video to the GL, by treating the video
30    as a special kind of read drawable (a.k.a, readable).
31
32
33New Procedures and Functions
34
35    Bool glXMakeCurrentReadSGI(Display* dpy,
36			       GLXDrawable draw,
37			       GLXDrawable read,
38			       GLXContext ctx);
39
40    GLXDrawable glXGetCurrentReadDrawableSGI(void);
41
42New Tokens
43
44    None
45
46Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
47
48    None
49
50Additions to Chapter 3 of the 1.0 Specification (Rasterization)
51
52    None
53
54Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
55and the Frame buffer)
56
57    If glXMakeCurrentReadSGI is used to associate two glXDrawables with
58    the current rendering context, glXDrawable <draw> is used for all
59    OpenGL operations except:
60
61    1.	Any pixel data that are sourced based on the value of READ_BUFFER.
62        Note, that accumulation operations use the value of READ_BUFFER, but
63	are not allowed when <draw> in not identical to <read>.
64
65    2.	Any depth values that are retrieved by glReadPixels, glCopyPixels,
66	or any OpenGL extension that sources depth images from the frame
67	buffer in the manner of glReadPixels and glCopyPixels.
68
69    3.	Any stencil values that are retrieved by glReadPixels, glCopyPixels,
70	or any OpenGL extension that sources stencil images from the frame
71	buffer in the manner of glReadPixels and glCopyPixels.
72
73    These frame buffer values are taken from glXDrawable <read>.
74
75    No error will be generated if the value of READ_BUFFER at the time the
76    glXMakeCurrentReadSGI call is made does not correspond to a valid color
77    buffer in <read>.  Also, no error due to READ_BUFFER mismatch will be
78    generated by subsequent calls to any of the operations enumerated above,
79    but the pixels values used will be undefined until READ_BUFFER is set to a
80    color buffer that is valid in the <read>.  Operations that query the value
81    of READ_BUFFER (i.e., glGet, glPushAttrib) use the value set last in the
82    context, independent of whether it is a valid buffer in <read>.
83    Subsequent to a glXMakeCurrentRead call, it is possible that the
84    READ_BUFFER may be set to a color buffer that is not valid with respect to
85    the visual of the context.  The preceding discussion also applies to
86    glXMakeCurrent where <read> is replaced by the single drawable parameter
87    to the call.
88
89    Error conditions set by glDrawBuffer (even when called implicitly via
90    glPopAttrib) and by the operations enumerated above are with respect to
91    color and ancillary buffers available in <read> (i.e.,
92    glReadBuffer(GL_BACK_BUFFER) will generate an error when <read> is single
93    buffered, and so will an operation that tries to source stencil images
94    when <read> does not have a stencil buffer).
95
96    The following restriction is added to the end of the introductory
97    paragraph of section 4.2.4 "The Accumulation Buffer": Accumulation
98    operations are only allowed when the glXDrawbles <write> and <draw> are
99    identical.
100
101    The list of error conditions at the end of section 4.2.4 "The Accumulation
102    Buffer" is modified to: If there is no accumulation buffer, the GL is in
103    color index mode, or if the glXDrawbles <write> and <read> are not
104    identical then Accum generates the error INVALID_OPERATION.
105
106Additions to Chapter 5 of the 1.0 Specification (Special Functions)
107
108    None
109
110Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
111
112    None
113
114Additions to the GLX Specification
115
116    XXX - not complete yet
117
118    Notes:
119
120    *	glXMakeCurrentReadSGIX associates two GLXDrawables with a single
121	GLXContext.  BadMatch is generated if <draw> was not created with
122	the same X screen and visual as <ctx>.  BadMatch is also generated
123	if <read> was not created with the same X screen as <ctx>.  The color,
124	depth, stencil, and accumulation buffers of <read> need not match the
125	resources of <draw>.
126
127    *	glXMakeCurrentReadSGI returns True if it succeeds, and False if it
128	fails.  It can fail for myriad reasons, including refusal to accept
129	a window or a GLXPixmap as the <read> GLXDrawable, and refusal to
130	accept as the <read> a GLXDrawable or a GLXPbuffer with color, depth,
131	stencil, or accumulation storage facilities that differ from those
132	of <draw>.  This laxness may not be acceptable in a final
133	specification, but it will help allow early implementations to
134	be completed.
135
136    *   glXMakeCurrentReadSGI may return False if <draw> and <read> cannot
137        exist in framebuffer memory simultaneously.
138
139    *	glXGetCurrentReadDrawableSGI returns the name of the GLXDrawable
140	currently being used as a pixel query source.  If glXMakeCurrent
141	specified the current rendering context, then
142	glXGetCurrentReadDrawableSGI returns the drawable specified as
143	<draw> by that glXMakeCurrent call.  If glXMakeCurrentReadSGI
144	specified the current rendering context, then
145	glXGetCurrentReadDrawableSGI returns the drawable specified as
146	<read> by that glXMakeCurrentReadSGI call.  If there is no
147	current read drawable, None is returned.
148
149GLX Protocol
150
151	One new GLX protocol command is added.
152
153	MakeCurrentRead
154	    1		CARD8		opcode (X assigned)
155	    1		17		GLX opcode (glXVendorPrivateWithReply)
156	    2		6		request length
157	    4		65537		vendor specific opcode
158	    4		GLX_CONTEXT_TAG	old context tag
159	    4		GLX_DRAWABLE	drawable
160	    4		GLX_DRAWABLE	read drawable
161	    4		GLX_CONTEXT	context id
162	   =>
163	    1		1		Reply
164	    1				unused
165	    2		CARD16		sequence number
166	    24				unused
167
168Dependencies on EXT_copy_texture
169
170    Texture image data are sourced from GLXDrawable <read> if the
171    current OpenGL rendering context was specified by glXMakeCurrentReadSGIX.
172
173Dependencies on EXT_convolution
174
175    Convolution image data are sourced from GLXDrawable <read> if the
176    current OpenGL rendering context was specified by glXMakeCurrentReadSGIX,
177    and the transfer is specified by CopyConvolutionFilter1DEXT or
178    CopyConvolutionFilter2DEXT.
179
180Dependencies on SGI_color_table
181
182    Color table data are sourced from GLXDrawable <read> if the current
183    OpenGL rendering context was specified by glXMakeCurrentReadSGIX,
184    and the transfer is specified by CopyColorTableSGI.
185
186New State
187
188    None
189
190New Implementation Dependent State
191
192   None
193