[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

endselect Subroutine


Turns off selecting mode.


Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

Int32 endselect(Int16 buffer[ ])


INTEGER*2 buffer(1)


The endselect subroutine turns off selecting mode and returns the number of hits.

When the system is in selecting mode, and a subroutine draws in the selecting region, the contents of the name stack are stored in a buffer, along with the number of names in the stack.

If a drawing primitive overlaps or intrudes upon the selecting volume, a hit has occurred. The hit is recorded only if the name stack has been touched since the last hit. Any of the subroutines loadname, pushname, or popname touch the name stack. The first hit after selecting begins is always recorded.

A hit is recorded by placing the depth of the name stack into the next vacant slot in the buffer, followed by the entire contents of the name stack. The bottom of the name stack is transferred to the buffer first, followed by the second from the bottom entry of the name stack, and so forth. In other words, from bottom to top is mapped to from left to right.

Note: This subroutine cannot be used to add to a display list.


buffer Specifies a buffer in which to write the number of hits.

Return Value

The number of times the name stack was recorded into the buffer. If the returned function value is negative, then the buffer was too small to contain all the readings from the name stack. The absolute value is the number of stacks actually recorded.


The example C language program select1.c uses the endselect subroutine to turn off selecting mode.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.


/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Turning off picking mode with the endpick subroutine.

Putting the system in selecting mode with the gselect subroutine.

Initializing the name stack with the initnames subroutine.

Loading the name on top of the name stack with the loadname subroutine.

Putting the system in picking mode with the pick subroutine.

Popping a name off the name stack with the popname subroutine.

Pushing a new name onto the name stack with the pushname subroutine.

AIX Graphics Library Overview and Picking and Selecting Overview.

[ Previous | Next | Contents | Glossary | Home | Search ]