1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glXSelectEvent">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glXSelectEvent
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glXSelectEvent
</refname>
17 <refpurpose>select GLX events for a window or a GLX pixel buffer
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glXSelectEvent
</function></funcdef>
23 <paramdef>Display *
<parameter>dpy
</parameter></paramdef>
24 <paramdef>GLXDrawable
<parameter>draw
</parameter></paramdef>
25 <paramdef>unsigned long
<parameter>event_mask
</parameter></paramdef>
29 <refsect1 id=
"parameters"><title>Parameters
</title>
32 <term><parameter>dpy
</parameter></term>
35 Specifies the connection to the X server.
40 <term><parameter>draw
</parameter></term>
43 Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
48 <term><parameter>event_mask
</parameter></term>
51 Specifies the events to be returned for
<parameter>draw
</parameter>.
57 <refsect1 id=
"description"><title>Description
</title>
59 <function>glXSelectEvent
</function> sets the GLX event mask for a GLX pixel buffer or a window.
60 Calling
<function>glXSelectEvent
</function> overrides any previous event mask that was
61 set by the client for
<parameter>draw
</parameter>. Note that it does not affect the
62 event masks that other clients may have specified for
<parameter>draw
</parameter> since
63 each client rendering to
<parameter>draw
</parameter> has a separate event mask for it.
66 Currently, only one GLX event,
<constant>GLX_PBUFFER_CLOBBER_MASK
</constant>,
67 can be selected. The following data is returned to the client when a
68 <constant>GLX_PBUFFER_CLOBBER_MASK
</constant> event occurs:
73 <informaltable frame=
"topbot">
74 <tgroup cols=
"2" align=
"left">
80 int
<emphasis>event_type
</emphasis>;
83 /* GLX_DAMAGED or GLX_SAVED */
88 int
<emphasis>draw_type
</emphasis>;
91 /* GLX_WINDOW or GLX_PBUFFER */
96 unsigned long
<emphasis>serial
</emphasis>;
99 /* # of last request processed by server */
104 Bool
<emphasis>send_event
</emphasis>;
107 /* true if this came for SendEvent request */
112 Display
<emphasis>*display
</emphasis>;
115 /* display the event was read from */
120 GLXDrawable
<emphasis>drawable
</emphasis>;
123 /* i.d. of Drawable */
128 unsigned int
<emphasis>buffer_mask
</emphasis>;
131 /* mask indicating affected buffers */
136 int
<emphasis>x, y
</emphasis>;
144 int
<emphasis>width, height
</emphasis>;
152 int
<emphasis>count
</emphasis>;
155 /* if nonzero, at least this many more */
162 } GLXPbufferClobberEvent;
163 The valid bit masks used in
<emphasis>buffer_mask
</emphasis> are:
167 <informaltable frame=
"topbot">
168 <tgroup cols=
"2" align=
"left">
173 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
176 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
184 <constant>GLX_FRONT_LEFT_BUFFER_BIT
</constant>
187 Front left color buffer
192 <constant>GLX_FRONT_RIGHT_BUFFER_BIT
</constant>
195 Front right color buffer
200 <constant>GLX_BACK_LEFT_BUFFER_BIT
</constant>
203 Back left color buffer
208 <constant>GLX_BACK_RIGHT_BUFFER_BIT
</constant>
211 Back right color buffer
216 <constant>GLX_AUX_BUFFERS_BIT
</constant>
224 <constant>GLX_DEPTH_BUFFER_BIT
</constant>
232 <constant>GLX_STENCIL_BUFFER_BIT
</constant>
240 <constant>GLX_ACCUM_BUFFER_BIT
</constant>
250 A single X server operation can cause several buffer clobber events to be
251 sent. (e.g., a single GLX pixel buffer may be damaged and cause multiple
252 buffer clobber events to be generated). Each event specifies one
253 region of the GLX drawable that was affected by the X Server operation.
254 The
<emphasis>buffer_mask
</emphasis> field indicates which color buffers and
255 ancillary buffers were affected. All the buffer clobber events
256 generated by a single X server action are guaranteed to be
257 contiguous in the event queue. The conditions under which this event is
258 generated and the
<emphasis>event_type
</emphasis> varies, depending on the type of the
262 When the
<constant>GLX_AUX_BUFFERS_BIT
</constant> is set in
<emphasis>buffer_mask
</emphasis>, then
263 <emphasis>aux_buffer
</emphasis> is set to indicate which buffer was affected. If more
264 than one aux buffer was affected, then additional events are
265 generated as part of the same contiguous event group. Each
266 additional event will have only the
<constant>GLX_AUX_BUFFERS_BIT
</constant> set in
267 <emphasis>buffer_mask
</emphasis>, and the
<emphasis>aux_buffer
</emphasis> field will be set
268 appropriately. For nonstereo drawables,
269 <constant>GLX_FRONT_LEFT_BUFFER_BIT
</constant> and
<constant>GLX_BACK_LEFT_BUFFER_BIT
</constant> are
270 used to specify the front and back color buffers.
273 For preserved GLX pixel buffers, a buffer clobber event with
274 type
<constant>GLX_SAVED
</constant> is generated whenever the contents of the
275 GLX pixel buffer is moved out of offscreen memory. The event(s) describes which
276 portions of the GLX pixel buffer were affected. Clients who receive many
277 buffer clobber events, referring to different save actions,
278 should consider freeing the GLX pixel buffer resource in order to prevent
279 the system from thrashing due to insufficient resources.
282 For an unpreserved GLXPbuffer, a buffer clobber event, with type
283 <constant>GLX_DAMAGED
</constant>, is generated whenever a portion of the GLX pixel buffer
284 becomes invalid. The client may wish to regenerate the invalid portions
285 of the GLX pixel buffer.
288 For Windows, buffer clobber events, with type
<constant>GLX_SAVED
</constant>, occur
289 whenever an ancillary buffer, associated with the window, gets clobbered
290 or moved out of off-screen memory. The event contains information
291 indicating which color buffers and ancillary buffers\(emand which portions
292 of those buffers\(emwere affected.
295 <refsect1 id=
"notes"><title>Notes
</title>
297 <function>glXSelectEvent
</function> is available only if the GLX version is
1.3 or greater.
300 If the GLX version is
1.1 or
1.0, the GL version must be
1.0.
301 If the GLX version is
1.2, then the GL version must be
1.1.
302 If the GLX version is
1.3, then the GL version must be
1.2.
305 <refsect1 id=
"errors"><title>Errors
</title>
307 <constant>GLXBadDrawable
</constant> is generated if
<parameter>draw
</parameter> is not a valid window
308 or a valid GLX pixel buffer.
311 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
313 <citerefentry><refentrytitle>glXGetSelectedEvent
</refentrytitle></citerefentry>
316 <refsect1 id=
"seealso"><title>See Also
</title>
318 <citerefentry><refentrytitle>glXCreatePbuffer
</refentrytitle></citerefentry>
321 <refsect1 id=
"Copyright"><title>Copyright
</title>
323 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
324 Silicon Graphics, Inc. This document is licensed under the SGI
325 Free Software B License. For details, see
326 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.