Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glXSelectEvent</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glXSelectEvent"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glXSelectEvent — select GLX events for a window or a GLX pixel buffer</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glXSelectEvent</b>(</code></td><td>Display * </td><td><var class="pdparam">dpy</var>, </td></tr><tr><td> </td><td>GLXDrawable </td><td><var class="pdparam">draw</var>, </td></tr><tr><td> </td><td>unsigned long </td><td><var class="pdparam">event_mask</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>dpy</code></em></span></dt><dd><p> | |
4 | Specifies the connection to the X server. | |
5 | </p></dd><dt><span class="term"><em class="parameter"><code>draw</code></em></span></dt><dd><p> | |
6 | Specifies a GLX drawable. Must be a GLX pixel buffer or a window. | |
7 | </p></dd><dt><span class="term"><em class="parameter"><code>event_mask</code></em></span></dt><dd><p> | |
8 | Specifies the events to be returned for <em class="parameter"><code>draw</code></em>. | |
9 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
10 | <code class="function">glXSelectEvent</code> sets the GLX event mask for a GLX pixel buffer or a window. | |
11 | Calling <code class="function">glXSelectEvent</code> overrides any previous event mask that was | |
12 | set by the client for <em class="parameter"><code>draw</code></em>. Note that it does not affect the | |
13 | event masks that other clients may have specified for <em class="parameter"><code>draw</code></em> since | |
14 | each client rendering to <em class="parameter"><code>draw</code></em> has a separate event mask for it. | |
15 | </p><p> | |
16 | Currently, only one GLX event, <code class="constant">GLX_PBUFFER_CLOBBER_MASK</code>, | |
17 | can be selected. The following data is returned to the client when a | |
18 | <code class="constant">GLX_PBUFFER_CLOBBER_MASK</code> event occurs: | |
19 | </p><p> | |
20 | typedef struct { | |
21 | </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"> | |
22 | int <span class="emphasis"><em>event_type</em></span>; | |
23 | </td><td align="left"> | |
24 | /* GLX_DAMAGED or GLX_SAVED */ | |
25 | </td></tr><tr><td align="left"> | |
26 | int <span class="emphasis"><em>draw_type</em></span>; | |
27 | </td><td align="left"> | |
28 | /* GLX_WINDOW or GLX_PBUFFER */ | |
29 | </td></tr><tr><td align="left"> | |
30 | unsigned long <span class="emphasis"><em>serial</em></span>; | |
31 | </td><td align="left"> | |
32 | /* # of last request processed by server */ | |
33 | </td></tr><tr><td align="left"> | |
34 | Bool <span class="emphasis"><em>send_event</em></span>; | |
35 | </td><td align="left"> | |
36 | /* true if this came for SendEvent request */ | |
37 | </td></tr><tr><td align="left"> | |
38 | Display <span class="emphasis"><em>*display</em></span>; | |
39 | </td><td align="left"> | |
40 | /* display the event was read from */ | |
41 | </td></tr><tr><td align="left"> | |
42 | GLXDrawable <span class="emphasis"><em>drawable</em></span>; | |
43 | </td><td align="left"> | |
44 | /* i.d. of Drawable */ | |
45 | </td></tr><tr><td align="left"> | |
46 | unsigned int <span class="emphasis"><em>buffer_mask</em></span>; | |
47 | </td><td align="left"> | |
48 | /* mask indicating affected buffers */ | |
49 | </td></tr><tr><td align="left"> | |
50 | int <span class="emphasis"><em>x, y</em></span>; | |
51 | </td><td align="left"> | |
52 | ||
53 | </td></tr><tr><td align="left"> | |
54 | int <span class="emphasis"><em>width, height</em></span>; | |
55 | </td><td align="left"> | |
56 | ||
57 | </td></tr><tr><td align="left"> | |
58 | int <span class="emphasis"><em>count</em></span>; | |
59 | </td><td align="left"> | |
60 | /* if nonzero, at least this many more */ | |
61 | </td></tr></tbody></table></div><p> | |
62 | } GLXPbufferClobberEvent; | |
63 | The valid bit masks used in <span class="emphasis"><em>buffer_mask</em></span> are: | |
64 | </p><p> | |
65 | </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong> | |
66 | Bitmask | |
67 | </strong></span></th><th align="left"><span class="bold"><strong> | |
68 | Corresponding Buffer | |
69 | </strong></span></th></tr></thead><tbody><tr><td align="left"> | |
70 | <code class="constant">GLX_FRONT_LEFT_BUFFER_BIT</code> | |
71 | </td><td align="left"> | |
72 | Front left color buffer | |
73 | </td></tr><tr><td align="left"> | |
74 | <code class="constant">GLX_FRONT_RIGHT_BUFFER_BIT</code> | |
75 | </td><td align="left"> | |
76 | Front right color buffer | |
77 | </td></tr><tr><td align="left"> | |
78 | <code class="constant">GLX_BACK_LEFT_BUFFER_BIT</code> | |
79 | </td><td align="left"> | |
80 | Back left color buffer | |
81 | </td></tr><tr><td align="left"> | |
82 | <code class="constant">GLX_BACK_RIGHT_BUFFER_BIT</code> | |
83 | </td><td align="left"> | |
84 | Back right color buffer | |
85 | </td></tr><tr><td align="left"> | |
86 | <code class="constant">GLX_AUX_BUFFERS_BIT</code> | |
87 | </td><td align="left"> | |
88 | Auxiliary buffer | |
89 | </td></tr><tr><td align="left"> | |
90 | <code class="constant">GLX_DEPTH_BUFFER_BIT</code> | |
91 | </td><td align="left"> | |
92 | Depth buffer | |
93 | </td></tr><tr><td align="left"> | |
94 | <code class="constant">GLX_STENCIL_BUFFER_BIT</code> | |
95 | </td><td align="left"> | |
96 | Stencil buffer | |
97 | </td></tr><tr><td align="left"> | |
98 | <code class="constant">GLX_ACCUM_BUFFER_BIT</code> | |
99 | </td><td align="left"> | |
100 | Accumulation buffer | |
101 | </td></tr></tbody></table></div><p> | |
102 | A single X server operation can cause several buffer clobber events to be | |
103 | sent. (e.g., a single GLX pixel buffer may be damaged and cause multiple | |
104 | buffer clobber events to be generated). Each event specifies one | |
105 | region of the GLX drawable that was affected by the X Server operation. | |
106 | The <span class="emphasis"><em>buffer_mask</em></span> field indicates which color buffers and | |
107 | ancillary buffers were affected. All the buffer clobber events | |
108 | generated by a single X server action are guaranteed to be | |
109 | contiguous in the event queue. The conditions under which this event is | |
110 | generated and the <span class="emphasis"><em>event_type</em></span> varies, depending on the type of the | |
111 | GLX drawable. | |
112 | </p><p> | |
113 | When the <code class="constant">GLX_AUX_BUFFERS_BIT</code> is set in <span class="emphasis"><em>buffer_mask</em></span>, then | |
114 | <span class="emphasis"><em>aux_buffer</em></span> is set to indicate which buffer was affected. If more | |
115 | than one aux buffer was affected, then additional events are | |
116 | generated as part of the same contiguous event group. Each | |
117 | additional event will have only the <code class="constant">GLX_AUX_BUFFERS_BIT</code> set in | |
118 | <span class="emphasis"><em>buffer_mask</em></span>, and the <span class="emphasis"><em>aux_buffer</em></span> field will be set | |
119 | appropriately. For nonstereo drawables, | |
120 | <code class="constant">GLX_FRONT_LEFT_BUFFER_BIT</code> and <code class="constant">GLX_BACK_LEFT_BUFFER_BIT</code> are | |
121 | used to specify the front and back color buffers. | |
122 | </p><p> | |
123 | For preserved GLX pixel buffers, a buffer clobber event with | |
124 | type <code class="constant">GLX_SAVED</code> is generated whenever the contents of the | |
125 | GLX pixel buffer is moved out of offscreen memory. The event(s) describes which | |
126 | portions of the GLX pixel buffer were affected. Clients who receive many | |
127 | buffer clobber events, referring to different save actions, | |
128 | should consider freeing the GLX pixel buffer resource in order to prevent | |
129 | the system from thrashing due to insufficient resources. | |
130 | </p><p> | |
131 | For an unpreserved GLXPbuffer, a buffer clobber event, with type | |
132 | <code class="constant">GLX_DAMAGED</code>, is generated whenever a portion of the GLX pixel buffer | |
133 | becomes invalid. The client may wish to regenerate the invalid portions | |
134 | of the GLX pixel buffer. | |
135 | </p><p> | |
136 | For Windows, buffer clobber events, with type <code class="constant">GLX_SAVED</code>, occur | |
137 | whenever an ancillary buffer, associated with the window, gets clobbered | |
138 | or moved out of off-screen memory. The event contains information | |
139 | indicating which color buffers and ancillary buffers\(emand which portions | |
140 | of those buffers\(emwere affected. | |
141 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
142 | <code class="function">glXSelectEvent</code> is available only if the GLX version is 1.3 or greater. | |
143 | </p><p> | |
144 | If the GLX version is 1.1 or 1.0, the GL version must be 1.0. | |
145 | If the GLX version is 1.2, then the GL version must be 1.1. | |
146 | If the GLX version is 1.3, then the GL version must be 1.2. | |
147 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
148 | <code class="constant">GLXBadDrawable</code> is generated if <em class="parameter"><code>draw</code></em> is not a valid window | |
149 | or a valid GLX pixel buffer. | |
150 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
151 | <a class="citerefentry" href="glXGetSelectedEvent.xml"><span class="citerefentry"><span class="refentrytitle">glXGetSelectedEvent</span></span></a> | |
152 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
153 | <a class="citerefentry" href="glXCreatePbuffer.xml"><span class="citerefentry"><span class="refentrytitle">glXCreatePbuffer</span></span></a> | |
154 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
155 | Copyright <span class="trademark"></span>© 1991-2006 | |
156 | Silicon Graphics, Inc. This document is licensed under the SGI | |
157 | Free Software B License. For details, see | |
158 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
159 | </p></div></div></body></html> |