1 ;;; figl -*- mode: scheme; coding: utf-8 -*-
2 ;;; Copyright (C) 2013 Andy Wingo <wingo@pobox.com>
4 ;;; Figl is free software: you can redistribute it and/or modify it
5 ;;; under the terms of the GNU Lesser General Public License as
6 ;;; published by the Free Software Foundation, either version 3 of the
7 ;;; License, or (at your option) any later version.
9 ;;; Figl is distributed in the hope that it will be useful, but WITHOUT
10 ;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 ;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
12 ;;; Public License for more details.
14 ;;; You should have received a copy of the GNU Lesser General Public
15 ;;; License along with this program. If not, see
16 ;;; <http://www.gnu.org/licenses/>.
18 ;;; Derived from upstream OpenGL documentation.
20 ;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed
21 ;;; under the SGI Free Software B License. For details, see
22 ;;; http://oss.sgi.com/projects/FreeB/ (http://oss.sgi.com/projects/FreeB/).
24 ;;; Automatically generated; you probably don't want to edit this. To
25 ;;; update, run "make update" in the top-level build tree.
43 gluBuild1DMipmapLevels
45 gluBuild2DMipmapLevels
47 gluBuild3DMipmapLevels
51 gluDeleteNurbsRenderer
59 gluLoadSamplingMatrices
65 gluNurbsCallbackDataEXT
95 (define-foreign-procedures
96 ((gluBeginCurve (nurb GLUnurbs*) -> void)
97 (gluEndCurve (nurb GLUnurbs*) -> void))
98 "Delimit a NURBS curve definition.
101 Specifies the NURBS object (created with `gluNewNurbsRenderer').
103 Use `gluBeginCurve' to mark the beginning of a NURBS curve definition.
104 After calling `gluBeginCurve', make one or more calls to `gluNurbsCurve'
105 to define the attributes of the curve. Exactly one of the calls to
106 `gluNurbsCurve' must have a curve type of `GLU_MAP1_VERTEX_3' or
107 `GLU_MAP1_VERTEX_4'. To mark the end of the NURBS curve definition, call
110 GL evaluators are used to render the NURBS curve as a series of line
111 segments. Evaluator state is preserved during rendering with
112 `glPushAttrib'(`GLU_EVAL_BIT') and `glPopAttrib'(). See the
113 `glPushAttrib' reference page for details on exactly what state these
116 (define-foreign-procedures
117 ((gluBeginPolygon (tess GLUtesselator*) -> void)
118 (gluEndPolygon (tess GLUtesselator*) -> void))
119 "Delimit a polygon description.
122 Specifies the tessellation object (created with `gluNewTess').
124 `gluBeginPolygon' and `gluEndPolygon' delimit the definition of a
125 nonconvex polygon. To define such a polygon, first call
126 `gluBeginPolygon'. Then define the contours of the polygon by calling
127 `gluTessVertex' for each vertex and `gluNextContour' to start each new
128 contour. Finally, call `gluEndPolygon' to signal the end of the
129 definition. See the `gluTessVertex' and `gluNextContour' reference pages
132 Once `gluEndPolygon' is called, the polygon is tessellated, and the
133 resulting triangles are described through callbacks. See
134 `gluTessCallback' for descriptions of the callback functions.")
136 (define-foreign-procedures
137 ((gluBeginSurface (nurb GLUnurbs*) -> void)
138 (gluEndSurface (nurb GLUnurbs*) -> void))
139 "Delimit a NURBS surface definition.
142 Specifies the NURBS object (created with `gluNewNurbsRenderer').
144 Use `gluBeginSurface' to mark the beginning of a NURBS surface
145 definition. After calling `gluBeginSurface', make one or more calls to
146 `gluNurbsSurface' to define the attributes of the surface. Exactly one
147 of these calls to `gluNurbsSurface' must have a surface type of
148 `GLU_MAP2_VERTEX_3' or `GLU_MAP2_VERTEX_4'. To mark the end of the NURBS
149 surface definition, call `gluEndSurface'.
151 Trimming of NURBS surfaces is supported with `gluBeginTrim',
152 `gluPwlCurve', `gluNurbsCurve', and `gluEndTrim'. See the `gluBeginTrim'
153 reference page for details.
155 GL evaluators are used to render the NURBS surface as a set of polygons.
156 Evaluator state is preserved during rendering with
157 `glPushAttrib'(`GLU_EVAL_BIT') and `glPopAttrib'. See the `glPushAttrib'
158 reference page for details on exactly what state these calls preserve.")
160 (define-foreign-procedures
161 ((gluBeginTrim (nurb GLUnurbs*) -> void)
162 (gluEndTrim (nurb GLUnurbs*) -> void))
163 "Delimit a NURBS trimming loop definition.
166 Specifies the NURBS object (created with `gluNewNurbsRenderer').
168 Use `gluBeginTrim' to mark the beginning of a trimming loop and
169 `gluEndTrim' to mark the end of a trimming loop. A trimming loop is a
170 set of oriented curve segments (forming a closed curve) that define
171 boundaries of a NURBS surface. You include these trimming loops in the
172 definition of a NURBS surface, between calls to `gluBeginSurface' and
175 The definition for a NURBS surface can contain many trimming loops. For
176 example, if you wrote a definition for a NURBS surface that resembled a
177 rectangle with a hole punched out, the definition would contain two
178 trimming loops. One loop would define the outer edge of the rectangle;
179 the other would define the hole punched out of the rectangle. The
180 definitions of each of these trimming loops would be bracketed by a
181 `gluBeginTrim'/`gluEndTrim' pair.
183 The definition of a single closed trimming loop can consist of multiple
184 curve segments, each described as a piecewise linear curve (see
185 `gluPwlCurve') or as a single NURBS curve (see `gluNurbsCurve'), or as a
186 combination of both in any order. The only library calls that can appear
187 in a trimming loop definition (between the calls to `gluBeginTrim' and
188 `gluEndTrim') are `gluPwlCurve' and `gluNurbsCurve'.
190 The area of the NURBS surface that is displayed is the region in the
191 domain to the left of the trimming curve as the curve parameter
192 increases. Thus, the retained region of the NURBS surface is inside a
193 counterclockwise trimming loop and outside a clockwise trimming loop.
194 For the rectangle mentioned earlier, the trimming loop for the outer
195 edge of the rectangle runs counterclockwise, while the trimming loop for
196 the punched-out hole runs clockwise.
198 If you use more than one curve to define a single trimming loop, the
199 curve segments must form a closed loop (that is, the endpoint of each
200 curve must be the starting point of the next curve, and the endpoint of
201 the final curve must be the starting point of the first curve). If the
202 endpoints of the curve are sufficiently close together but not exactly
203 coincident, they will be coerced to match. If the endpoints are not
204 sufficiently close, an error results (see `gluNurbsCallback').
206 If a trimming loop definition contains multiple curves, the direction of
207 the curves must be consistent (that is, the inside must be to the left
208 of all of the curves). Nested trimming loops are legal as long as the
209 curve orientations alternate correctly. If trimming curves are
210 self-intersecting, or intersect one another, an error results.
212 If no trimming information is given for a NURBS surface, the entire
215 (define-foreign-procedures
216 ((gluBuild1DMipmapLevels
218 (internalFormat GLint)
228 "Builds a subset of one-dimensional mipmap levels.
231 Specifies the target texture. Must be `GLU_TEXTURE_1D'.
234 Requests the internal storage format of the texture image. The most
235 current version of the SGI implementation of GLU does not check
236 this value for validity before passing it on to the underlying
237 OpenGL implementation. A value that is not accepted by the OpenGL
238 implementation will lead to an OpenGL error. The benefit of not
239 checking this value at the GLU level is that OpenGL extensions can
240 add new internal texture formats without requiring a revision of
241 the GLU implementation. Older implementations of GLU check this
242 value and raise a GLU error if it is not 1, 2, 3, or 4 or one of
243 the following symbolic constants: `GLU_ALPHA', `GLU_ALPHA4',
244 `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', `GLU_LUMINANCE',
245 `GLU_LUMINANCE4', `GLU_LUMINANCE8', `GLU_LUMINANCE12',
246 `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', `GLU_LUMINANCE4_ALPHA4',
247 `GLU_LUMINANCE6_ALPHA2', `GLU_LUMINANCE8_ALPHA8',
248 `GLU_LUMINANCE12_ALPHA4', `GLU_LUMINANCE12_ALPHA12',
249 `GLU_LUMINANCE16_ALPHA16', `GLU_INTENSITY', `GLU_INTENSITY4',
250 `GLU_INTENSITY8', `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB',
251 `GLU_R3_G3_B2', `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10',
252 `GLU_RGB12', `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4',
253 `GLU_RGB5_A1', `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or
257 Specifies the width in pixels of the texture image. This should be
261 Specifies the format of the pixel data. Must be one of:
262 `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN',
263 `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR',
264 `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'.
267 Specifies the data type for DATA. Must be one of:
268 `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP',
269 `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT',
270 `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2',
271 `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5',
272 `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4',
273 `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1',
274 `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8',
275 `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or
276 `GLU_UNSIGNED_INT_2_10_10_10_REV'.
279 Specifies the mipmap level of the image data.
282 Specifies the minimum mipmap level to pass to `glTexImage1D'.
285 Specifies the maximum mipmap level to pass to `glTexImage1D'.
288 Specifies a pointer to the image data in memory.
290 `gluBuild1DMipmapLevels' builds a subset of prefiltered one-dimensional
291 texture maps of decreasing resolutions called a mipmap. This is used for
292 the antialiasing of texture mapped primitives.
294 A return value of zero indicates success, otherwise a GLU error code is
295 returned (see `gluErrorString').
297 A series of mipmap levels from BASE to MAX is built by decimating DATA
298 in half until size 1×1 is reached. At each level, each texel in the
299 halved mipmap level is an average of the corresponding two texels in the
300 larger mipmap level. `glTexImage1D' is called to load these mipmap
301 levels from BASE to MAX. If MAX is larger than the highest mipmap level
302 for the texture of the specified size, then a GLU error code is returned
303 (see `gluErrorString') and nothing is loaded.
305 For example, if LEVEL is 2 and WIDTH is 16, the following levels are
306 possible: 16×1 , 8×1 , 4×1 , 2×1 , 1×1 . These correspond to levels 2
307 through 6 respectively. If BASE is 3 and MAX is 5, then only mipmap
308 levels 8×1 , 4×1 and 2×1 are loaded. However, if MAX is 7, then an error
309 is returned and nothing is loaded since MAX is larger than the highest
310 mipmap level which is, in this case, 6.
312 The highest mipmap level can be derived from the formula
313 LOG_2\u2061(WIDTH×2^LEVEL,) .
315 See the `glTexImage1D' reference page for a description of the
316 acceptable values for TYPE parameter. See the `glDrawPixels' reference
317 page for a description of the acceptable values for LEVEL parameter.
319 `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE or
320 MAX is > the highest mipmap level for DATA.
322 `GLU_INVALID_VALUE' is returned if WIDTH is < 1.
324 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE are
327 `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2'
328 or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'.
330 `GLU_INVALID_OPERATION' is returned if TYPE is
331 `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
334 `GLU_INVALID_OPERATION' is returned if TYPE is
335 `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and
336 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
338 `GLU_INVALID_OPERATION' is returned if TYPE is
339 `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and
340 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
342 `GLU_INVALID_OPERATION' is returned if TYPE is
343 `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT
344 is neither `GLU_RGBA' nor `GLU_BGRA'.
346 `GLU_INVALID_OPERATION' is returned if TYPE is
347 `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and
348 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.")
350 (define-foreign-procedures
353 (internalFormat GLint)
360 "Builds a one-dimensional mipmap.
363 Specifies the target texture. Must be `GLU_TEXTURE_1D'.
366 Requests the internal storage format of the texture image. The most
367 current version of the SGI implementation of GLU does not check
368 this value for validity before passing it on to the underlying
369 OpenGL implementation. A value that is not accepted by the OpenGL
370 implementation will lead to an OpenGL error. The benefit of not
371 checking this value at the GLU level is that OpenGL extensions can
372 add new internal texture formats without requiring a revision of
373 the GLU implementation. Older implementations of GLU check this
374 value and raise a GLU error if it is not 1, 2, 3, or 4 or one of
375 the following symbolic constants: `GLU_ALPHA', `GLU_ALPHA4',
376 `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', `GLU_LUMINANCE',
377 `GLU_LUMINANCE4', `GLU_LUMINANCE8', `GLU_LUMINANCE12',
378 `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', `GLU_LUMINANCE4_ALPHA4',
379 `GLU_LUMINANCE6_ALPHA2', `GLU_LUMINANCE8_ALPHA8',
380 `GLU_LUMINANCE12_ALPHA4', `GLU_LUMINANCE12_ALPHA12',
381 `GLU_LUMINANCE16_ALPHA16', `GLU_INTENSITY', `GLU_INTENSITY4',
382 `GLU_INTENSITY8', `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB',
383 `GLU_R3_G3_B2', `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10',
384 `GLU_RGB12', `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4',
385 `GLU_RGB5_A1', `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or
389 Specifies the width, in pixels, of the texture image.
392 Specifies the format of the pixel data. Must be one of
393 `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN',
394 `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR',
395 `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'.
398 Specifies the data type for DATA. Must be one of
399 `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP',
400 `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT',
401 `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2',
402 `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5',
403 `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4',
404 `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1',
405 `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8',
406 `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or
407 `GLU_UNSIGNED_INT_2_10_10_10_REV'.
410 Specifies a pointer to the image data in memory.
412 `gluBuild1DMipmaps' builds a series of prefiltered one-dimensional
413 texture maps of decreasing resolutions called a mipmap. This is used for
414 the antialiasing of texture mapped primitives.
416 A return value of zero indicates success, otherwise a GLU error code is
417 returned (see `gluErrorString').
419 Initially, the WIDTH of DATA is checked to see if it is a power of 2. If
420 not, a copy of DATA is scaled up or down to the nearest power of 2. (If
421 WIDTH is exactly between powers of 2, then the copy of DATA will scale
422 upwards.) This copy will be used for subsequent mipmapping operations
423 described below. For example, if WIDTH is 57, then a copy of DATA will
424 scale up to 64 before mipmapping takes place.
426 Then, proxy textures (see `glTexImage1D') are used to determine if the
427 implementation can fit the requested texture. If not, WIDTH is
428 continually halved until it fits.
430 Next, a series of mipmap levels is built by decimating a copy of DATA in
431 half until size 1×1 is reached. At each level, each texel in the halved
432 mipmap level is an average of the corresponding two texels in the larger
435 `glTexImage1D' is called to load each of these mipmap levels. Level 0 is
436 a copy of DATA. The highest level is LOG_2,\u2061(WIDTH,) . For example, if
437 WIDTH is 64 and the implementation can store a texture of this size, the
438 following mipmap levels are built: 64×1 , 32×1 , 16×1 , 8×1 , 4×1 , 2×1
439 , and 1×1 . These correspond to levels 0 through 6, respectively.
441 See the `glTexImage1D' reference page for a description of the
442 acceptable values for the TYPE parameter. See the `glDrawPixels'
443 reference page for a description of the acceptable values for the DATA
446 `GLU_INVALID_VALUE' is returned if WIDTH is < 1.
448 `GLU_INVALID_ENUM' is returned if FORMAT or TYPE are not legal.
450 `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2'
451 or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'.
453 `GLU_INVALID_OPERATION' is returned if TYPE is
454 `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
457 `GLU_INVALID_OPERATION' is returned if TYPE is
458 `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and
459 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
461 `GLU_INVALID_OPERATION' is returned if TYPE is
462 `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and
463 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
465 `GLU_INVALID_OPERATION' is returned if TYPE is
466 `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT
467 is neither `GLU_RGBA' nor `GLU_BGRA'.
469 `GLU_INVALID_OPERATION' is returned if TYPE is
470 `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and
471 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.")
473 (define-foreign-procedures
474 ((gluBuild2DMipmapLevels
476 (internalFormat GLint)
487 "Builds a subset of two-dimensional mipmap levels.
490 Specifies the target texture. Must be `GLU_TEXTURE_2D'.
493 Requests the internal storage format of the texture image. The most
494 current version of the SGI implementation of GLU does not check
495 this value for validity before passing it on to the underlying
496 OpenGL implementation. A value that is not accepted by the OpenGL
497 implementation will lead to an OpenGL error. The benefit of not
498 checking this value at the GLU level is that OpenGL extensions can
499 add new internal texture formats without requiring a revision of
500 the GLU implementation. Older implementations of GLU check this
501 value and raise a GLU error if it is not 1, 2, 3, or 4 or one of
502 the following symbolic constants: `GLU_ALPHA', `GLU_ALPHA4',
503 `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', `GLU_LUMINANCE',
504 `GLU_LUMINANCE4', `GLU_LUMINANCE8', `GLU_LUMINANCE12',
505 `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', `GLU_LUMINANCE4_ALPHA4',
506 `GLU_LUMINANCE6_ALPHA2', `GLU_LUMINANCE8_ALPHA8',
507 `GLU_LUMINANCE12_ALPHA4', `GLU_LUMINANCE12_ALPHA12',
508 `GLU_LUMINANCE16_ALPHA16', `GLU_INTENSITY', `GLU_INTENSITY4',
509 `GLU_INTENSITY8', `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB',
510 `GLU_R3_G3_B2', `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10',
511 `GLU_RGB12', `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4',
512 `GLU_RGB5_A1', `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or
518 Specifies the width and height, respectively, in pixels of the
519 texture image. These should be a power of 2.
522 Specifies the format of the pixel data. Must be one of
523 `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN',
524 `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR',
525 `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'.
528 Specifies the data type for DATA. Must be one of
529 `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP',
530 `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT',
531 `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2',
532 `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5',
533 `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4',
534 `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1',
535 `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8',
536 `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or
537 `GLU_UNSIGNED_INT_2_10_10_10_REV'.
540 Specifies the mipmap level of the image data.
543 Specifies the minimum mipmap level to pass to `glTexImage2D'.
546 Specifies the maximum mipmap level to pass to `glTexImage2D'.
549 Specifies a pointer to the image data in memory.
551 `gluBuild2DMipmapLevels' builds a subset of prefiltered two-dimensional
552 texture maps of decreasing resolutions called a mipmap. This is used for
553 the antialiasing of texture mapped primitives.
555 A return value of zero indicates success, otherwise a GLU error code is
556 returned (see `gluErrorString').
558 A series of mipmap levels from BASE to MAX is built by decimating DATA
559 in half along both dimensions until size 1×1 is reached. At each level,
560 each texel in the halved mipmap level is an average of the corresponding
561 four texels in the larger mipmap level. (In the case of rectangular
562 images, the decimation will ultimately reach an N×1 or 1×N
563 configuration. Here, two texels are averaged instead.) `glTexImage2D' is
564 called to load these mipmap levels from BASE to MAX. If MAX is larger
565 than the highest mipmap level for the texture of the specified size,
566 then a GLU error code is returned (see `gluErrorString') and nothing is
569 For example, if LEVEL is 2 and WIDTH is 16 and HEIGHT is 8, the
570 following levels are possible: 16×8 , 8×4 , 4×2 , 2×1 , 1×1 . These
571 correspond to levels 2 through 6 respectively. If BASE is 3 and MAX is
572 5, then only mipmap levels 8×4 , 4×2 , and 2×1 are loaded. However, if
573 MAX is 7, then an error is returned and nothing is loaded since MAX is
574 larger than the highest mipmap level which is, in this case, 6.
576 The highest mipmap level can be derived from the formula
577 LOG_2\u2061(MAX\u2061(WIDTH,HEIGHT)×2^LEVEL,) .
579 See the `glTexImage1D' reference page for a description of the
580 acceptable values for FORMAT parameter. See the `glDrawPixels' reference
581 page for a description of the acceptable values for TYPE parameter.
583 `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE,
584 or MAX is > the highest mipmap level for DATA.
586 `GLU_INVALID_VALUE' is returned if WIDTH or HEIGHT is < 1.
588 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not
591 `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2'
592 or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'.
594 `GLU_INVALID_OPERATION' is returned if TYPE is
595 `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
598 `GLU_INVALID_OPERATION' is returned if TYPE is
599 `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and
600 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
602 `GLU_INVALID_OPERATION' is returned if TYPE is
603 `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and
604 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
606 `GLU_INVALID_OPERATION' is returned if TYPE is
607 `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT
608 is neither `GLU_RGBA' nor `GLU_BGRA'.
610 `GLU_INVALID_OPERATION' is returned if TYPE is
611 `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and
612 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.")
614 (define-foreign-procedures
617 (internalFormat GLint)
625 "Builds a two-dimensional mipmap.
628 Specifies the target texture. Must be `GLU_TEXTURE_2D'.
631 Requests the internal storage format of the texture image. The most
632 current version of the SGI implementation of GLU does not check
633 this value for validity before passing it on to the underlying
634 OpenGL implementation. A value that is not accepted by the OpenGL
635 implementation will lead to an OpenGL error. The benefit of not
636 checking this value at the GLU level is that OpenGL extensions can
637 add new internal texture formats without requiring a revision of
638 the GLU implementation. Older implementations of GLU check this
639 value and raise a GLU error if it is not 1, 2, 3, or 4 or one of
640 the following symbolic constants: `GLU_ALPHA', `GLU_ALPHA4',
641 `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', `GLU_LUMINANCE',
642 `GLU_LUMINANCE4', `GLU_LUMINANCE8', `GLU_LUMINANCE12',
643 `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', `GLU_LUMINANCE4_ALPHA4',
644 `GLU_LUMINANCE6_ALPHA2', `GLU_LUMINANCE8_ALPHA8',
645 `GLU_LUMINANCE12_ALPHA4', `GLU_LUMINANCE12_ALPHA12',
646 `GLU_LUMINANCE16_ALPHA16', `GLU_INTENSITY', `GLU_INTENSITY4',
647 `GLU_INTENSITY8', `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB',
648 `GLU_R3_G3_B2', `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10',
649 `GLU_RGB12', `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4',
650 `GLU_RGB5_A1', `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or
656 Specifies in pixels the width and height, respectively, of the
660 Specifies the format of the pixel data. Must be one of
661 `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN',
662 `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR',
663 `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'.
666 Specifies the data type for DATA. Must be one of
667 `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP',
668 `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT',
669 `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2',
670 `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5',
671 `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4',
672 `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1',
673 `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8',
674 `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or
675 `GLU_UNSIGNED_INT_2_10_10_10_REV'.
678 Specifies a pointer to the image data in memory.
680 `gluBuild2DMipmaps' builds a series of prefiltered two-dimensional
681 texture maps of decreasing resolutions called a mipmap. This is used for
682 the antialiasing of texture-mapped primitives.
684 A return value of zero indicates success, otherwise a GLU error code is
685 returned (see `gluErrorString').
687 Initially, the WIDTH and HEIGHT of DATA are checked to see if they are a
688 power of 2. If not, a copy of DATA (not DATA), is scaled up or down to
689 the nearest power of 2. This copy will be used for subsequent mipmapping
690 operations described below. (If WIDTH or HEIGHT is exactly between
691 powers of 2, then the copy of DATA will scale upwards.) For example, if
692 WIDTH is 57 and HEIGHT is 23, then a copy of DATA will scale up to 64 in
693 WIDTH and down to 16 in depth, before mipmapping takes place.
695 Then, proxy textures (see `glTexImage2D') are used to determine if the
696 implementation can fit the requested texture. If not, both dimensions
697 are continually halved until it fits. (If the OpenGL version is \\(<=
698 1.0, both maximum texture dimensions are clamped to the value returned
699 by `glGetIntegerv' with the argument `GLU_MAX_TEXTURE_SIZE'.)
701 Next, a series of mipmap levels is built by decimating a copy of DATA in
702 half along both dimensions until size 1×1 is reached. At each level,
703 each texel in the halved mipmap level is an average of the corresponding
704 four texels in the larger mipmap level. (In the case of rectangular
705 images, the decimation will ultimately reach an N×1 or 1×N
706 configuration. Here, two texels are averaged instead.)
708 `glTexImage2D' is called to load each of these mipmap levels. Level 0 is
709 a copy of DATA. The highest level is LOG_2,\u2061(MAX\u2061(WIDTH,HEIGHT),) . For
710 example, if WIDTH is 64 and HEIGHT is 16 and the implementation can
711 store a texture of this size, the following mipmap levels are built:
712 64×16 , 32×8 , 16×4 , 8×2 , 4×1 , 2×1 , and 1×1 These correspond to
713 levels 0 through 6, respectively.
715 See the `glTexImage1D' reference page for a description of the
716 acceptable values for FORMAT parameter. See the `glDrawPixels' reference
717 page for a description of the acceptable values for TYPE parameter.
719 `GLU_INVALID_VALUE' is returned if WIDTH or HEIGHT is < 1.
721 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not
724 `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2'
725 or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'.
727 `GLU_INVALID_OPERATION' is returned if TYPE is
728 `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
731 `GLU_INVALID_OPERATION' is returned if TYPE is
732 `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and
733 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
735 `GLU_INVALID_OPERATION' is returned if TYPE is
736 `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and
737 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
739 `GLU_INVALID_OPERATION' is returned if TYPE is
740 `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT
741 is neither `GLU_RGBA' nor `GLU_BGRA'.
743 `GLU_INVALID_OPERATION' is returned if TYPE is
744 `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and
745 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.")
747 (define-foreign-procedures
748 ((gluBuild3DMipmapLevels
750 (internalFormat GLint)
762 "Builds a subset of three-dimensional mipmap levels.
765 Specifies the target texture. Must be `GLU_TEXTURE_3D'.
768 Requests the internal storage format of the texture image. The most
769 current version of the SGI implementation of GLU does not check
770 this value for validity before passing it on to the underlying
771 OpenGL implementation. A value that is not accepted by the OpenGL
772 implementation will lead to an OpenGL error. The benefit of not
773 checking this value at the GLU level is that OpenGL extensions can
774 add new internal texture formats without requiring a revision of
775 the GLU implementation. Older implementations of GLU check this
776 value and raise a GLU error if it is not 1, 2, 3, or 4 or one of
777 the following symbolic constants: `GLU_ALPHA', `GLU_ALPHA4',
778 `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', `GLU_LUMINANCE',
779 `GLU_LUMINANCE4', `GLU_LUMINANCE8', `GLU_LUMINANCE12',
780 `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', `GLU_LUMINANCE4_ALPHA4',
781 `GLU_LUMINANCE6_ALPHA2', `GLU_LUMINANCE8_ALPHA8',
782 `GLU_LUMINANCE12_ALPHA4', `GLU_LUMINANCE12_ALPHA12',
783 `GLU_LUMINANCE16_ALPHA16', `GLU_INTENSITY', `GLU_INTENSITY4',
784 `GLU_INTENSITY8', `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB',
785 `GLU_R3_G3_B2', `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10',
786 `GLU_RGB12', `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4',
787 `GLU_RGB5_A1', `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or
795 Specifies in pixels the width, height and depth respectively, of
796 the texture image. These should be a power of 2.
799 Specifies the format of the pixel data. Must be one of
800 `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN',
801 `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR',
802 `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'.
805 Specifies the data type for DATA. Must be one of
806 `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP',
807 `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT',
808 `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2',
809 `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5',
810 `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4',
811 `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1',
812 `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8',
813 `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or
814 `GLU_UNSIGNED_INT_2_10_10_10_REV'.
817 Specifies the mipmap level of the image data.
820 Specifies the minimum mipmap level to pass to `glTexImage3D'.
823 Specifies the maximum mipmap level to pass to `glTexImage3D'.
826 Specifies a pointer to the image data in memory.
828 `gluBuild3DMipmapLevels' builds a subset of prefiltered
829 three-dimensional texture maps of decreasing resolutions called a
830 mipmap. This is used for the antialiasing of texture mapped primitives.
832 A return value of zero indicates success, otherwise a GLU error code is
833 returned (see `gluErrorString').
835 A series of mipmap levels from BASE to MAX is built by decimating DATA
836 in half along both dimensions until size 1×1×1 is reached. At each
837 level, each texel in the halved mipmap level is an average of the
838 corresponding eight texels in the larger mipmap level. (If exactly one
839 of the dimensions is 1, four texels are averaged. If exactly two of the
840 dimensions are 1, two texels are averaged.) `glTexImage3D' is called to
841 load these mipmap levels from BASE to MAX. If MAX is larger than the
842 highest mipmap level for the texture of the specified size, then a GLU
843 error code is returned (see `gluErrorString') and nothing is loaded.
845 For example, if LEVEL is 2 and WIDTH is 16, HEIGHT is 8 and DEPTH is 4,
846 the following levels are possible: 16×8×4 , 8×4×2 , 4×2×1 , 2×1×1 ,
847 1×1×1 . These correspond to levels 2 through 6 respectively. If BASE is
848 3 and MAX is 5, then only mipmap levels 8×4×2 , 4×2×1 , and 2×1×1 are
849 loaded. However, if MAX is 7, then an error is returned and nothing is
850 loaded, since MAX is larger than the highest mipmap level which is, in
853 The highest mipmap level can be derived from the formula
854 LOG_2\u2061(MAX\u2061(WIDTH,HEIGHTDEPTH)×2^LEVEL,) .
856 See the `glTexImage1D' reference page for a description of the
857 acceptable values for FORMAT parameter. See the `glDrawPixels' reference
858 page for a description of the acceptable values for TYPE parameter.
860 `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE,
861 or MAX is > the highest mipmap level for DATA.
863 `GLU_INVALID_VALUE' is returned if WIDTH, HEIGHT, or DEPTH is < 1.
865 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not
868 `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2'
869 or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'.
871 `GLU_INVALID_OPERATION' is returned if TYPE is
872 `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
875 `GLU_INVALID_OPERATION' is returned if TYPE is
876 `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and
877 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
879 `GLU_INVALID_OPERATION' is returned if TYPE is
880 `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and
881 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
883 `GLU_INVALID_OPERATION' is returned if TYPE is
884 `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT
885 is neither `GLU_RGBA' nor `GLU_BGRA'.
887 `GLU_INVALID_OPERATION' is returned if TYPE is
888 `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and
889 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.")
891 (define-foreign-procedures
894 (internalFormat GLint)
903 "Builds a three-dimensional mipmap.
906 Specifies the target texture. Must be `GLU_TEXTURE_3D'.
909 Requests the internal storage format of the texture image. The most
910 current version of the SGI implementation of GLU does not check
911 this value for validity before passing it on to the underlying
912 OpenGL implementation. A value that is not accepted by the OpenGL
913 implementation will lead to an OpenGL error. The benefit of not
914 checking this value at the GLU level is that OpenGL extensions can
915 add new internal texture formats without requiring a revision of
916 the GLU implementation. Older implementations of GLU check this
917 value and raise a GLU error if it is not 1, 2, 3, or 4 or one of
918 the following symbolic constants: `GLU_ALPHA', `GLU_ALPHA4',
919 `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', `GLU_LUMINANCE',
920 `GLU_LUMINANCE4', `GLU_LUMINANCE8', `GLU_LUMINANCE12',
921 `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', `GLU_LUMINANCE4_ALPHA4',
922 `GLU_LUMINANCE6_ALPHA2', `GLU_LUMINANCE8_ALPHA8',
923 `GLU_LUMINANCE12_ALPHA4', `GLU_LUMINANCE12_ALPHA12',
924 `GLU_LUMINANCE16_ALPHA16', `GLU_INTENSITY', `GLU_INTENSITY4',
925 `GLU_INTENSITY8', `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB',
926 `GLU_R3_G3_B2', `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10',
927 `GLU_RGB12', `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4',
928 `GLU_RGB5_A1', `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or
936 Specifies in pixels the width, height and depth respectively, in
937 pixels of the texture image.
940 Specifies the format of the pixel data. Must be one of
941 `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN',
942 `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR',
943 `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'.
946 Specifies the data type for DATA. Must be one of:
947 `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP',
948 `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT',
949 `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2',
950 `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5',
951 `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4',
952 `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1',
953 `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8',
954 `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or
955 `GLU_UNSIGNED_INT_2_10_10_10_REV'.
958 Specifies a pointer to the image data in memory.
960 `gluBuild3DMipmaps' builds a series of prefiltered three-dimensional
961 texture maps of decreasing resolutions called a mipmap. This is used for
962 the antialiasing of texture-mapped primitives.
964 A return value of zero indicates success, otherwise a GLU error code is
965 returned (see `gluErrorString').
967 Initially, the WIDTH, HEIGHT and DEPTH of DATA are checked to see if
968 they are a power of 2. If not, a copy of DATA is made and scaled up or
969 down to the nearest power of 2. (If WIDTH, HEIGHT, or DEPTH is exactly
970 between powers of 2, then the copy of DATA will scale upwards.) This
971 copy will be used for subsequent mipmapping operations described below.
972 For example, if WIDTH is 57, HEIGHT is 23, and DEPTH is 24, then a copy
973 of DATA will scale up to 64 in width, down to 16 in height, and up to 32
974 in depth before mipmapping takes place.
976 Then, proxy textures (see `glTexImage3D') are used to determine if the
977 implementation can fit the requested texture. If not, all three
978 dimensions are continually halved until it fits.
980 Next, a series of mipmap levels is built by decimating a copy of DATA in
981 half along all three dimensions until size 1×1×1 is reached. At each
982 level, each texel in the halved mipmap level is an average of the
983 corresponding eight texels in the larger mipmap level. (If exactly one
984 of the dimensions is 1, four texels are averaged. If exactly two of the
985 dimensions are 1, two texels are averaged.)
987 `glTexImage3D' is called to load each of these mipmap levels. Level 0 is
988 a copy of DATA. The highest level is LOG_2,\u2061(MAX\u2061(WIDTH,HEIGHTDEPTH),) .
989 For example, if WIDTH is 64, HEIGHT is 16, and DEPTH is 32, and the
990 implementation can store a texture of this size, the following mipmap
991 levels are built: 64×16×32 , 32×8×16 , 16×4×8 , 8×2×4 , 4×1×2 , 2×1×1 ,
992 and 1×1×1 . These correspond to levels 0 through 6, respectively.
994 See the `glTexImage1D' reference page for a description of the
995 acceptable values for FORMAT parameter. See the `glDrawPixels' reference
996 page for a description of the acceptable values for TYPE parameter.
998 `GLU_INVALID_VALUE' is returned if WIDTH, HEIGHT, or DEPTH is < 1.
1000 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not
1003 `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2'
1004 or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'.
1006 `GLU_INVALID_OPERATION' is returned if TYPE is
1007 `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
1010 `GLU_INVALID_OPERATION' is returned if TYPE is
1011 `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and
1012 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
1014 `GLU_INVALID_OPERATION' is returned if TYPE is
1015 `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and
1016 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
1018 `GLU_INVALID_OPERATION' is returned if TYPE is
1019 `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT
1020 is neither `GLU_RGBA' nor `GLU_BGRA'.
1022 `GLU_INVALID_OPERATION' is returned if TYPE is
1023 `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and
1024 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.")
1026 (define-foreign-procedures
1028 (extName const-GLubyte-*)
1029 (extString const-GLubyte-*)
1032 "Determines if an extension name is supported.
1035 Specifies an extension name.
1038 Specifies a space-separated list of extension names supported.
1040 `gluCheckExtension' returns `GLU_TRUE' if EXTNAME is supported otherwise
1041 `GLU_FALSE' is returned.
1043 This is used to check for the presence for OpenGL, GLU, or GLX extension
1044 names by passing the extension strings returned by `glGetString',
1045 `gluGetString', `glXGetClientString', `glXQueryExtensionsString', or
1046 `glXQueryServerString', respectively, as EXTSTRING.")
1048 (define-foreign-procedures
1061 Specifies the quadrics object (created with `gluNewQuadric').
1064 Specifies the radius of the cylinder at Z = 0.
1067 Specifies the radius of the cylinder at Z = HEIGHT.
1070 Specifies the height of the cylinder.
1073 Specifies the number of subdivisions around the Z axis.
1076 Specifies the number of subdivisions along the Z axis.
1078 `gluCylinder' draws a cylinder oriented along the Z axis. The base of
1079 the cylinder is placed at Z = 0 and the top at Z=HEIGHT . Like a sphere,
1080 a cylinder is subdivided around the Z axis into slices and along the Z
1083 Note that if TOP is set to 0.0, this routine generates a cone.
1085 If the orientation is set to `GLU_OUTSIDE' (with
1086 `gluQuadricOrientation'), then any generated normals point away from the
1087 Z axis. Otherwise, they point toward the Z axis.
1089 If texturing is turned on (with `gluQuadricTexture'), then texture
1090 coordinates are generated so that T ranges linearly from 0.0 at Z = 0 to
1091 1.0 at Z = HEIGHT, and S ranges from 0.0 at the +Y axis, to 0.25 at the
1092 +X axis, to 0.5 at the -Y axis, to 0.75 at the \\-X axis, and back to 1.0
1095 (define-foreign-procedures
1096 ((gluDeleteNurbsRenderer (nurb GLUnurbs*) -> void))
1097 "Destroy a NURBS object.
1100 Specifies the NURBS object to be destroyed.
1102 `gluDeleteNurbsRenderer' destroys the NURBS object (which was created
1103 with `gluNewNurbsRenderer') and frees any memory it uses. Once
1104 `gluDeleteNurbsRenderer' has been called, NURB cannot be used again.")
1106 (define-foreign-procedures
1107 ((gluDeleteQuadric (quad GLUquadric*) -> void))
1108 "Destroy a quadrics object.
1111 Specifies the quadrics object to be destroyed.
1113 `gluDeleteQuadric' destroys the quadrics object (created with
1114 `gluNewQuadric') and frees any memory it uses. Once `gluDeleteQuadric'
1115 has been called, QUAD cannot be used again.")
1117 (define-foreign-procedures
1118 ((gluDeleteTess (tess GLUtesselator*) -> void))
1119 "Destroy a tessellation object.
1122 Specifies the tessellation object to destroy.
1124 `gluDeleteTess' destroys the indicated tessellation object (which was
1125 created with `gluNewTess') and frees any memory that it used.")
1127 (define-foreign-procedures
1139 Specifies the quadrics object (created with `gluNewQuadric').
1142 Specifies the inner radius of the disk (may be 0).
1145 Specifies the outer radius of the disk.
1148 Specifies the number of subdivisions around the Z axis.
1151 Specifies the number of concentric rings about the origin into
1152 which the disk is subdivided.
1154 `gluDisk' renders a disk on the Z = 0 plane. The disk has a radius of
1155 OUTER and contains a concentric circular hole with a radius of INNER. If
1156 INNER is 0, then no hole is generated. The disk is subdivided around the
1157 Z axis into slices (like pizza slices) and also about the Z axis into
1158 rings (as specified by SLICES and LOOPS, respectively).
1160 With respect to orientation, the +Z side of the disk is considered to be
1161 ``outside'' (see `gluQuadricOrientation'). This means that if the
1162 orientation is set to `GLU_OUTSIDE', then any normals generated point
1163 along the +Z axis. Otherwise, they point along the \\-Z axis.
1165 If texturing has been turned on (with `gluQuadricTexture'), texture
1166 coordinates are generated linearly such that where R=OUTER , the value
1167 at (R, 0, 0) is (1, 0.5), at (0, R, 0) it is (0.5, 1), at (\\-R, 0, 0) it
1168 is (0, 0.5), and at (0, \\-R, 0) it is (0.5, 0).")
1170 (define-foreign-procedures
1175 "Produce an error string from a GL or GLU error code.
1178 Specifies a GL or GLU error code.
1180 `gluErrorString' produces an error string from a GL or GLU error code.
1181 The string is in ISO Latin 1 format. For example,
1182 `gluErrorString'(`GLU_OUT_OF_MEMORY') returns the string OUT OF MEMORY.
1184 The standard GLU error codes are `GLU_INVALID_ENUM',
1185 `GLU_INVALID_VALUE', and `GLU_OUT_OF_MEMORY'. Certain other GLU
1186 functions can return specialized error codes through callbacks. See the
1187 `glGetError' reference page for the list of GL error codes.
1189 `NULL' is returned if ERROR is not a valid GL or GLU error code.")
1191 (define-foreign-procedures
1192 ((gluGetNurbsProperty
1198 "Get a NURBS property.
1201 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1204 Specifies the property whose value is to be fetched. Valid values
1205 are `GLU_CULLING', `GLU_SAMPLING_TOLERANCE', `GLU_DISPLAY_MODE',
1206 `GLU_AUTO_LOAD_MATRIX', `GLU_PARAMETRIC_TOLERANCE',
1207 `GLU_SAMPLING_METHOD', `GLU_U_STEP', `GLU_V_STEP', and
1211 Specifies a pointer to the location into which the value of the
1212 named property is written.
1214 `gluGetNurbsProperty' retrieves properties stored in a NURBS object.
1215 These properties affect the way that NURBS curves and surfaces are
1216 rendered. See the `gluNurbsProperty' reference page for information
1217 about what the properties are and what they do.")
1219 (define-foreign-procedures
1220 ((gluGetString (name GLenum) -> const-GLubyte-*))
1221 "Return a string describing the GLU version or GLU extensions .
1224 Specifies a symbolic constant, one of `GLU_VERSION', or
1227 `gluGetString' returns a pointer to a static string describing the GLU
1228 version or the GLU extensions that are supported.
1230 The version number is one of the following forms:
1232 MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER.
1234 The version string is of the following form:
1236 VERSION NUMBER<SPACE>VENDOR-SPECIFIC INFORMATION
1238 Vendor-specific information is optional. Its format and contents depend
1239 on the implementation.
1241 The standard GLU contains a basic set of features and capabilities. If a
1242 company or group of companies wish to support other features, these may
1243 be included as extensions to the GLU. If NAME is `GLU_EXTENSIONS', then
1244 `gluGetString' returns a space-separated list of names of supported GLU
1245 extensions. (Extension names never contain spaces.)
1247 All strings are null-terminated.
1249 NULL is returned if NAME is not `GLU_VERSION' or `GLU_EXTENSIONS'.")
1251 (define-foreign-procedures
1252 ((gluGetTessProperty
1253 (tess GLUtesselator*)
1258 "Get a tessellation object property.
1261 Specifies the tessellation object (created with `gluNewTess').
1264 Specifies the property whose value is to be fetched. Valid values
1265 are `GLU_TESS_WINDING_RULE', `GLU_TESS_BOUNDARY_ONLY', and
1266 `GLU_TESS_TOLERANCE'.
1269 Specifies a pointer to the location into which the value of the
1270 named property is written.
1272 `gluGetTessProperty' retrieves properties stored in a tessellation
1273 object. These properties affect the way that tessellation objects are
1274 interpreted and rendered. See the `gluTessProperty' reference page for
1275 information about the properties and what they do.")
1277 (define-foreign-procedures
1278 ((gluLoadSamplingMatrices
1280 (model const-GLfloat-*)
1281 (perspective const-GLfloat-*)
1282 (view const-GLint-*)
1285 "Load NURBS sampling and culling matrices.
1288 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1291 Specifies a modelview matrix (as from a `glGetFloatv' call).
1294 Specifies a projection matrix (as from a `glGetFloatv' call).
1297 Specifies a viewport (as from a `glGetIntegerv' call).
1299 `gluLoadSamplingMatrices' uses MODEL, PERSPECTIVE, and VIEW to recompute
1300 the sampling and culling matrices stored in NURB. The sampling matrix
1301 determines how finely a NURBS curve or surface must be tessellated to
1302 satisfy the sampling tolerance (as determined by the
1303 `GLU_SAMPLING_TOLERANCE' property). The culling matrix is used in
1304 deciding if a NURBS curve or surface should be culled before rendering
1305 (when the `GLU_CULLING' property is turned on).
1307 `gluLoadSamplingMatrices' is necessary only if the
1308 `GLU_AUTO_LOAD_MATRIX' property is turned off (see `gluNurbsProperty').
1309 Although it can be convenient to leave the `GLU_AUTO_LOAD_MATRIX'
1310 property turned on, there can be a performance penalty for doing so. (A
1311 round trip to the GL server is needed to fetch the current values of the
1312 modelview matrix, projection matrix, and viewport.)")
1314 (define-foreign-procedures
1327 "Define a viewing transformation.
1334 Specifies the position of the eye point.
1341 Specifies the position of the reference point.
1348 Specifies the direction of the UP vector.
1350 `gluLookAt' creates a viewing matrix derived from an eye point, a
1351 reference point indicating the center of the scene, and an UP vector.
1353 The matrix maps the reference point to the negative Z axis and the eye
1354 point to the origin. When a typical projection matrix is used, the
1355 center of the scene therefore maps to the center of the viewport.
1356 Similarly, the direction described by the UP vector projected onto the
1357 viewing plane is mapped to the positive Y axis so that it points upward
1358 in the viewport. The UP vector must not be parallel to the line of sight
1359 from the eye point to the reference point.
1363 F=((CENTERX-EYEX), (CENTERY-EYEY), (CENTERZ-EYEZ),)
1367 Let UP be the vector (UPX,UPYUPZ) .
1369 Then normalize as follows: F=F/∥F,∥,
1375 Finally, let S=F×UP^″ , and U=S×F .
1379 M is then constructed as follows: M=((S\u2061[0,] S\u2061[1,] S\u2061[2,] 0), (U\u2061[0,]
1380 U\u2061[1,] U\u2061[2,] 0), (-F\u2061[0,] -F\u2061[1,] -F\u2061[2,] 0), (0 0 0 1),)
1382 and `gluLookAt' is equivalent to
1386 glTranslated(-eyex, -eyey, -eyez);")
1388 (define-foreign-procedures
1389 ((gluNewNurbsRenderer -> GLUnurbs*))
1390 "Create a NURBS object.
1392 `gluNewNurbsRenderer' creates and returns a pointer to a new NURBS
1393 object. This object must be referred to when calling NURBS rendering and
1394 control functions. A return value of 0 means that there is not enough
1395 memory to allocate the object.")
1397 (define-foreign-procedures
1398 ((gluNewQuadric -> GLUquadric*))
1399 "Create a quadrics object.
1401 `gluNewQuadric' creates and returns a pointer to a new quadrics object.
1402 This object must be referred to when calling quadrics rendering and
1403 control functions. A return value of 0 means that there is not enough
1404 memory to allocate the object.")
1406 (define-foreign-procedures
1407 ((gluNewTess -> GLUtesselator*))
1408 "Create a tessellation object.
1410 `gluNewTess' creates and returns a pointer to a new tessellation object.
1411 This object must be referred to when calling tessellation functions. A
1412 return value of 0 means that there is not enough memory to allocate the
1415 (define-foreign-procedures
1417 (tess GLUtesselator*)
1421 "Mark the beginning of another contour.
1424 Specifies the tessellation object (created with `gluNewTess').
1427 Specifies the type of the contour being defined. Valid values are
1428 `GLU_EXTERIOR', `GLU_INTERIOR', `GLU_UNKNOWN', `GLU_CCW', and
1431 `gluNextContour' is used in describing polygons with multiple contours.
1432 After the first contour has been described through a series of
1433 `gluTessVertex' calls, a `gluNextContour' call indicates that the
1434 previous contour is complete and that the next contour is about to
1435 begin. Another series of `gluTessVertex' calls is then used to describe
1436 the new contour. This process can be repeated until all contours have
1439 TYPE defines what type of contour follows. The legal contour types are
1443 An exterior contour defines an exterior boundary of the polygon.
1446 An interior contour defines an interior boundary of the polygon
1450 An unknown contour is analyzed by the library to determine if it is
1451 interior or exterior.
1455 The first `GLU_CCW' or `GLU_CW' contour defined is considered to be
1456 exterior. All other contours are considered to be exterior if they
1457 are oriented in the same direction (clockwise or counterclockwise)
1458 as the first contour, and interior if they are not.
1460 If one contour is of type `GLU_CCW' or `GLU_CW', then all contours must
1461 be of the same type (if they are not, then all `GLU_CCW' and `GLU_CW'
1462 contours will be changed to `GLU_UNKNOWN').
1464 Note that there is no real difference between the `GLU_CCW' and `GLU_CW'
1467 Before the first contour is described, `gluNextContour' can be called to
1468 define the type of the first contour. If `gluNextContour' is not called
1469 before the first contour, then the first contour is marked
1472 This command is obsolete and is provided for backward compatibility
1473 only. Calls to `gluNextContour' are mapped to `gluTessEndContour'
1474 followed by `gluTessBeginContour'.")
1476 (define-foreign-procedures
1477 ((gluNurbsCallbackDataEXT
1482 "Set a user data pointer.
1485 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1488 Specifies a pointer to the user's data.
1490 `gluNurbsCallbackDataEXT' is used to pass a pointer to the application's
1491 data to NURBS tessellator. A copy of this pointer will be passed by the
1492 tessellator in the NURBS callback functions (set by `gluNurbsCallback').")
1494 (define-foreign-procedures
1495 ((gluNurbsCallbackData
1500 "Set a user data pointer.
1503 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1506 Specifies a pointer to the user's data.
1508 `gluNurbsCallbackData' is used to pass a pointer to the application's
1509 data to NURBS tessellator. A copy of this pointer will be passed by the
1510 tessellator in the NURBS callback functions (set by `gluNurbsCallback').")
1512 (define-foreign-procedures
1516 (CallBackFunc _GLUfuncptr)
1519 "Define a callback for a NURBS object.
1522 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1525 Specifies the callback being defined. Valid values are
1526 `GLU_NURBS_BEGIN', `GLU_NURBS_VERTEX', `GLU_NURBS_NORMAL',
1527 `GLU_NURBS_COLOR', `GLU_NURBS_TEXTURE_COORD', `GLU_NURBS_END',
1528 `GLU_NURBS_BEGIN_DATA', `GLU_NURBS_VERTEX_DATA',
1529 `GLU_NURBS_NORMAL_DATA', `GLU_NURBS_COLOR_DATA',
1530 `GLU_NURBS_TEXTURE_COORD_DATA', `GLU_NURBS_END_DATA', and
1534 Specifies the function that the callback calls.
1536 `gluNurbsCallback' is used to define a callback to be used by a NURBS
1537 object. If the specified callback is already defined, then it is
1538 replaced. If CALLBACKFUNC is NULL, then this callback will not get
1539 invoked and the related data, if any, will be lost.
1541 Except the error callback, these callbacks are used by NURBS tessellator
1542 (when `GLU_NURBS_MODE' is set to be `GLU_NURBS_TESSELLATOR') to return
1543 back the OpenGL polygon primitives resulting from the tessellation. Note
1544 that there are two versions of each callback: one with a user data
1545 pointer and one without. If both versions for a particular callback are
1546 specified then the callback with the user data pointer will be used.
1547 Note that ``userData'' is a copy of the pointer that was specified at
1548 the last call to `gluNurbsCallbackData'.
1550 The error callback function is effective no matter which value that
1551 `GLU_NURBS_MODE' is set to. All other callback functions are effective
1552 only when `GLU_NURBS_MODE' is set to `GLU_NURBS_TESSELLATOR'.
1554 The legal callbacks are as follows:
1559 The begin callback indicates the start of a primitive. The function
1560 takes a single argument of type GLenum, which can be one of
1561 `GLU_LINES', `GLU_LINE_STRIP', `GLU_TRIANGLE_FAN',
1562 `GLU_TRIANGLE_STRIP', `GLU_TRIANGLES', or `GLU_QUAD_STRIP'. The
1563 default begin callback function is NULL. The function prototype for
1564 this callback looks like:
1566 `GLU_NURBS_BEGIN_DATA'
1569 The same as the `GLU_NURBS_BEGIN' callback except that it takes an
1570 additional pointer argument. This pointer is a copy of the pointer
1571 that was specified at the last call to `gluNurbsCallbackData'. The
1572 default callback function is NULL. The function prototype for this
1573 callback function looks like:
1578 The vertex callback indicates a vertex of the primitive. The
1579 coordinates of the vertex are stored in the parameter ``vertex''.
1580 All the generated vertices have dimension 3; that is, homogeneous
1581 coordinates have been transformed into affine coordinates. The
1582 default vertex callback function is NULL. The function prototype
1583 for this callback function looks like:
1585 `GLU_NURBS_VERTEX_DATA'
1588 This is the same as the `GLU_NURBS_VERTEX' callback, except that it
1589 takes an additional pointer argument. This pointer is a copy of the
1590 pointer that was specified at the last call to
1591 `gluNurbsCallbackData'. The default callback function is NULL. The
1592 function prototype for this callback function looks like:
1597 The normal callback is invoked as the vertex normal is generated.
1598 The components of the normal are stored in the parameter
1599 ``normal.'' In the case of a NURBS curve, the callback function is
1600 effective only when the user provides a normal map
1601 (`GLU_MAP1_NORMAL'). In the case of a NURBS surface, if a normal
1602 map (`GLU_MAP2_NORMAL') is provided, then the generated normal is
1603 computed from the normal map. If a normal map is not provided, then
1604 a surface normal is computed in a manner similar to that described
1605 for evaluators when `GLU_AUTO_NORMAL' is enabled. The default
1606 normal callback function is NULL. The function prototype for this
1607 callback function looks like:
1609 `GLU_NURBS_NORMAL_DATA'
1612 The same as the `GLU_NURBS_NORMAL' callback except that it takes an
1613 additional pointer argument. This pointer is a copy of the pointer
1614 that was specified at the last call to `gluNurbsCallbackData'. The
1615 default callback function is NULL. The function prototype for this
1616 callback function looks like:
1621 The color callback is invoked as the color of a vertex is
1622 generated. The components of the color are stored in the parameter
1623 ``color.'' This callback is effective only when the user provides a
1624 color map (`GLU_MAP1_COLOR_4' or `GLU_MAP2_COLOR_4'). ``color''
1625 contains four components: R, G, B, A. The default color callback
1626 function is NULL. The prototype for this callback function looks
1629 `GLU_NURBS_COLOR_DATA'
1632 The same as the `GLU_NURBS_COLOR' callback except that it takes an
1633 additional pointer argument. This pointer is a copy of the pointer
1634 that was specified at the last call to `gluNurbsCallbackData'. The
1635 default callback function is NULL. The function prototype for this
1636 callback function looks like:
1638 `GLU_NURBS_TEXTURE_COORD'
1641 The texture callback is invoked as the texture coordinates of a
1642 vertex are generated. These coordinates are stored in the parameter
1643 ``texCoord.'' The number of texture coordinates can be 1, 2, 3, or
1644 4 depending on which type of texture map is specified
1645 (`GLU_MAP1_TEXTURE_COORD_1', `GLU_MAP1_TEXTURE_COORD_2',
1646 `GLU_MAP1_TEXTURE_COORD_3', `GLU_MAP1_TEXTURE_COORD_4',
1647 `GLU_MAP2_TEXTURE_COORD_1', `GLU_MAP2_TEXTURE_COORD_2',
1648 `GLU_MAP2_TEXTURE_COORD_3', `GLU_MAP2_TEXTURE_COORD_4'). If no
1649 texture map is specified, this callback function will not be
1650 called. The default texture callback function is NULL. The function
1651 prototype for this callback function looks like:
1653 `GLU_NURBS_TEXTURE_COORD_DATA'
1656 This is the same as the `GLU_NURBS_TEXTURE_COORD' callback, except
1657 that it takes an additional pointer argument. This pointer is a
1658 copy of the pointer that was specified at the last call to
1659 `gluNurbsCallbackData'. The default callback function is NULL. The
1660 function prototype for this callback function looks like:
1665 The end callback is invoked at the end of a primitive. The default
1666 end callback function is NULL. The function prototype for this
1667 callback function looks like:
1669 `GLU_NURBS_END_DATA'
1672 This is the same as the `GLU_NURBS_END' callback, except that it
1673 takes an additional pointer argument. This pointer is a copy of the
1674 pointer that was specified at the last call to
1675 `gluNurbsCallbackData'. The default callback function is NULL. The
1676 function prototype for this callback function looks like:
1681 The error function is called when an error is encountered. Its
1682 single argument is of type GLenum, and it indicates the specific
1683 error that occurred. There are 37 errors unique to NURBS, named
1684 `GLU_NURBS_ERROR1' through `GLU_NURBS_ERROR37'. Character strings
1685 describing these errors can be retrieved with `gluErrorString'.
1688 void begin( GLenum type );
1691 void beginData(GLenum type, void *userData);
1694 void vertex( GLfloat *vertex );
1697 void vertexData( GLfloat *vertex, void *userData );
1700 void normal( GLfloat *normal );
1703 void normalData( GLfloat *normal, void *userData );
1706 void color( GLfloat *color );
1709 void colorData( GLfloat *color, void *userData );
1712 void texCoord( GLfloat *texCoord );
1715 void texCoordData( GLfloat *texCoord, void *userData );
1721 void endData( void *userData );")
1723 (define-foreign-procedures
1734 "Define the shape of a NURBS curve.
1737 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1740 Specifies the number of knots in KNOTS. KNOTCOUNT equals the number
1741 of control points plus the order.
1744 Specifies an array of KNOTCOUNT nondecreasing knot values.
1747 Specifies the offset (as a number of single-precision
1748 floating-point values) between successive curve control points.
1751 Specifies a pointer to an array of control points. The coordinates
1752 must agree with TYPE, specified below.
1755 Specifies the order of the NURBS curve. ORDER equals degree + 1,
1756 hence a cubic curve has an order of 4.
1759 Specifies the type of the curve. If this curve is defined within a
1760 `gluBeginCurve'/`gluEndCurve' pair, then the type can be any of the
1761 valid one-dimensional evaluator types (such as `GLU_MAP1_VERTEX_3'
1762 or `GLU_MAP1_COLOR_4'). Between a `gluBeginTrim'/`gluEndTrim' pair,
1763 the only valid types are `GLU_MAP1_TRIM_2' and `GLU_MAP1_TRIM_3'.
1765 Use `gluNurbsCurve' to describe a NURBS curve.
1767 When `gluNurbsCurve' appears between a `gluBeginCurve'/`gluEndCurve'
1768 pair, it is used to describe a curve to be rendered. Positional,
1769 texture, and color coordinates are associated by presenting each as a
1770 separate `gluNurbsCurve' between a `gluBeginCurve'/`gluEndCurve' pair.
1771 No more than one call to `gluNurbsCurve' for each of color, position,
1772 and texture data can be made within a single
1773 `gluBeginCurve'/`gluEndCurve' pair. Exactly one call must be made to
1774 describe the position of the curve (a TYPE of `GLU_MAP1_VERTEX_3' or
1775 `GLU_MAP1_VERTEX_4').
1777 When `gluNurbsCurve' appears between a `gluBeginTrim'/`gluEndTrim' pair,
1778 it is used to describe a trimming curve on a NURBS surface. If TYPE is
1779 `GLU_MAP1_TRIM_2', then it describes a curve in two-dimensional (U and
1780 V) parameter space. If it is `GLU_MAP1_TRIM_3', then it describes a
1781 curve in two-dimensional homogeneous (U, V, and W) parameter space. See
1782 the `gluBeginTrim' reference page for more discussion about trimming
1785 (define-foreign-procedures
1792 "Set a NURBS property.
1795 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1798 Specifies the property to be set. Valid values are
1799 `GLU_SAMPLING_TOLERANCE', `GLU_DISPLAY_MODE', `GLU_CULLING',
1800 `GLU_AUTO_LOAD_MATRIX', `GLU_PARAMETRIC_TOLERANCE',
1801 `GLU_SAMPLING_METHOD', `GLU_U_STEP', `GLU_V_STEP', or
1805 Specifies the value of the indicated property. It may be a numeric
1806 value or one of `GLU_OUTLINE_POLYGON', `GLU_FILL',
1807 `GLU_OUTLINE_PATCH', `GLU_TRUE', `GLU_FALSE', `GLU_PATH_LENGTH',
1808 `GLU_PARAMETRIC_ERROR', `GLU_DOMAIN_DISTANCE',
1809 `GLU_NURBS_RENDERER', or `GLU_NURBS_TESSELLATOR'.
1811 `gluNurbsProperty' is used to control properties stored in a NURBS
1812 object. These properties affect the way that a NURBS curve is rendered.
1813 The accepted values for PROPERTY are as follows:
1816 VALUE should be set to be either `GLU_NURBS_RENDERER' or
1817 `GLU_NURBS_TESSELLATOR'. When set to `GLU_NURBS_RENDERER', NURBS
1818 objects are tessellated into OpenGL primitives and sent to the
1819 pipeline for rendering. When set to `GLU_NURBS_TESSELLATOR', NURBS
1820 objects are tessellated into OpenGL primitives but the vertices,
1821 normals, colors, and/or textures are retrieved back through a
1822 callback interface (see `gluNurbsCallback'). This allows the user
1823 to cache the tessellated results for further processing. The
1824 initial value is `GLU_NURBS_RENDERER'.
1826 `GLU_SAMPLING_METHOD'
1827 Specifies how a NURBS surface should be tessellated. VALUE may be
1828 one of `GLU_PATH_LENGTH', `GLU_PARAMETRIC_ERROR',
1829 `GLU_DOMAIN_DISTANCE', `GLU_OBJECT_PATH_LENGTH', or
1830 `GLU_OBJECT_PARAMETRIC_ERROR'. When set to `GLU_PATH_LENGTH', the
1831 surface is rendered so that the maximum length, in pixels, of the
1832 edges of the tessellation polygons is no greater than what is
1833 specified by `GLU_SAMPLING_TOLERANCE'.
1835 `GLU_PARAMETRIC_ERROR' specifies that the surface is rendered in
1836 such a way that the value specified by `GLU_PARAMETRIC_TOLERANCE'
1837 describes the maximum distance, in pixels, between the tessellation
1838 polygons and the surfaces they approximate.
1840 `GLU_DOMAIN_DISTANCE' allows users to specify, in parametric
1841 coordinates, how many sample points per unit length are taken in U,
1844 `GLU_OBJECT_PATH_LENGTH' is similar to `GLU_PATH_LENGTH' except
1845 that it is view independent; that is, the surface is rendered so
1846 that the maximum length, in object space, of edges of the
1847 tessellation polygons is no greater than what is specified by
1848 `GLU_SAMPLING_TOLERANCE'.
1850 `GLU_OBJECT_PARAMETRIC_ERROR' is similar to `GLU_PARAMETRIC_ERROR'
1851 except that it is view independent; that is, the surface is
1852 rendered in such a way that the value specified by
1853 `GLU_PARAMETRIC_TOLERANCE' describes the maximum distance, in
1854 object space, between the tessellation polygons and the surfaces
1857 The initial value of `GLU_SAMPLING_METHOD' is `GLU_PATH_LENGTH'.
1859 `GLU_SAMPLING_TOLERANCE'
1860 Specifies the maximum length, in pixels or in object space length
1861 unit, to use when the sampling method is set to `GLU_PATH_LENGTH'
1862 or `GLU_OBJECT_PATH_LENGTH'. The NURBS code is conservative when
1863 rendering a curve or surface, so the actual length can be somewhat
1864 shorter. The initial value is 50.0 pixels.
1866 `GLU_PARAMETRIC_TOLERANCE'
1867 Specifies the maximum distance, in pixels or in object space length
1868 unit, to use when the sampling method is `GLU_PARAMETRIC_ERROR' or
1869 `GLU_OBJECT_PARAMETRIC_ERROR'. The initial value is 0.5.
1872 Specifies the number of sample points per unit length taken along
1873 the U axis in parametric coordinates. It is needed when
1874 `GLU_SAMPLING_METHOD' is set to `GLU_DOMAIN_DISTANCE'. The initial
1878 Specifies the number of sample points per unit length taken along
1879 the V axis in parametric coordinate. It is needed when
1880 `GLU_SAMPLING_METHOD' is set to `GLU_DOMAIN_DISTANCE'. The initial
1884 VALUE can be set to `GLU_OUTLINE_POLYGON', `GLU_FILL', or
1885 `GLU_OUTLINE_PATCH'. When `GLU_NURBS_MODE' is set to be
1886 `GLU_NURBS_RENDERER', VALUE defines how a NURBS surface should be
1887 rendered. When VALUE is set to `GLU_FILL', the surface is rendered
1888 as a set of polygons. When VALUE is set to `GLU_OUTLINE_POLYGON',
1889 the NURBS library draws only the outlines of the polygons created
1890 by tessellation. When VALUE is set to `GLU_OUTLINE_PATCH' just the
1891 outlines of patches and trim curves defined by the user are drawn.
1893 When `GLU_NURBS_MODE' is set to be `GLU_NURBS_TESSELLATOR', VALUE
1894 defines how a NURBS surface should be tessellated. When
1895 `GLU_DISPLAY_MODE' is set to `GLU_FILL' or `GLU_OUTLINE_POLYGON',
1896 the NURBS surface is tessellated into OpenGL triangle primitives
1897 that can be retrieved back through callback functions. If
1898 `GLU_DISPLAY_MODE' is set to `GLU_OUTLINE_PATCH', only the outlines
1899 of the patches and trim curves are generated as a sequence of line
1900 strips that can be retrieved back through callback functions.
1902 The initial value is `GLU_FILL'.
1905 VALUE is a boolean value that, when set to `GLU_TRUE', indicates
1906 that a NURBS curve should be discarded prior to tessellation if its
1907 control points lie outside the current viewport. The initial value
1910 `GLU_AUTO_LOAD_MATRIX'
1911 VALUE is a boolean value. When set to `GLU_TRUE', the NURBS code
1912 downloads the projection matrix, the modelview matrix, and the
1913 viewport from the GL server to compute sampling and culling
1914 matrices for each NURBS curve that is rendered. Sampling and
1915 culling matrices are required to determine the tessellation of a
1916 NURBS surface into line segments or polygons and to cull a NURBS
1917 surface if it lies outside the viewport.
1919 If this mode is set to `GLU_FALSE', then the program needs to
1920 provide a projection matrix, a modelview matrix, and a viewport for
1921 the NURBS renderer to use to construct sampling and culling
1922 matrices. This can be done with the `gluLoadSamplingMatrices'
1923 function. This mode is initially set to `GLU_TRUE'. Changing it
1924 from `GLU_TRUE' to `GLU_FALSE' does not affect the sampling and
1925 culling matrices until `gluLoadSamplingMatrices' is called.")
1927 (define-foreign-procedures
1942 "Define the shape of a NURBS surface.
1945 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1948 Specifies the number of knots in the parametric U direction.
1951 Specifies an array of SKNOTCOUNT nondecreasing knot values in the
1952 parametric U direction.
1955 Specifies the number of knots in the parametric V direction.
1958 Specifies an array of TKNOTCOUNT nondecreasing knot values in the
1959 parametric V direction.
1962 Specifies the offset (as a number of single-precision
1963 floating-point values) between successive control points in the
1964 parametric U direction in CONTROL.
1967 Specifies the offset (in single-precision floating-point values)
1968 between successive control points in the parametric V direction in
1972 Specifies an array containing control points for the NURBS surface.
1973 The offsets between successive control points in the parametric U
1974 and V directions are given by SSTRIDE and TSTRIDE.
1977 Specifies the order of the NURBS surface in the parametric U
1978 direction. The order is one more than the degree, hence a surface
1979 that is cubic in U has a U order of 4.
1982 Specifies the order of the NURBS surface in the parametric V
1983 direction. The order is one more than the degree, hence a surface
1984 that is cubic in V has a V order of 4.
1987 Specifies type of the surface. TYPE can be any of the valid
1988 two-dimensional evaluator types (such as `GLU_MAP2_VERTEX_3' or
1989 `GLU_MAP2_COLOR_4').
1991 Use `gluNurbsSurface' within a NURBS (Non-Uniform Rational B-Spline)
1992 surface definition to describe the shape of a NURBS surface (before any
1993 trimming). To mark the beginning of a NURBS surface definition, use the
1994 `gluBeginSurface' command. To mark the end of a NURBS surface
1995 definition, use the `gluEndSurface' command. Call `gluNurbsSurface'
1996 within a NURBS surface definition only.
1998 Positional, texture, and color coordinates are associated with a surface
1999 by presenting each as a separate `gluNurbsSurface' between a
2000 `gluBeginSurface'/`gluEndSurface' pair. No more than one call to
2001 `gluNurbsSurface' for each of color, position, and texture data can be
2002 made within a single `gluBeginSurface'/`gluEndSurface' pair. Exactly one
2003 call must be made to describe the position of the surface (a TYPE of
2004 `GLU_MAP2_VERTEX_3' or `GLU_MAP2_VERTEX_4').
2006 A NURBS surface can be trimmed by using the commands `gluNurbsCurve' and
2007 `gluPwlCurve' between calls to `gluBeginTrim' and `gluEndTrim'.
2009 Note that a `gluNurbsSurface' with SKNOTCOUNT knots in the U direction
2010 and TKNOTCOUNT knots in the V direction with orders SORDER and TORDER
2011 must have (SKNOTCOUNT - SORDER) TIMES (TKNOTCOUNT - TORDER) control
2014 (define-foreign-procedures
2022 "Define a 2D orthographic projection matrix.
2027 Specify the coordinates for the left and right vertical clipping
2033 Specify the coordinates for the bottom and top horizontal clipping
2036 `gluOrtho2D' sets up a two-dimensional orthographic viewing region. This
2037 is equivalent to calling `glOrtho' with NEAR=-1 and FAR=1 .")
2039 (define-foreign-procedures
2050 "Draw an arc of a disk.
2053 Specifies a quadrics object (created with `gluNewQuadric').
2056 Specifies the inner radius of the partial disk (can be 0).
2059 Specifies the outer radius of the partial disk.
2062 Specifies the number of subdivisions around the Z axis.
2065 Specifies the number of concentric rings about the origin into
2066 which the partial disk is subdivided.
2069 Specifies the starting angle, in degrees, of the disk portion.
2072 Specifies the sweep angle, in degrees, of the disk portion.
2074 `gluPartialDisk' renders a partial disk on the Z=0 plane. A partial disk
2075 is similar to a full disk, except that only the subset of the disk from
2076 START through START + SWEEP is included (where 0 degrees is along the
2077 +\\f2y\\f axis, 90 degrees along the +X axis, 180 degrees along the \\-Y
2078 axis, and 270 degrees along the \\-X axis).
2080 The partial disk has a radius of OUTER and contains a concentric
2081 circular hole with a radius of INNER. If INNER is 0, then no hole is
2082 generated. The partial disk is subdivided around the Z axis into slices
2083 (like pizza slices) and also about the Z axis into rings (as specified
2084 by SLICES and LOOPS, respectively).
2086 With respect to orientation, the +Z side of the partial disk is
2087 considered to be outside (see `gluQuadricOrientation'). This means that
2088 if the orientation is set to `GLU_OUTSIDE', then any normals generated
2089 point along the +Z axis. Otherwise, they point along the \\-Z axis.
2091 If texturing is turned on (with `gluQuadricTexture'), texture
2092 coordinates are generated linearly such that where R=OUTER , the value
2093 at (R, 0, 0) is (1.0, 0.5), at (0, R, 0) it is (0.5, 1.0), at (\\-R, 0,
2094 0) it is (0.0, 0.5), and at (0, \\-R, 0) it is (0.5, 0.0).")
2096 (define-foreign-procedures
2104 "Set up a perspective projection matrix.
2107 Specifies the field of view angle, in degrees, in the Y direction.
2110 Specifies the aspect ratio that determines the field of view in the
2111 X direction. The aspect ratio is the ratio of X (width) to Y
2115 Specifies the distance from the viewer to the near clipping plane
2119 Specifies the distance from the viewer to the far clipping plane
2122 `gluPerspective' specifies a viewing frustum into the world coordinate
2123 system. In general, the aspect ratio in `gluPerspective' should match
2124 the aspect ratio of the associated viewport. For example, ASPECT=2.0
2125 means the viewer's angle of view is twice as wide in X as it is in Y. If
2126 the viewport is twice as wide as it is tall, it displays the image
2129 The matrix generated by `gluPerspective' is multipled by the current
2130 matrix, just as if `glMultMatrix' were called with the generated matrix.
2131 To load the perspective matrix onto the current matrix stack instead,
2132 precede the call to `gluPerspective' with a call to `glLoadIdentity'.
2134 Given F defined as follows:
2136 F=COTANGENT\u2061(FOVY/2,) The generated matrix is
2138 ((F/ASPECT 0 0 0), (0 F 0 0), (0 0 ZFAR+ZNEAR,/ZNEAR-ZFAR,
2139 2×ZFAR×ZNEAR,/ZNEAR-ZFAR,), (0 0 -1 0),)")
2141 (define-foreign-procedures
2150 "Define a picking region.
2155 Specify the center of a picking region in window coordinates.
2160 Specify the width and height, respectively, of the picking region
2161 in window coordinates.
2164 Specifies the current viewport (as from a `glGetIntegerv' call).
2166 `gluPickMatrix' creates a projection matrix that can be used to restrict
2167 drawing to a small region of the viewport. This is typically useful to
2168 determine what objects are being drawn near the cursor. Use
2169 `gluPickMatrix' to restrict drawing to a small region around the cursor.
2170 Then, enter selection mode (with `glRenderMode') and rerender the scene.
2171 All primitives that would have been drawn near the cursor are identified
2172 and stored in the selection buffer.
2174 The matrix created by `gluPickMatrix' is multiplied by the current
2175 matrix just as if `glMultMatrix' is called with the generated matrix. To
2176 effectively use the generated pick matrix for picking, first call
2177 `glLoadIdentity' to load an identity matrix onto the perspective matrix
2178 stack. Then call `gluPickMatrix', and, finally, call a command (such as
2179 `gluPerspective') to multiply the perspective matrix by the pick matrix.
2181 When using `gluPickMatrix' to pick NURBS, be careful to turn off the
2182 NURBS property `GLU_AUTO_LOAD_MATRIX'. If `GLU_AUTO_LOAD_MATRIX' is not
2183 turned off, then any NURBS surface rendered is subdivided differently
2184 with the pick matrix than the way it was subdivided without the pick
2187 (define-foreign-procedures
2192 (model const-GLdouble-*)
2193 (proj const-GLdouble-*)
2194 (view const-GLint-*)
2200 "Map object coordinates to window coordinates.
2207 Specify the object coordinates.
2210 Specifies the current modelview matrix (as from a `glGetDoublev'
2214 Specifies the current projection matrix (as from a `glGetDoublev'
2218 Specifies the current viewport (as from a `glGetIntegerv' call).
2225 Return the computed window coordinates.
2227 `gluProject' transforms the specified object coordinates into window
2228 coordinates using MODEL, PROJ, and VIEW. The result is stored in WINX,
2229 WINY, and WINZ. A return value of `GLU_TRUE' indicates success, a return
2230 value of `GLU_FALSE' indicates failure.
2232 To compute the coordinates, let V=(OBJX,OBJYOBJZ1.0) represented as a
2233 matrix with 4 rows and 1 column. Then `gluProject' computes V^″ as
2238 where P is the current projection matrix PROJ and M is the current
2239 modelview matrix MODEL (both represented as 4×4 matrices in column-major
2242 The window coordinates are then computed as follows:
2244 WINX=VIEW\u2061(0,)+VIEW\u2061(2,)×(V^″\u2061(0,)+1,)/2
2245 WINY=VIEW\u2061(1,)+VIEW\u2061(3,)×(V^″\u2061(1,)+1,)/2 WINZ=(V^″\u2061(2,)+1,)/2")
2247 (define-foreign-procedures
2256 "Describe a piecewise linear NURBS trimming curve.
2259 Specifies the NURBS object (created with `gluNewNurbsRenderer').
2262 Specifies the number of points on the curve.
2265 Specifies an array containing the curve points.
2268 Specifies the offset (a number of single-precision floating-point
2269 values) between points on the curve.
2272 Specifies the type of curve. Must be either `GLU_MAP1_TRIM_2' or
2275 `gluPwlCurve' describes a piecewise linear trimming curve for a NURBS
2276 surface. A piecewise linear curve consists of a list of coordinates of
2277 points in the parameter space for the NURBS surface to be trimmed. These
2278 points are connected with line segments to form a curve. If the curve is
2279 an approximation to a curve that is not piecewise linear, the points
2280 should be close enough in parameter space that the resulting path
2281 appears curved at the resolution used in the application.
2283 If TYPE is `GLU_MAP1_TRIM_2', then it describes a curve in
2284 two-dimensional (U and V) parameter space. If it is `GLU_MAP1_TRIM_3',
2285 then it describes a curve in two-dimensional homogeneous (U, V, and W)
2286 parameter space. See the `gluBeginTrim' reference page for more
2287 information about trimming curves.")
2289 (define-foreign-procedures
2290 ((gluQuadricCallback
2293 (CallBackFunc _GLUfuncptr)
2296 "Define a callback for a quadrics object.
2299 Specifies the quadrics object (created with `gluNewQuadric').
2302 Specifies the callback being defined. The only valid value is
2306 Specifies the function to be called.
2308 `gluQuadricCallback' is used to define a new callback to be used by a
2309 quadrics object. If the specified callback is already defined, then it
2310 is replaced. If CALLBACKFUNC is NULL, then any existing callback is
2313 The one legal callback is `GLU_ERROR':
2316 The function is called when an error is encountered. Its single
2317 argument is of type GLenum, and it indicates the specific error
2318 that occurred. Character strings describing these errors can be
2319 retrieved with the `gluErrorString' call.")
2321 (define-foreign-procedures
2322 ((gluQuadricDrawStyle
2327 "Specify the draw style desired for quadrics.
2330 Specifies the quadrics object (created with `gluNewQuadric').
2333 Specifies the desired draw style. Valid values are `GLU_FILL',
2334 `GLU_LINE', `GLU_SILHOUETTE', and `GLU_POINT'.
2336 `gluQuadricDrawStyle' specifies the draw style for quadrics rendered
2337 with QUAD. The legal values are as follows:
2340 Quadrics are rendered with polygon primitives. The polygons are
2341 drawn in a counterclockwise fashion with respect to their normals
2342 (as defined with `gluQuadricOrientation').
2345 Quadrics are rendered as a set of lines.
2348 Quadrics are rendered as a set of lines, except that edges
2349 separating coplanar faces will not be drawn.
2352 Quadrics are rendered as a set of points.")
2354 (define-foreign-procedures
2360 "Specify what kind of normals are desired for quadrics.
2363 Specifies the quadrics object (created with `gluNewQuadric').
2366 Specifies the desired type of normals. Valid values are `GLU_NONE',
2367 `GLU_FLAT', and `GLU_SMOOTH'.
2369 `gluQuadricNormals' specifies what kind of normals are desired for
2370 quadrics rendered with QUAD. The legal values are as follows:
2373 No normals are generated.
2376 One normal is generated for every facet of a quadric.
2379 One normal is generated for every vertex of a quadric. This is the
2382 (define-foreign-procedures
2383 ((gluQuadricOrientation
2385 (orientation GLenum)
2388 "Specify inside/outside orientation for quadrics.
2391 Specifies the quadrics object (created with `gluNewQuadric').
2394 Specifies the desired orientation. Valid values are `GLU_OUTSIDE'
2397 `gluQuadricOrientation' specifies what kind of orientation is desired
2398 for quadrics rendered with QUAD. The ORIENTATION values are as follows:
2401 Quadrics are drawn with normals pointing outward (the initial
2405 Quadrics are drawn with normals pointing inward.
2407 Note that the interpretation of OUTWARD and INWARD depends on the
2408 quadric being drawn.")
2410 (define-foreign-procedures
2416 "Specify if texturing is desired for quadrics.
2419 Specifies the quadrics object (created with `gluNewQuadric').
2422 Specifies a flag indicating if texture coordinates should be
2425 `gluQuadricTexture' specifies if texture coordinates should be generated
2426 for quadrics rendered with QUAD. If the value of TEXTURE is `GLU_TRUE',
2427 then texture coordinates are generated, and if TEXTURE is `GLU_FALSE',
2428 they are not. The initial value is `GLU_FALSE'.
2430 The manner in which texture coordinates are generated depends upon the
2431 specific quadric rendered.")
2433 (define-foreign-procedures
2439 (dataIn const-void-*)
2446 "Scale an image to an arbitrary size.
2449 Specifies the format of the pixel data. The following symbolic
2450 values are valid: `GLU_COLOR_INDEX', `GLU_STENCIL_INDEX',
2451 `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN', `GLU_BLUE',
2452 `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR', `GLU_BGRA',
2453 `GLU_LUMINANCE', and `GLU_LUMINANCE_ALPHA'.
2458 Specify in pixels the width and height, respectively, of the source
2462 Specifies the data type for DATAIN. Must be one of
2463 `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP',
2464 `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT',
2465 `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2',
2466 `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5',
2467 `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4',
2468 `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1',
2469 `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8',
2470 `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or
2471 `GLU_UNSIGNED_INT_2_10_10_10_REV'.
2474 Specifies a pointer to the source image.
2479 Specify the width and height, respectively, in pixels of the
2483 Specifies the data type for DATAOUT. Must be one of
2484 `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP',
2485 `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT',
2486 `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2',
2487 `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5',
2488 `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4',
2489 `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1',
2490 `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8',
2491 `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or
2492 `GLU_UNSIGNED_INT_2_10_10_10_REV'.
2495 Specifies a pointer to the destination image.
2497 `gluScaleImage' scales a pixel image using the appropriate pixel store
2498 modes to unpack data from the source image and pack data into the
2501 When shrinking an image, `gluScaleImage' uses a box filter to sample the
2502 source image and create pixels for the destination image. When
2503 magnifying an image, the pixels from the source image are linearly
2504 interpolated to create the destination image.
2506 A return value of zero indicates success, otherwise a GLU error code is
2507 returned (see `gluErrorString').
2509 See the `glReadPixels' reference page for a description of the
2510 acceptable values for the FORMAT, TYPEIN, and TYPEOUT parameters.
2512 `GLU_INVALID_VALUE' is returned if WIN, HIN, WOUT, or HOUT is negative.
2514 `GLU_INVALID_ENUM' is returned if FORMAT, TYPEIN, or TYPEOUT is not
2517 `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is
2518 `GLU_UNSIGNED_BYTE_3_3_2' or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is
2521 `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is
2522 `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
2525 `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is
2526 `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and
2527 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
2529 `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is
2530 `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and
2531 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.
2533 `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is
2534 `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT
2535 is neither `GLU_RGBA' nor `GLU_BGRA'.
2537 `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is
2538 `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and
2539 FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.")
2541 (define-foreign-procedures
2552 Specifies the quadrics object (created with `gluNewQuadric').
2555 Specifies the radius of the sphere.
2558 Specifies the number of subdivisions around the Z axis (similar to
2559 lines of longitude).
2562 Specifies the number of subdivisions along the Z axis (similar to
2565 `gluSphere' draws a sphere of the given radius centered around the
2566 origin. The sphere is subdivided around the Z axis into slices and along
2567 the Z axis into stacks (similar to lines of longitude and latitude).
2569 If the orientation is set to `GLU_OUTSIDE' (with
2570 `gluQuadricOrientation'), then any normals generated point away from the
2571 center of the sphere. Otherwise, they point toward the center of the
2574 If texturing is turned on (with `gluQuadricTexture'), then texture
2575 coordinates are generated so that T ranges from 0.0 at Z=-RADIUS to 1.0
2576 at Z=RADIUS (T increases linearly along longitudinal lines), and S
2577 ranges from 0.0 at the +Y axis, to 0.25 at the +X axis, to 0.5 at the
2578 \\-Y axis, to 0.75 at the \\-X axis, and back to 1.0 at the +Y axis.")
2580 (define-foreign-procedures
2581 ((gluTessBeginContour
2582 (tess GLUtesselator*)
2585 (gluTessEndContour (tess GLUtesselator*) -> void))
2586 "Delimit a contour description.
2589 Specifies the tessellation object (created with `gluNewTess').
2591 `gluTessBeginContour' and `gluTessEndContour' delimit the definition of
2592 a polygon contour. Within each `gluTessBeginContour'/`gluTessEndContour'
2593 pair, there can be zero or more calls to `gluTessVertex'. The vertices
2594 specify a closed contour (the last vertex of each contour is
2595 automatically linked to the first). See the `gluTessVertex' reference
2596 page for more details. `gluTessBeginContour' can only be called between
2597 `gluTessBeginPolygon' and `gluTessEndPolygon'.")
2599 (define-foreign-procedures
2600 ((gluTessBeginPolygon
2601 (tess GLUtesselator*)
2605 "Delimit a polygon description.
2608 Specifies the tessellation object (created with `gluNewTess').
2611 Specifies a pointer to user polygon data.
2613 `gluTessBeginPolygon' and `gluTessEndPolygon' delimit the definition of
2614 a convex, concave or self-intersecting polygon. Within each
2615 `gluTessBeginPolygon'/`gluTessEndPolygon' pair, there must be one or
2616 more calls to `gluTessBeginContour'/`gluTessEndContour'. Within each
2617 contour, there are zero or more calls to `gluTessVertex'. The vertices
2618 specify a closed contour (the last vertex of each contour is
2619 automatically linked to the first). See the `gluTessVertex',
2620 `gluTessBeginContour', and `gluTessEndContour' reference pages for more
2623 DATA is a pointer to a user-defined data structure. If the appropriate
2624 callback(s) are specified (see `gluTessCallback'), then this pointer is
2625 returned to the callback function(s). Thus, it is a convenient way to
2626 store per-polygon information.
2628 Once `gluTessEndPolygon' is called, the polygon is tessellated, and the
2629 resulting triangles are described through callbacks. See
2630 `gluTessCallback' for descriptions of the callback functions.")
2632 (define-foreign-procedures
2634 (tess GLUtesselator*)
2636 (CallBackFunc _GLUfuncptr)
2639 "Define a callback for a tessellation object.
2642 Specifies the tessellation object (created with `gluNewTess').
2645 Specifies the callback being defined. The following values are
2646 valid: `GLU_TESS_BEGIN', `GLU_TESS_BEGIN_DATA',
2647 `GLU_TESS_EDGE_FLAG', `GLU_TESS_EDGE_FLAG_DATA', `GLU_TESS_VERTEX',
2648 `GLU_TESS_VERTEX_DATA', `GLU_TESS_END', `GLU_TESS_END_DATA',
2649 `GLU_TESS_COMBINE', `GLU_TESS_COMBINE_DATA', `GLU_TESS_ERROR', and
2650 `GLU_TESS_ERROR_DATA'.
2653 Specifies the function to be called.
2655 `gluTessCallback' is used to indicate a callback to be used by a
2656 tessellation object. If the specified callback is already defined, then
2657 it is replaced. If CALLBACKFUNC is NULL, then the existing callback
2660 These callbacks are used by the tessellation object to describe how a
2661 polygon specified by the user is broken into triangles. Note that there
2662 are two versions of each callback: one with user-specified polygon data
2663 and one without. If both versions of a particular callback are
2664 specified, then the callback with user-specified polygon data will be
2665 used. Note that the POLYGON_DATA parameter used by some of the functions
2666 is a copy of the pointer that was specified when `gluTessBeginPolygon'
2667 was called. The legal callbacks are as follows:
2670 The begin callback is invoked like `glBegin' to indicate the start
2671 of a (triangle) primitive. The function takes a single argument of
2672 type GLenum. If the `GLU_TESS_BOUNDARY_ONLY' property is set to
2673 `GLU_FALSE', then the argument is set to either `GLU_TRIANGLE_FAN',
2674 `GLU_TRIANGLE_STRIP', or `GLU_TRIANGLES'. If the
2675 `GLU_TESS_BOUNDARY_ONLY' property is set to `GLU_TRUE', then the
2676 argument will be set to `GLU_LINE_LOOP'. The function prototype for
2679 `GLU_TESS_BEGIN_DATA'
2680 The same as the `GLU_TESS_BEGIN' callback except that it takes an
2681 additional pointer argument. This pointer is identical to the
2682 opaque pointer provided when `gluTessBeginPolygon' was called. The
2683 function prototype for this callback is:
2685 `GLU_TESS_EDGE_FLAG'
2686 The edge flag callback is similar to `glEdgeFlag'. The function
2687 takes a single boolean flag that indicates which edges lie on the
2688 polygon boundary. If the flag is `GLU_TRUE', then each vertex that
2689 follows begins an edge that lies on the polygon boundary, that is,
2690 an edge that separates an interior region from an exterior one. If
2691 the flag is `GLU_FALSE', then each vertex that follows begins an
2692 edge that lies in the polygon interior. The edge flag callback (if
2693 defined) is invoked before the first vertex callback.
2695 Since triangle fans and triangle strips do not support edge flags,
2696 the begin callback is not called with `GLU_TRIANGLE_FAN' or
2697 `GLU_TRIANGLE_STRIP' if a non-NULL edge flag callback is provided.
2698 (If the callback is initialized to NULL, there is no impact on
2699 performance). Instead, the fans and strips are converted to
2700 independent triangles. The function prototype for this callback is:
2702 `GLU_TESS_EDGE_FLAG_DATA'
2703 The same as the `GLU_TESS_EDGE_FLAG' callback except that it takes
2704 an additional pointer argument. This pointer is identical to the
2705 opaque pointer provided when `gluTessBeginPolygon' was called. The
2706 function prototype for this callback is:
2709 The vertex callback is invoked between the begin and end callbacks.
2710 It is similar to `glVertex', and it defines the vertices of the
2711 triangles created by the tessellation process. The function takes a
2712 pointer as its only argument. This pointer is identical to the
2713 opaque pointer provided by the user when the vertex was described
2714 (see `gluTessVertex'). The function prototype for this callback is:
2716 `GLU_TESS_VERTEX_DATA'
2717 The same as the `GLU_TESS_VERTEX' callback except that it takes an
2718 additional pointer argument. This pointer is identical to the
2719 opaque pointer provided when `gluTessBeginPolygon' was called. The
2720 function prototype for this callback is:
2723 The end callback serves the same purpose as `glEnd'. It indicates
2724 the end of a primitive and it takes no arguments. The function
2725 prototype for this callback is:
2728 The same as the `GLU_TESS_END' callback except that it takes an
2729 additional pointer argument. This pointer is identical to the
2730 opaque pointer provided when `gluTessBeginPolygon' was called. The
2731 function prototype for this callback is:
2734 The combine callback is called to create a new vertex when the
2735 tessellation detects an intersection or wishes to merge features.
2736 The function takes four arguments: an array of three elements each
2737 of type GLdouble, an array of four pointers, an array of four
2738 elements each of type GLfloat, and a pointer to a pointer. The
2741 The vertex is defined as a linear combination of up to four
2742 existing vertices, stored in VERTEX_DATA. The coefficients of the
2743 linear combination are given by WEIGHT; these weights always add up
2744 to 1. All vertex pointers are valid even when some of the weights
2745 are 0. COORDS gives the location of the new vertex.
2747 The user must allocate another vertex, interpolate parameters using
2748 VERTEX_DATA and WEIGHT, and return the new vertex pointer in
2749 OUTDATA. This handle is supplied during rendering callbacks. The
2750 user is responsible for freeing the memory some time after
2751 `gluTessEndPolygon' is called.
2753 For example, if the polygon lies in an arbitrary plane in 3-space,
2754 and a color is associated with each vertex, the `GLU_TESS_COMBINE'
2755 callback might look like this:
2757 If the tessellation detects an intersection, then the
2758 `GLU_TESS_COMBINE' or `GLU_TESS_COMBINE_DATA' callback (see below)
2759 must be defined, and it must write a non-NULL pointer into DATAOUT.
2760 Otherwise the `GLU_TESS_NEED_COMBINE_CALLBACK' error occurs, and no
2761 output is generated.
2763 `GLU_TESS_COMBINE_DATA'
2764 The same as the `GLU_TESS_COMBINE' callback except that it takes an
2765 additional pointer argument. This pointer is identical to the
2766 opaque pointer provided when `gluTessBeginPolygon' was called. The
2767 function prototype for this callback is:
2770 The error callback is called when an error is encountered. The one
2771 argument is of type GLenum; it indicates the specific error that
2772 occurred and will be set to one of
2773 `GLU_TESS_MISSING_BEGIN_POLYGON', `GLU_TESS_MISSING_END_POLYGON',
2774 `GLU_TESS_MISSING_BEGIN_CONTOUR', `GLU_TESS_MISSING_END_CONTOUR',
2775 `GLU_TESS_COORD_TOO_LARGE', `GLU_TESS_NEED_COMBINE_CALLBACK', or
2776 `GLU_OUT_OF_MEMORY'. Character strings describing these errors can
2777 be retrieved with the `gluErrorString' call. The function prototype
2778 for this callback is:
2780 The GLU library will recover from the first four errors by
2781 inserting the missing call(s). `GLU_TESS_COORD_TOO_LARGE' indicates
2782 that some vertex coordinate exceeded the predefined constant
2783 `GLU_TESS_MAX_COORD' in absolute value, and that the value has been
2784 clamped. (Coordinate values must be small enough so that two can be
2785 multiplied together without overflow.)
2786 `GLU_TESS_NEED_COMBINE_CALLBACK' indicates that the tessellation
2787 detected an intersection between two edges in the input data, and
2788 the `GLU_TESS_COMBINE' or `GLU_TESS_COMBINE_DATA' callback was not
2789 provided. No output is generated. `GLU_OUT_OF_MEMORY' indicates
2790 that there is not enough memory so no output is generated.
2792 `GLU_TESS_ERROR_DATA'
2793 The same as the `GLU_TESS_ERROR' callback except that it takes an
2794 additional pointer argument. This pointer is identical to the
2795 opaque pointer provided when `gluTessBeginPolygon' was called. The
2796 function prototype for this callback is:
2799 void begin( GLenum type );
2802 void beginData( GLenum type, void *polygon_data );
2805 void edgeFlag( GLboolean flag );
2808 void edgeFlagData( GLboolean flag, void *polygon_data );
2811 void vertex( void *vertex_data );
2814 void vertexData( void *vertex_data, void *polygon_data );
2820 void endData( void *polygon_data );
2823 void combine( GLdouble coords[3], void *vertex_data[4],
2824 GLfloat weight[4], void **outData );
2827 void myCombine( GLdouble coords[3], VERTEX *d[4],
2828 GLfloat w[4], VERTEX **dataOut )
2830 VERTEX *new = new_vertex();
2835 new->r = w[0]*d[0]->r + w[1]*d[1]->r + w[2]*d[2]->r + w[3]*d[3]->r;
2836 new->g = w[0]*d[0]->g + w[1]*d[1]->g + w[2]*d[2]->g + w[3]*d[3]->g;
2837 new->b = w[0]*d[0]->b + w[1]*d[1]->b + w[2]*d[2]->b + w[3]*d[3]->b;
2838 new->a = w[0]*d[0]->a + w[1]*d[1]->a + w[2]*d[2]->a + w[3]*d[3]->a;
2843 void combineData( GLdouble coords[3], void *vertex_data[4],
2844 GLfloat weight[4], void **outData,
2845 void *polygon_data );
2848 void error( GLenum errno );
2851 void errorData( GLenum errno, void *polygon_data );")
2853 (define-foreign-procedures
2854 ((gluTessEndPolygon (tess GLUtesselator*) -> void))
2855 "Delimit a polygon description.
2858 Specifies the tessellation object (created with `gluNewTess').
2860 `gluTessBeginPolygon' and `gluTessEndPolygon' delimit the definition of
2861 a convex, concave, or self-intersecting polygon. Within each
2862 `gluTessBeginPolygon'/`gluTessEndPolygon' pair, there must be one or
2863 more calls to `gluTessBeginContour'/`gluTessEndContour'. Within each
2864 contour, there are zero or more calls to `gluTessVertex'. The vertices
2865 specify a closed contour (the last vertex of each contour is
2866 automatically linked to the first). See the `gluTessVertex',
2867 `gluTessBeginContour', and `gluTessEndContour' reference pages for more
2870 Once `gluTessEndPolygon' is called, the polygon is tessellated, and the
2871 resulting triangles are described through callbacks. See
2872 `gluTessCallback' for descriptions of the callback functions.")
2874 (define-foreign-procedures
2876 (tess GLUtesselator*)
2882 "Specify a normal for a polygon.
2885 Specifies the tessellation object (created with `gluNewTess').
2888 Specifies the first component of the normal.
2891 Specifies the second component of the normal.
2894 Specifies the third component of the normal.
2896 `gluTessNormal' describes a normal for a polygon that the program is
2897 defining. All input data will be projected onto a plane perpendicular to
2898 one of the three coordinate axes before tessellation and all output
2899 triangles will be oriented CCW with respect to the normal (CW
2900 orientation can be obtained by reversing the sign of the supplied
2901 normal). For example, if you know that all polygons lie in the x-y
2902 plane, call `gluTessNormal'(tess, 0.0, 0.0, 1.0) before rendering any
2905 If the supplied normal is (0.0, 0.0, 0.0) (the initial value), the
2906 normal is determined as follows. The direction of the normal, up to its
2907 sign, is found by fitting a plane to the vertices, without regard to how
2908 the vertices are connected. It is expected that the input data lies
2909 approximately in the plane; otherwise, projection perpendicular to one
2910 of the three coordinate axes may substantially change the geometry. The
2911 sign of the normal is chosen so that the sum of the signed areas of all
2912 input contours is nonnegative (where a CCW contour has positive area).
2914 The supplied normal persists until it is changed by another call to
2917 (define-foreign-procedures
2919 (tess GLUtesselator*)
2924 "Set a tessellation object property.
2927 Specifies the tessellation object (created with `gluNewTess').
2930 Specifies the property to be set. Valid values are
2931 `GLU_TESS_WINDING_RULE', `GLU_TESS_BOUNDARY_ONLY', and
2932 `GLU_TESS_TOLERANCE'.
2935 Specifies the value of the indicated property.
2937 `gluTessProperty' is used to control properties stored in a tessellation
2938 object. These properties affect the way that the polygons are
2939 interpreted and rendered. The legal values for WHICH are as follows:
2941 `GLU_TESS_WINDING_RULE'
2942 Determines which parts of the polygon are on the ``interior''. DATA
2943 may be set to one of `GLU_TESS_WINDING_ODD',
2944 `GLU_TESS_WINDING_NONZERO', `GLU_TESS_WINDING_POSITIVE',
2945 `GLU_TESS_WINDING_NEGATIVE', or `GLU_TESS_WINDING_ABS_GEQ_TWO'.
2947 To understand how the winding rule works, consider that the input
2948 contours partition the plane into regions. The winding rule
2949 determines which of these regions are inside the polygon.
2951 For a single contour C, the winding number of a point x is simply
2952 the signed number of revolutions we make around x as we travel once
2953 around C (where CCW is positive). When there are several contours,
2954 the individual winding numbers are summed. This procedure
2955 associates a signed integer value with each point x in the plane.
2956 Note that the winding number is the same for all points in a single
2959 The winding rule classifies a region as ``inside'' if its winding
2960 number belongs to the chosen category (odd, nonzero, positive,
2961 negative, or absolute value of at least two). The previous GLU
2962 tessellator (prior to GLU 1.2) used the ``odd'' rule. The
2963 ``nonzero'' rule is another common way to define the interior. The
2964 other three rules are useful for polygon CSG operations.
2966 `GLU_TESS_BOUNDARY_ONLY'
2967 Is a boolean value (``value'' should be set to GL_TRUE or
2968 GL_FALSE). When set to GL_TRUE, a set of closed contours separating
2969 the polygon interior and exterior are returned instead of a
2970 tessellation. Exterior contours are oriented CCW with respect to
2971 the normal; interior contours are oriented CW. The `GLU_TESS_BEGIN'
2972 and `GLU_TESS_BEGIN_DATA' callbacks use the type GL_LINE_LOOP for
2975 `GLU_TESS_TOLERANCE'
2976 Specifies a tolerance for merging features to reduce the size of
2977 the output. For example, two vertices that are very close to each
2978 other might be replaced by a single vertex. The tolerance is
2979 multiplied by the largest coordinate magnitude of any input vertex;
2980 this specifies the maximum distance that any feature can move as
2981 the result of a single merge operation. If a single feature takes
2982 part in several merge operations, the total distance moved could be
2985 Feature merging is completely optional; the tolerance is only a
2986 hint. The implementation is free to merge in some cases and not in
2987 others, or to never merge features at all. The initial tolerance is
2990 The current implementation merges vertices only if they are exactly
2991 coincident, regardless of the current tolerance. A vertex is
2992 spliced into an edge only if the implementation is unable to
2993 distinguish which side of the edge the vertex lies on. Two edges
2994 are merged only when both endpoints are identical.")
2996 (define-foreign-procedures
2998 (tess GLUtesselator*)
2999 (location GLdouble-*)
3003 "Specify a vertex on a polygon.
3006 Specifies the tessellation object (created with `gluNewTess').
3009 Specifies the location of the vertex.
3012 Specifies an opaque pointer passed back to the program with the
3013 vertex callback (as specified by `gluTessCallback').
3015 `gluTessVertex' describes a vertex on a polygon that the program
3016 defines. Successive `gluTessVertex' calls describe a closed contour. For
3017 example, to describe a quadrilateral, `gluTessVertex' should be called
3018 four times. `gluTessVertex' can only be called between
3019 `gluTessBeginContour' and `gluTessEndContour'.
3021 DATA normally points to a structure containing the vertex location, as
3022 well as other per-vertex attributes such as color and normal. This
3023 pointer is passed back to the user through the `GLU_TESS_VERTEX' or
3024 `GLU_TESS_VERTEX_DATA' callback after tessellation (see the
3025 `gluTessCallback' reference page).")
3027 (define-foreign-procedures
3033 (model const-GLdouble-*)
3034 (proj const-GLdouble-*)
3035 (view const-GLint-*)
3044 "Map window and clip coordinates to object coordinates.
3051 Specify the window coordinates to be mapped.
3054 Specify the clip w coordinate to be mapped.
3057 Specifies the modelview matrix (as from a `glGetDoublev' call).
3060 Specifies the projection matrix (as from a `glGetDoublev' call).
3063 Specifies the viewport (as from a `glGetIntegerv' call).
3068 Specifies the near and far planes (as from a `glGetDoublev' call).
3077 Returns the computed object coordinates.
3079 `gluUnProject4' maps the specified window coordinatesi: WINX, WINY, and
3080 WINZ and its clip w coordinate CLIPW into object coordinates
3081 (OBJX,OBJYOBJZOBJW) using MODEL, PROJ, and VIEW. CLIPW can be other than
3082 1 as for vertices in `glFeedbackBuffer' when data type
3083 `GLU_4D_COLOR_TEXTURE' is returned. This also handles the case where the
3084 NEARVAL and FARVAL planes are different from the default, 0 and 1,
3085 respectively. A return value of `GLU_TRUE' indicates success; a return
3086 value of `GLU_FALSE' indicates failure.
3088 To compute the coordinates (OBJX,OBJYOBJZOBJW) , `gluUnProject4'
3089 multiplies the normalized device coordinates by the inverse of MODEL *
3092 ((OBJX), (OBJY), (OBJZ),
3093 (OBJW),)=INV\u2061(P\u2062M,)\u2062((2\u2061(WINX-VIEW\u2061[0,],),/VIEW\u2061[2,],-1),
3094 (2\u2061(WINY-VIEW\u2061[1,],),/VIEW\u2061[3,],-1),
3095 (2\u2061(WINZ-NEARVAL,),/(FARVAL-NEARVAL,),-1), (CLIPW),)
3097 INV denotes matrix inversion.
3099 `gluUnProject4' is equivalent to `gluUnProject' when CLIPW is 1, NEARVAL
3100 is 0, and FARVAL is 1.")
3102 (define-foreign-procedures
3107 (model const-GLdouble-*)
3108 (proj const-GLdouble-*)
3109 (view const-GLint-*)
3115 "Map window coordinates to object coordinates.
3122 Specify the window coordinates to be mapped.
3125 Specifies the modelview matrix (as from a `glGetDoublev' call).
3128 Specifies the projection matrix (as from a `glGetDoublev' call).
3131 Specifies the viewport (as from a `glGetIntegerv' call).
3138 Returns the computed object coordinates.
3140 `gluUnProject' maps the specified window coordinates into object
3141 coordinates using MODEL, PROJ, and VIEW. The result is stored in OBJX,
3142 OBJY, and OBJZ. A return value of `GLU_TRUE' indicates success; a return
3143 value of `GLU_FALSE' indicates failure.
3145 To compute the coordinates (OBJX,OBJYOBJZ) , `gluUnProject' multiplies
3146 the normalized device coordinates by the inverse of MODEL * PROJ as
3149 ((OBJX), (OBJY), (OBJZ),
3150 (W),)=INV\u2061(P\u2062M,)\u2062((2\u2061(WINX-VIEW\u2061[0,],),/VIEW\u2061[2,],-1),
3151 (2\u2061(WINY-VIEW\u2061[1,],),/VIEW\u2061[3,],-1), (2\u2061(WINZ,)-1), (1),) INV denotes
3152 matrix inversion. W is an unused variable, included for consistent