_C_ License Applicability. Except to the extent portions of this file are _C_ made subject to an alternative license as permitted in the SGI Free _C_ Software License B, Version 1.1 (the "License"), the contents of this _C_ file are subject only to the provisions of the License. You may not use _C_ this file except in compliance with the License. You may obtain a copy _C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 _C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: _C_ _C_ http://oss.sgi.com/projects/FreeB _C_ _C_ Note that, as provided in the License, the Software is distributed on an _C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS _C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND _C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A _C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT. _C_ _C_ Original Code. The Original Code is: OpenGL Sample Implementation, _C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, _C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. _C_ Copyright in any portions created by third parties is as indicated _C_ elsewhere herein. All Rights Reserved. _C_ _C_ Additional Notice Provisions: The application programming interfaces _C_ established by SGI in conjunction with the Original Code are The _C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released _C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version _C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X _C_ Window System(R) (Version 1.3), released October 19, 1998. This software _C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation _C_ published by SGI, but has not been independently verified as being _C_ compliant with the OpenGL(R) version 1.2.1 Specification. _C_ _C_ The first character in this file must be an '_'! _C_ Anything on a line after _C_ is ignored _define(_filters,eqn)_C_ _C_ eqn is automatically replaced with neqn for nroff _header(SelectBuffer,establish a buffer for selection mode values) _names(SelectBuffer) .SH PARAMETERS _phead(_param1) Specifies the size of _param2. _phead(_param2) Returns the selection data. .SH DESCRIPTION _cmnd has two arguments: _param2 is a pointer to an array of unsigned integers, and _param1 indicates the size of the array. _param2 returns values from the name stack (see _cmnd(InitNames), _cmnd(LoadName), _cmnd(PushName)) when the rendering mode is _const(SELECT) (see _cmnd(RenderMode)). _cmnd must be issued before selection mode is enabled, and it must not be issued while the rendering mode is _const(SELECT). .P A programmer can use selection to determine which primitives are drawn into some region of a window. The region is defined by the current modelview and perspective matrices. .P In selection mode, no pixel fragments are produced from rasterization. Instead, if a primitive or a raster position intersects the clipping volume defined by the viewing frustum and the user-defined clipping planes, this primitive causes a selection hit. (With polygons, no hit occurs if the polygon is culled.) When a change is made to the name stack, or when _cmnd(RenderMode) is called, a hit record is copied to _param2 if any hits have occurred since the last such event (name stack change or _cmnd(RenderMode) call). The hit record consists of the number of names in the name stack at the time of the event, followed by the minimum and maximum depth values of all vertices that hit since the previous event, followed by the name stack contents, bottom name first. .P Depth values (which are in the range [0,1]) are multiplied by 2^32 - 1, before being placed in the hit record. .P An internal index into _param2 is reset to 0 whenever selection mode is entered. Each time a hit record is copied into _param2, the index is incremented to point to the cell just past the end of the block of names \- that is, to the next available cell. If the hit record is larger than the number of remaining locations in _param2, as much data as can fit is copied, and the overflow flag is set. If the name stack is empty when a hit record is copied, that record consists of 0 followed by the minimum and maximum depth values. .P To exit selection mode, call _cmnd(RenderMode) with an argument other than _const(SELECT). Whenever _cmnd(RenderMode) is called while the render mode is _const(SELECT), it returns the number of hit records copied to _param2, resets the overflow flag and the selection buffer pointer, and initializes the name stack to be empty. If the overflow bit was set when _cmnd(RenderMode) was called, a negative hit record count is returned. .SH NOTES The contents of _param2 is undefined until _cmnd(RenderMode) is called with an argument other than _const(SELECT). .P _cmnd(Begin)/_cmnd(End) primitives and calls to _cmnd(RasterPos) can result in hits. .SH ERRORS _const(INVALID_VALUE) is generated if _param1 is negative. .P _const(INVALID_OPERATION) is generated if _cmnd is called while the render mode is _const(SELECT), or if _cmnd(RenderMode) is called with argument _const(SELECT) before _cmnd is called at least once. .P _const(INVALID_OPERATION) is generated if _cmnd is executed between the execution of _cmnd(Begin) and the corresponding execution of _cmnd(End). .SH ASSOCIATED GETS _cmnd(Get) with argument _const(NAME_STACK_DEPTH) .br _cmnd(Get) with argument _const(SELECTION_BUFFER_SIZE) .br _cmnd(GetPointerv) with argument _const(SELECTION_BUFFER_POINTER) .SH SEE ALSO _cmnd(FeedbackBuffer), _cmnd(InitNames), _cmnd(LoadName), _cmnd(PushName), _cmnd(RenderMode)