<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"><!-- saved from url=(0013)about:internet -->
<?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.78.1" /></head><body><div class="refentry"><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" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glXSelectEvent</strong>(</code></td><td>Display * <var class="pdparam">dpy</var>, </td></tr><tr><td> </td><td>GLXDrawable <var class="pdparam">draw</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">event_mask</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>dpy</code></em></span></dt><dd><p>
                    Specifies the connection to the X server. 
                </p></dd><dt><span class="term"><em class="parameter"><code>draw</code></em></span></dt><dd><p>
                    Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
                </p></dd><dt><span class="term"><em class="parameter"><code>event_mask</code></em></span></dt><dd><p>
                    Specifies the events to be returned for <em class="parameter"><code>draw</code></em>.
                </p></dd></dl></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glXSelectEvent</code> sets the GLX event mask for a GLX pixel buffer or a window. 
            Calling <code class="function">glXSelectEvent</code> overrides any previous event mask that was
            set by the client for <em class="parameter"><code>draw</code></em>. Note that it does not affect the
            event masks that other clients may have specified for <em class="parameter"><code>draw</code></em> since
            each client rendering to <em class="parameter"><code>draw</code></em> has a separate event mask for it.
        </p><p>
            Currently, only one GLX event, <code class="constant">GLX_PBUFFER_CLOBBER_MASK</code>, 
            can be selected. The following data is returned to the client when a
            <code class="constant">GLX_PBUFFER_CLOBBER_MASK</code> event occurs:
        </p><p>
            typedef struct {
        </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">
                            int <span class="emphasis"><em>event_type</em></span>;
                        </td><td align="left">
                        /* GLX_DAMAGED or GLX_SAVED */
                        </td></tr><tr><td align="left">
                            int <span class="emphasis"><em>draw_type</em></span>;
                        </td><td align="left">
                        /* GLX_WINDOW or GLX_PBUFFER */
                        </td></tr><tr><td align="left">
                            unsigned long <span class="emphasis"><em>serial</em></span>;
                        </td><td align="left">
                        /* # of last request processed by server */
                        </td></tr><tr><td align="left">
                            Bool <span class="emphasis"><em>send_event</em></span>;
                        </td><td align="left">
                        /* true if this came for SendEvent request */
                        </td></tr><tr><td align="left">
                            Display <span class="emphasis"><em>*display</em></span>;
                        </td><td align="left">
                        /* display the event was read from */
                        </td></tr><tr><td align="left">
                            GLXDrawable <span class="emphasis"><em>drawable</em></span>;
                        </td><td align="left">
                        /* i.d. of Drawable */
                        </td></tr><tr><td align="left">
                            unsigned int <span class="emphasis"><em>buffer_mask</em></span>;
                        </td><td align="left">
                        /* mask indicating affected buffers */
                        </td></tr><tr><td align="left">
                            int <span class="emphasis"><em>x, y</em></span>;
                        </td><td align="left">
                         
                        </td></tr><tr><td align="left">
                            int <span class="emphasis"><em>width, height</em></span>;
                        </td><td align="left">
                         
                        </td></tr><tr><td align="left">
                            int <span class="emphasis"><em>count</em></span>;
                        </td><td align="left">
                        /* if nonzero, at least this many more */
                        </td></tr></tbody></table></div><p>
            } GLXPbufferClobberEvent;
            The valid bit masks used in <span class="emphasis"><em>buffer_mask</em></span> are:
        </p><p>
        </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
                        Bitmask
                        </strong></span></th><th align="left"><span class="bold"><strong>
                        Corresponding Buffer
                        </strong></span></th></tr></thead><tbody><tr><td align="left">
                        <code class="constant">GLX_FRONT_LEFT_BUFFER_BIT</code>
                        </td><td align="left">
                        Front left color buffer
                        </td></tr><tr><td align="left">
                        <code class="constant">GLX_FRONT_RIGHT_BUFFER_BIT</code>
                        </td><td align="left">
                        Front right color buffer
                        </td></tr><tr><td align="left">
                        <code class="constant">GLX_BACK_LEFT_BUFFER_BIT</code>
                        </td><td align="left">
                        Back left color buffer
                        </td></tr><tr><td align="left">
                        <code class="constant">GLX_BACK_RIGHT_BUFFER_BIT</code>
                        </td><td align="left">
                        Back right color buffer
                        </td></tr><tr><td align="left">
                        <code class="constant">GLX_AUX_BUFFERS_BIT</code>
                        </td><td align="left">
                        Auxiliary buffer
                        </td></tr><tr><td align="left">
                        <code class="constant">GLX_DEPTH_BUFFER_BIT</code>
                        </td><td align="left">
                        Depth buffer
                        </td></tr><tr><td align="left">
                        <code class="constant">GLX_STENCIL_BUFFER_BIT</code>
                        </td><td align="left">
                        Stencil buffer
                        </td></tr><tr><td align="left">
                        <code class="constant">GLX_ACCUM_BUFFER_BIT</code>
                        </td><td align="left">
                        Accumulation buffer
                        </td></tr></tbody></table></div><p>
            A single X server operation can cause several buffer clobber events to be
            sent. (e.g., a single GLX pixel buffer may be damaged and cause multiple 
            buffer clobber events to be generated). Each event specifies one 
            region of the GLX drawable that was affected by the X Server operation. 
            The <span class="emphasis"><em>buffer_mask</em></span> field indicates which color buffers and 
            ancillary buffers were affected. All the buffer clobber events 
            generated by a single X server action are guaranteed to be
            contiguous in the event queue. The conditions under which this event is
            generated and the <span class="emphasis"><em>event_type</em></span> varies, depending on the type of the
            GLX drawable.
        </p><p>
            When the <code class="constant">GLX_AUX_BUFFERS_BIT</code> is set in <span class="emphasis"><em>buffer_mask</em></span>, then
            <span class="emphasis"><em>aux_buffer</em></span> is set to indicate which buffer was affected. If more
            than one aux buffer was affected, then additional events are
            generated as part of the same contiguous event group. Each
            additional event will have only the <code class="constant">GLX_AUX_BUFFERS_BIT</code> set in 
            <span class="emphasis"><em>buffer_mask</em></span>, and the <span class="emphasis"><em>aux_buffer</em></span> field will be set
            appropriately. For nonstereo drawables,
            <code class="constant">GLX_FRONT_LEFT_BUFFER_BIT</code> and <code class="constant">GLX_BACK_LEFT_BUFFER_BIT</code> are 
            used to specify the front and back color buffers.
        </p><p>
            For preserved GLX pixel buffers, a buffer clobber event with 
            type <code class="constant">GLX_SAVED</code> is generated whenever the contents of the 
            GLX pixel buffer is moved out of offscreen memory. The event(s) describes which
            portions of the GLX pixel buffer were affected. Clients who receive many
            buffer clobber events, referring to different save actions,
            should consider freeing the GLX pixel buffer resource in order to prevent
            the system from thrashing due to insufficient resources.
        </p><p>
            For an unpreserved GLXPbuffer, a buffer clobber event, with type
            <code class="constant">GLX_DAMAGED</code>, is generated whenever a portion of the GLX pixel buffer
            becomes invalid. The client may wish to regenerate the invalid portions
            of the GLX pixel buffer.
        </p><p>
            For Windows, buffer clobber events, with type <code class="constant">GLX_SAVED</code>, occur
            whenever an ancillary buffer, associated with the window, gets clobbered
            or moved out of off-screen memory. The event contains information
            indicating which color buffers and ancillary buffers\(emand which portions
            of those buffers\(emwere affected.
        </p></div><div class="refsect1"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glXSelectEvent</code> is available only if the GLX version is 1.3 or greater.
        </p><p>
            If the GLX version is 1.1 or 1.0, the GL version must be 1.0.
            If the GLX version is 1.2, then the GL version must be 1.1.
            If the GLX version is 1.3, then the GL version must be 1.2.
        </p></div><div class="refsect1"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GLXBadDrawable</code> is generated if <em class="parameter"><code>draw</code></em> is not a valid window
            or a valid GLX pixel buffer. 
        </p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a class="citerefentry" href="glXGetSelectedEvent.xml"><span class="citerefentry"><span class="refentrytitle">glXGetSelectedEvent</span></span></a>
        </p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glXCreatePbuffer.xml"><span class="citerefentry"><span class="refentrytitle">glXCreatePbuffer</span></span></a>
        </p></div><div class="refsect1"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></body></html>