f63675dfaeb16383de955267deec7826c3d73bb0
[clinton/guile-figl.git] / figl / glu / low-level.scm
1 ;;; figl -*- mode: scheme; coding: utf-8 -*-
2 ;;; Copyright (C) 2013 Andy Wingo <wingo@pobox.com>
3 ;;;
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.
8 ;;;
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.
13 ;;;
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/>.
17 ;;;
18 ;;; Derived from upstream OpenGL documentation.
19 ;;;
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/).
23 ;;;
24 ;;; Automatically generated; you probably don't want to edit this. To
25 ;;; update, run "make update" in the top-level build tree.
26 ;;;
27
28 (define-module
29 (figl glu low-level)
30 #:use-module
31 (figl runtime)
32 #:use-module
33 (figl glu types)
34 #:export
35 (gluBeginCurve
36 gluEndCurve
37 gluBeginPolygon
38 gluEndPolygon
39 gluBeginSurface
40 gluEndSurface
41 gluBeginTrim
42 gluEndTrim
43 gluBuild1DMipmapLevels
44 gluBuild1DMipmaps
45 gluBuild2DMipmapLevels
46 gluBuild2DMipmaps
47 gluBuild3DMipmapLevels
48 gluBuild3DMipmaps
49 gluCheckExtension
50 gluCylinder
51 gluDeleteNurbsRenderer
52 gluDeleteQuadric
53 gluDeleteTess
54 gluDisk
55 gluErrorString
56 gluGetNurbsProperty
57 gluGetString
58 gluGetTessProperty
59 gluLoadSamplingMatrices
60 gluLookAt
61 gluNewNurbsRenderer
62 gluNewQuadric
63 gluNewTess
64 gluNextContour
65 gluNurbsCallbackDataEXT
66 gluNurbsCallbackData
67 gluNurbsCallback
68 gluNurbsCurve
69 gluNurbsProperty
70 gluNurbsSurface
71 gluOrtho2D
72 gluPartialDisk
73 gluPerspective
74 gluPickMatrix
75 gluProject
76 gluPwlCurve
77 gluQuadricCallback
78 gluQuadricDrawStyle
79 gluQuadricNormals
80 gluQuadricOrientation
81 gluQuadricTexture
82 gluScaleImage
83 gluSphere
84 gluTessBeginContour
85 gluTessEndContour
86 gluTessBeginPolygon
87 gluTessCallback
88 gluTessEndPolygon
89 gluTessNormal
90 gluTessProperty
91 gluTessVertex
92 gluUnProject4
93 gluUnProject))
94
95 (define-foreign-procedures
96 ((gluBeginCurve (nurb GLUnurbs*) -> void)
97 (gluEndCurve (nurb GLUnurbs*) -> void))
98 "Delimit a NURBS curve definition.
99
100 NURB
101 Specifies the NURBS object (created with `gluNewNurbsRenderer').
102
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
108 `gluEndCurve'.
109
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
114 calls preserve.")
115
116 (define-foreign-procedures
117 ((gluBeginPolygon (tess GLUtesselator*) -> void)
118 (gluEndPolygon (tess GLUtesselator*) -> void))
119 "Delimit a polygon description.
120
121 TESS
122 Specifies the tessellation object (created with `gluNewTess').
123
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
130 for more details.
131
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.")
135
136 (define-foreign-procedures
137 ((gluBeginSurface (nurb GLUnurbs*) -> void)
138 (gluEndSurface (nurb GLUnurbs*) -> void))
139 "Delimit a NURBS surface definition.
140
141 NURB
142 Specifies the NURBS object (created with `gluNewNurbsRenderer').
143
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'.
150
151 Trimming of NURBS surfaces is supported with `gluBeginTrim',
152 `gluPwlCurve', `gluNurbsCurve', and `gluEndTrim'. See the `gluBeginTrim'
153 reference page for details.
154
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.")
159
160 (define-foreign-procedures
161 ((gluBeginTrim (nurb GLUnurbs*) -> void)
162 (gluEndTrim (nurb GLUnurbs*) -> void))
163 "Delimit a NURBS trimming loop definition.
164
165 NURB
166 Specifies the NURBS object (created with `gluNewNurbsRenderer').
167
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
173 `gluEndSurface'.
174
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.
182
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'.
189
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.
197
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').
205
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.
211
212 If no trimming information is given for a NURBS surface, the entire
213 surface is drawn.")
214
215 (define-foreign-procedures
216 ((gluBuild1DMipmapLevels
217 (target GLenum)
218 (internalFormat GLint)
219 (width GLsizei)
220 (format GLenum)
221 (type GLenum)
222 (level GLint)
223 (base GLint)
224 (max GLint)
225 (data const-void-*)
226 ->
227 GLint))
228 "Builds a subset of one-dimensional mipmap levels.
229
230 TARGET
231 Specifies the target texture. Must be `GLU_TEXTURE_1D'.
232
233 INTERNALFORMAT
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
254 `GLU_RGBA16'.
255
256 WIDTH
257 Specifies the width in pixels of the texture image. This should be
258 a power of 2.
259
260 FORMAT
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'.
265
266 TYPE
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'.
277
278 LEVEL
279 Specifies the mipmap level of the image data.
280
281 BASE
282 Specifies the minimum mipmap level to pass to `glTexImage1D'.
283
284 MAX
285 Specifies the maximum mipmap level to pass to `glTexImage1D'.
286
287 DATA
288 Specifies a pointer to the image data in memory.
289
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.
293
294 A return value of zero indicates success, otherwise a GLU error code is
295 returned (see `gluErrorString').
296
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.
304
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.
311
312 The highest mipmap level can be derived from the formula
313 LOG_2\u2061(WIDTH×2^LEVEL,) .
314
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.
318
319 `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE or
320 MAX is > the highest mipmap level for DATA.
321
322 `GLU_INVALID_VALUE' is returned if WIDTH is < 1.
323
324 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE are
325 not legal.
326
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'.
329
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
332 is not `GLU_RGB'.
333
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'.
337
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'.
341
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'.
345
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'.")
349
350 (define-foreign-procedures
351 ((gluBuild1DMipmaps
352 (target GLenum)
353 (internalFormat GLint)
354 (width GLsizei)
355 (format GLenum)
356 (type GLenum)
357 (data const-void-*)
358 ->
359 GLint))
360 "Builds a one-dimensional mipmap.
361
362 TARGET
363 Specifies the target texture. Must be `GLU_TEXTURE_1D'.
364
365 INTERNALFORMAT
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
386 `GLU_RGBA16'.
387
388 WIDTH
389 Specifies the width, in pixels, of the texture image.
390
391 FORMAT
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'.
396
397 TYPE
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'.
408
409 DATA
410 Specifies a pointer to the image data in memory.
411
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.
415
416 A return value of zero indicates success, otherwise a GLU error code is
417 returned (see `gluErrorString').
418
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.
425
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.
429
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
433 mipmap level.
434
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.
440
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
444 parameter.
445
446 `GLU_INVALID_VALUE' is returned if WIDTH is < 1.
447
448 `GLU_INVALID_ENUM' is returned if FORMAT or TYPE are not legal.
449
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'.
452
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
455 is not `GLU_RGB'.
456
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'.
460
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'.
464
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'.
468
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'.")
472
473 (define-foreign-procedures
474 ((gluBuild2DMipmapLevels
475 (target GLenum)
476 (internalFormat GLint)
477 (width GLsizei)
478 (height GLsizei)
479 (format GLenum)
480 (type GLenum)
481 (level GLint)
482 (base GLint)
483 (max GLint)
484 (data const-void-*)
485 ->
486 GLint))
487 "Builds a subset of two-dimensional mipmap levels.
488
489 TARGET
490 Specifies the target texture. Must be `GLU_TEXTURE_2D'.
491
492 INTERNALFORMAT
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
513 `GLU_RGBA16'.
514
515 WIDTH
516 HEIGHT
517
518 Specifies the width and height, respectively, in pixels of the
519 texture image. These should be a power of 2.
520
521 FORMAT
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'.
526
527 TYPE
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'.
538
539 LEVEL
540 Specifies the mipmap level of the image data.
541
542 BASE
543 Specifies the minimum mipmap level to pass to `glTexImage2D'.
544
545 MAX
546 Specifies the maximum mipmap level to pass to `glTexImage2D'.
547
548 DATA
549 Specifies a pointer to the image data in memory.
550
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.
554
555 A return value of zero indicates success, otherwise a GLU error code is
556 returned (see `gluErrorString').
557
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
567 loaded.
568
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.
575
576 The highest mipmap level can be derived from the formula
577 LOG_2\u2061(MAX\u2061(WIDTH,HEIGHT)×2^LEVEL,) .
578
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.
582
583 `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE,
584 or MAX is > the highest mipmap level for DATA.
585
586 `GLU_INVALID_VALUE' is returned if WIDTH or HEIGHT is < 1.
587
588 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not
589 legal.
590
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'.
593
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
596 is not `GLU_RGB'.
597
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'.
601
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'.
605
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'.
609
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'.")
613
614 (define-foreign-procedures
615 ((gluBuild2DMipmaps
616 (target GLenum)
617 (internalFormat GLint)
618 (width GLsizei)
619 (height GLsizei)
620 (format GLenum)
621 (type GLenum)
622 (data const-void-*)
623 ->
624 GLint))
625 "Builds a two-dimensional mipmap.
626
627 TARGET
628 Specifies the target texture. Must be `GLU_TEXTURE_2D'.
629
630 INTERNALFORMAT
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
651 `GLU_RGBA16'.
652
653 WIDTH
654 HEIGHT
655
656 Specifies in pixels the width and height, respectively, of the
657 texture image.
658
659 FORMAT
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'.
664
665 TYPE
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'.
676
677 DATA
678 Specifies a pointer to the image data in memory.
679
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.
683
684 A return value of zero indicates success, otherwise a GLU error code is
685 returned (see `gluErrorString').
686
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.
694
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'.)
700
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.)
707
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.
714
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.
718
719 `GLU_INVALID_VALUE' is returned if WIDTH or HEIGHT is < 1.
720
721 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not
722 legal.
723
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'.
726
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
729 is not `GLU_RGB'.
730
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'.
734
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'.
738
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'.
742
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'.")
746
747 (define-foreign-procedures
748 ((gluBuild3DMipmapLevels
749 (target GLenum)
750 (internalFormat GLint)
751 (width GLsizei)
752 (height GLsizei)
753 (depth GLsizei)
754 (format GLenum)
755 (type GLenum)
756 (level GLint)
757 (base GLint)
758 (max GLint)
759 (data const-void-*)
760 ->
761 GLint))
762 "Builds a subset of three-dimensional mipmap levels.
763
764 TARGET
765 Specifies the target texture. Must be `GLU_TEXTURE_3D'.
766
767 INTERNALFORMAT
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
788 `GLU_RGBA16'.
789
790 WIDTH
791 HEIGHT
792
793 DEPTH
794
795 Specifies in pixels the width, height and depth respectively, of
796 the texture image. These should be a power of 2.
797
798 FORMAT
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'.
803
804 TYPE
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'.
815
816 LEVEL
817 Specifies the mipmap level of the image data.
818
819 BASE
820 Specifies the minimum mipmap level to pass to `glTexImage3D'.
821
822 MAX
823 Specifies the maximum mipmap level to pass to `glTexImage3D'.
824
825 DATA
826 Specifies a pointer to the image data in memory.
827
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.
831
832 A return value of zero indicates success, otherwise a GLU error code is
833 returned (see `gluErrorString').
834
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.
844
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
851 this case, 6.
852
853 The highest mipmap level can be derived from the formula
854 LOG_2\u2061(MAX\u2061(WIDTH,HEIGHTDEPTH)×2^LEVEL,) .
855
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.
859
860 `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE,
861 or MAX is > the highest mipmap level for DATA.
862
863 `GLU_INVALID_VALUE' is returned if WIDTH, HEIGHT, or DEPTH is < 1.
864
865 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not
866 legal.
867
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'.
870
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
873 is not `GLU_RGB'.
874
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'.
878
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'.
882
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'.
886
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'.")
890
891 (define-foreign-procedures
892 ((gluBuild3DMipmaps
893 (target GLenum)
894 (internalFormat GLint)
895 (width GLsizei)
896 (height GLsizei)
897 (depth GLsizei)
898 (format GLenum)
899 (type GLenum)
900 (data const-void-*)
901 ->
902 GLint))
903 "Builds a three-dimensional mipmap.
904
905 TARGET
906 Specifies the target texture. Must be `GLU_TEXTURE_3D'.
907
908 INTERNALFORMAT
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
929 `GLU_RGBA16'.
930
931 WIDTH
932 HEIGHT
933
934 DEPTH
935
936 Specifies in pixels the width, height and depth respectively, in
937 pixels of the texture image.
938
939 FORMAT
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'.
944
945 TYPE
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'.
956
957 DATA
958 Specifies a pointer to the image data in memory.
959
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.
963
964 A return value of zero indicates success, otherwise a GLU error code is
965 returned (see `gluErrorString').
966
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.
975
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.
979
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.)
986
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.
993
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.
997
998 `GLU_INVALID_VALUE' is returned if WIDTH, HEIGHT, or DEPTH is < 1.
999
1000 `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not
1001 legal.
1002
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'.
1005
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
1008 is not `GLU_RGB'.
1009
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'.
1013
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'.
1017
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'.
1021
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'.")
1025
1026 (define-foreign-procedures
1027 ((gluCheckExtension
1028 (extName const-GLubyte-*)
1029 (extString const-GLubyte-*)
1030 ->
1031 GLboolean))
1032 "Determines if an extension name is supported.
1033
1034 EXTNAME
1035 Specifies an extension name.
1036
1037 EXTSTRING
1038 Specifies a space-separated list of extension names supported.
1039
1040 `gluCheckExtension' returns `GLU_TRUE' if EXTNAME is supported otherwise
1041 `GLU_FALSE' is returned.
1042
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.")
1047
1048 (define-foreign-procedures
1049 ((gluCylinder
1050 (quad GLUquadric*)
1051 (base GLdouble)
1052 (top GLdouble)
1053 (height GLdouble)
1054 (slices GLint)
1055 (stacks GLint)
1056 ->
1057 void))
1058 "Draw a cylinder.
1059
1060 QUAD
1061 Specifies the quadrics object (created with `gluNewQuadric').
1062
1063 BASE
1064 Specifies the radius of the cylinder at Z = 0.
1065
1066 TOP
1067 Specifies the radius of the cylinder at Z = HEIGHT.
1068
1069 HEIGHT
1070 Specifies the height of the cylinder.
1071
1072 SLICES
1073 Specifies the number of subdivisions around the Z axis.
1074
1075 STACKS
1076 Specifies the number of subdivisions along the Z axis.
1077
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
1081 axis into stacks.
1082
1083 Note that if TOP is set to 0.0, this routine generates a cone.
1084
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.
1088
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
1093 at the +Y axis.")
1094
1095 (define-foreign-procedures
1096 ((gluDeleteNurbsRenderer (nurb GLUnurbs*) -> void))
1097 "Destroy a NURBS object.
1098
1099 NURB
1100 Specifies the NURBS object to be destroyed.
1101
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.")
1105
1106 (define-foreign-procedures
1107 ((gluDeleteQuadric (quad GLUquadric*) -> void))
1108 "Destroy a quadrics object.
1109
1110 QUAD
1111 Specifies the quadrics object to be destroyed.
1112
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.")
1116
1117 (define-foreign-procedures
1118 ((gluDeleteTess (tess GLUtesselator*) -> void))
1119 "Destroy a tessellation object.
1120
1121 TESS
1122 Specifies the tessellation object to destroy.
1123
1124 `gluDeleteTess' destroys the indicated tessellation object (which was
1125 created with `gluNewTess') and frees any memory that it used.")
1126
1127 (define-foreign-procedures
1128 ((gluDisk
1129 (quad GLUquadric*)
1130 (inner GLdouble)
1131 (outer GLdouble)
1132 (slices GLint)
1133 (loops GLint)
1134 ->
1135 void))
1136 "Draw a disk.
1137
1138 QUAD
1139 Specifies the quadrics object (created with `gluNewQuadric').
1140
1141 INNER
1142 Specifies the inner radius of the disk (may be 0).
1143
1144 OUTER
1145 Specifies the outer radius of the disk.
1146
1147 SLICES
1148 Specifies the number of subdivisions around the Z axis.
1149
1150 LOOPS
1151 Specifies the number of concentric rings about the origin into
1152 which the disk is subdivided.
1153
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).
1159
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.
1164
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).")
1169
1170 (define-foreign-procedures
1171 ((gluErrorString
1172 (error GLenum)
1173 ->
1174 const-GLubyte-*))
1175 "Produce an error string from a GL or GLU error code.
1176
1177 ERROR
1178 Specifies a GL or GLU error code.
1179
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.
1183
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.
1188
1189 `NULL' is returned if ERROR is not a valid GL or GLU error code.")
1190
1191 (define-foreign-procedures
1192 ((gluGetNurbsProperty
1193 (nurb GLUnurbs*)
1194 (property GLenum)
1195 (data GLfloat*)
1196 ->
1197 void))
1198 "Get a NURBS property.
1199
1200 NURB
1201 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1202
1203 PROPERTY
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
1208 `GLU_NURBS_MODE'.
1209
1210 DATA
1211 Specifies a pointer to the location into which the value of the
1212 named property is written.
1213
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.")
1218
1219 (define-foreign-procedures
1220 ((gluGetString (name GLenum) -> const-GLubyte-*))
1221 "Return a string describing the GLU version or GLU extensions .
1222
1223 NAME
1224 Specifies a symbolic constant, one of `GLU_VERSION', or
1225 `GLU_EXTENSIONS'.
1226
1227 `gluGetString' returns a pointer to a static string describing the GLU
1228 version or the GLU extensions that are supported.
1229
1230 The version number is one of the following forms:
1231
1232 MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER.
1233
1234 The version string is of the following form:
1235
1236 VERSION NUMBER<SPACE>VENDOR-SPECIFIC INFORMATION
1237
1238 Vendor-specific information is optional. Its format and contents depend
1239 on the implementation.
1240
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.)
1246
1247 All strings are null-terminated.
1248
1249 NULL is returned if NAME is not `GLU_VERSION' or `GLU_EXTENSIONS'.")
1250
1251 (define-foreign-procedures
1252 ((gluGetTessProperty
1253 (tess GLUtesselator*)
1254 (which GLenum)
1255 (data GLdouble*)
1256 ->
1257 void))
1258 "Get a tessellation object property.
1259
1260 TESS
1261 Specifies the tessellation object (created with `gluNewTess').
1262
1263 WHICH
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'.
1267
1268 DATA
1269 Specifies a pointer to the location into which the value of the
1270 named property is written.
1271
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.")
1276
1277 (define-foreign-procedures
1278 ((gluLoadSamplingMatrices
1279 (nurb GLUnurbs*)
1280 (model const-GLfloat-*)
1281 (perspective const-GLfloat-*)
1282 (view const-GLint-*)
1283 ->
1284 void))
1285 "Load NURBS sampling and culling matrices.
1286
1287 NURB
1288 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1289
1290 MODEL
1291 Specifies a modelview matrix (as from a `glGetFloatv' call).
1292
1293 PERSPECTIVE
1294 Specifies a projection matrix (as from a `glGetFloatv' call).
1295
1296 VIEW
1297 Specifies a viewport (as from a `glGetIntegerv' call).
1298
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).
1306
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.)")
1313
1314 (define-foreign-procedures
1315 ((gluLookAt
1316 (eyeX GLdouble)
1317 (eyeY GLdouble)
1318 (eyeZ GLdouble)
1319 (centerX GLdouble)
1320 (centerY GLdouble)
1321 (centerZ GLdouble)
1322 (upX GLdouble)
1323 (upY GLdouble)
1324 (upZ GLdouble)
1325 ->
1326 void))
1327 "Define a viewing transformation.
1328
1329 EYEX
1330 EYEY
1331
1332 EYEZ
1333
1334 Specifies the position of the eye point.
1335
1336 CENTERX
1337 CENTERY
1338
1339 CENTERZ
1340
1341 Specifies the position of the reference point.
1342
1343 UPX
1344 UPY
1345
1346 UPZ
1347
1348 Specifies the direction of the UP vector.
1349
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.
1352
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.
1360
1361 Let
1362
1363 F=((CENTERX-EYEX), (CENTERY-EYEY), (CENTERZ-EYEZ),)
1364
1365
1366
1367 Let UP be the vector (UPX,UPYUPZ) .
1368
1369 Then normalize as follows: F=F/∥F,∥,
1370
1371 UP^″=UP/∥UP,∥,
1372
1373
1374
1375 Finally, let S=F×UP^″ , and U=S×F .
1376
1377
1378
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),)
1381
1382 and `gluLookAt' is equivalent to
1383
1384
1385 glMultMatrixf(M);
1386 glTranslated(-eyex, -eyey, -eyez);")
1387
1388 (define-foreign-procedures
1389 ((gluNewNurbsRenderer -> GLUnurbs*))
1390 "Create a NURBS object.
1391
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.")
1396
1397 (define-foreign-procedures
1398 ((gluNewQuadric -> GLUquadric*))
1399 "Create a quadrics object.
1400
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.")
1405
1406 (define-foreign-procedures
1407 ((gluNewTess -> GLUtesselator*))
1408 "Create a tessellation object.
1409
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
1413 object.")
1414
1415 (define-foreign-procedures
1416 ((gluNextContour
1417 (tess GLUtesselator*)
1418 (type GLenum)
1419 ->
1420 void))
1421 "Mark the beginning of another contour.
1422
1423 TESS
1424 Specifies the tessellation object (created with `gluNewTess').
1425
1426 TYPE
1427 Specifies the type of the contour being defined. Valid values are
1428 `GLU_EXTERIOR', `GLU_INTERIOR', `GLU_UNKNOWN', `GLU_CCW', and
1429 `GLU_CW'.
1430
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
1437 been described.
1438
1439 TYPE defines what type of contour follows. The legal contour types are
1440 as follows:
1441
1442 `GLU_EXTERIOR'
1443 An exterior contour defines an exterior boundary of the polygon.
1444
1445 `GLU_INTERIOR'
1446 An interior contour defines an interior boundary of the polygon
1447 (such as a hole).
1448
1449 `GLU_UNKNOWN'
1450 An unknown contour is analyzed by the library to determine if it is
1451 interior or exterior.
1452
1453 `GLU_CCW',
1454 `GLU_CW'
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.
1459
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').
1463
1464 Note that there is no real difference between the `GLU_CCW' and `GLU_CW'
1465 contour types.
1466
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
1470 `GLU_EXTERIOR'.
1471
1472 This command is obsolete and is provided for backward compatibility
1473 only. Calls to `gluNextContour' are mapped to `gluTessEndContour'
1474 followed by `gluTessBeginContour'.")
1475
1476 (define-foreign-procedures
1477 ((gluNurbsCallbackDataEXT
1478 (nurb GLUnurbs*)
1479 (userData GLvoid*)
1480 ->
1481 void))
1482 "Set a user data pointer.
1483
1484 NURB
1485 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1486
1487 USERDATA
1488 Specifies a pointer to the user's data.
1489
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').")
1493
1494 (define-foreign-procedures
1495 ((gluNurbsCallbackData
1496 (nurb GLUnurbs*)
1497 (userData GLvoid*)
1498 ->
1499 void))
1500 "Set a user data pointer.
1501
1502 NURB
1503 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1504
1505 USERDATA
1506 Specifies a pointer to the user's data.
1507
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').")
1511
1512 (define-foreign-procedures
1513 ((gluNurbsCallback
1514 (nurb GLUnurbs*)
1515 (which GLenum)
1516 (CallBackFunc _GLUfuncptr)
1517 ->
1518 void))
1519 "Define a callback for a NURBS object.
1520
1521 NURB
1522 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1523
1524 WHICH
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
1531 `GLU_NURBS_ERROR'.
1532
1533 CALLBACKFUNC
1534 Specifies the function that the callback calls.
1535
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.
1540
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'.
1549
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'.
1553
1554 The legal callbacks are as follows:
1555
1556 `GLU_NURBS_BEGIN'
1557
1558
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:
1565
1566 `GLU_NURBS_BEGIN_DATA'
1567
1568
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:
1574
1575 `GLU_NURBS_VERTEX'
1576
1577
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:
1584
1585 `GLU_NURBS_VERTEX_DATA'
1586
1587
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:
1593
1594 `GLU_NURBS_NORMAL'
1595
1596
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:
1608
1609 `GLU_NURBS_NORMAL_DATA'
1610
1611
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:
1617
1618 `GLU_NURBS_COLOR'
1619
1620
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
1627 like:
1628
1629 `GLU_NURBS_COLOR_DATA'
1630
1631
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:
1637
1638 `GLU_NURBS_TEXTURE_COORD'
1639
1640
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:
1652
1653 `GLU_NURBS_TEXTURE_COORD_DATA'
1654
1655
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:
1661
1662 `GLU_NURBS_END'
1663
1664
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:
1668
1669 `GLU_NURBS_END_DATA'
1670
1671
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:
1677
1678 `GLU_NURBS_ERROR'
1679
1680
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'.
1686
1687
1688 void begin( GLenum type );
1689
1690
1691 void beginData(GLenum type, void *userData);
1692
1693
1694 void vertex( GLfloat *vertex );
1695
1696
1697 void vertexData( GLfloat *vertex, void *userData );
1698
1699
1700 void normal( GLfloat *normal );
1701
1702
1703 void normalData( GLfloat *normal, void *userData );
1704
1705
1706 void color( GLfloat *color );
1707
1708
1709 void colorData( GLfloat *color, void *userData );
1710
1711
1712 void texCoord( GLfloat *texCoord );
1713
1714
1715 void texCoordData( GLfloat *texCoord, void *userData );
1716
1717
1718 void end( void );
1719
1720
1721 void endData( void *userData );")
1722
1723 (define-foreign-procedures
1724 ((gluNurbsCurve
1725 (nurb GLUnurbs*)
1726 (knotCount GLint)
1727 (knots GLfloat-*)
1728 (stride GLint)
1729 (control GLfloat-*)
1730 (order GLint)
1731 (type GLenum)
1732 ->
1733 void))
1734 "Define the shape of a NURBS curve.
1735
1736 NURB
1737 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1738
1739 KNOTCOUNT
1740 Specifies the number of knots in KNOTS. KNOTCOUNT equals the number
1741 of control points plus the order.
1742
1743 KNOTS
1744 Specifies an array of KNOTCOUNT nondecreasing knot values.
1745
1746 STRIDE
1747 Specifies the offset (as a number of single-precision
1748 floating-point values) between successive curve control points.
1749
1750 CONTROL
1751 Specifies a pointer to an array of control points. The coordinates
1752 must agree with TYPE, specified below.
1753
1754 ORDER
1755 Specifies the order of the NURBS curve. ORDER equals degree + 1,
1756 hence a cubic curve has an order of 4.
1757
1758 TYPE
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'.
1764
1765 Use `gluNurbsCurve' to describe a NURBS curve.
1766
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').
1776
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
1783 curves.")
1784
1785 (define-foreign-procedures
1786 ((gluNurbsProperty
1787 (nurb GLUnurbs*)
1788 (property GLenum)
1789 (value GLfloat)
1790 ->
1791 void))
1792 "Set a NURBS property.
1793
1794 NURB
1795 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1796
1797 PROPERTY
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
1802 `GLU_NURBS_MODE'.
1803
1804 VALUE
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'.
1810
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:
1814
1815 `GLU_NURBS_MODE'
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'.
1825
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'.
1834
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.
1839
1840 `GLU_DOMAIN_DISTANCE' allows users to specify, in parametric
1841 coordinates, how many sample points per unit length are taken in U,
1842 V direction.
1843
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'.
1849
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
1855 they approximate.
1856
1857 The initial value of `GLU_SAMPLING_METHOD' is `GLU_PATH_LENGTH'.
1858
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.
1865
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.
1870
1871 `GLU_U_STEP'
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
1875 value is 100.
1876
1877 `GLU_V_STEP'
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
1881 value is 100.
1882
1883 `GLU_DISPLAY_MODE'
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.
1892
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.
1901
1902 The initial value is `GLU_FILL'.
1903
1904 `GLU_CULLING'
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
1908 is `GLU_FALSE'.
1909
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.
1918
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.")
1926
1927 (define-foreign-procedures
1928 ((gluNurbsSurface
1929 (nurb GLUnurbs*)
1930 (sKnotCount GLint)
1931 (sKnots GLfloat*)
1932 (tKnotCount GLint)
1933 (tKnots GLfloat*)
1934 (sStride GLint)
1935 (tStride GLint)
1936 (control GLfloat*)
1937 (sOrder GLint)
1938 (tOrder GLint)
1939 (type GLenum)
1940 ->
1941 void))
1942 "Define the shape of a NURBS surface.
1943
1944 NURB
1945 Specifies the NURBS object (created with `gluNewNurbsRenderer').
1946
1947 SKNOTCOUNT
1948 Specifies the number of knots in the parametric U direction.
1949
1950 SKNOTS
1951 Specifies an array of SKNOTCOUNT nondecreasing knot values in the
1952 parametric U direction.
1953
1954 TKNOTCOUNT
1955 Specifies the number of knots in the parametric V direction.
1956
1957 TKNOTS
1958 Specifies an array of TKNOTCOUNT nondecreasing knot values in the
1959 parametric V direction.
1960
1961 SSTRIDE
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.
1965
1966 TSTRIDE
1967 Specifies the offset (in single-precision floating-point values)
1968 between successive control points in the parametric V direction in
1969 CONTROL.
1970
1971 CONTROL
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.
1975
1976 SORDER
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.
1980
1981 TORDER
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.
1985
1986 TYPE
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').
1990
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.
1997
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').
2005
2006 A NURBS surface can be trimmed by using the commands `gluNurbsCurve' and
2007 `gluPwlCurve' between calls to `gluBeginTrim' and `gluEndTrim'.
2008
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
2012 points.")
2013
2014 (define-foreign-procedures
2015 ((gluOrtho2D
2016 (left GLdouble)
2017 (right GLdouble)
2018 (bottom GLdouble)
2019 (top GLdouble)
2020 ->
2021 void))
2022 "Define a 2D orthographic projection matrix.
2023
2024 LEFT
2025 RIGHT
2026
2027 Specify the coordinates for the left and right vertical clipping
2028 planes.
2029
2030 BOTTOM
2031 TOP
2032
2033 Specify the coordinates for the bottom and top horizontal clipping
2034 planes.
2035
2036 `gluOrtho2D' sets up a two-dimensional orthographic viewing region. This
2037 is equivalent to calling `glOrtho' with NEAR=-1 and FAR=1 .")
2038
2039 (define-foreign-procedures
2040 ((gluPartialDisk
2041 (quad GLUquadric*)
2042 (inner GLdouble)
2043 (outer GLdouble)
2044 (slices GLint)
2045 (loops GLint)
2046 (start GLdouble)
2047 (sweep GLdouble)
2048 ->
2049 void))
2050 "Draw an arc of a disk.
2051
2052 QUAD
2053 Specifies a quadrics object (created with `gluNewQuadric').
2054
2055 INNER
2056 Specifies the inner radius of the partial disk (can be 0).
2057
2058 OUTER
2059 Specifies the outer radius of the partial disk.
2060
2061 SLICES
2062 Specifies the number of subdivisions around the Z axis.
2063
2064 LOOPS
2065 Specifies the number of concentric rings about the origin into
2066 which the partial disk is subdivided.
2067
2068 START
2069 Specifies the starting angle, in degrees, of the disk portion.
2070
2071 SWEEP
2072 Specifies the sweep angle, in degrees, of the disk portion.
2073
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).
2079
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).
2085
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.
2090
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).")
2095
2096 (define-foreign-procedures
2097 ((gluPerspective
2098 (fovy GLdouble)
2099 (aspect GLdouble)
2100 (zNear GLdouble)
2101 (zFar GLdouble)
2102 ->
2103 void))
2104 "Set up a perspective projection matrix.
2105
2106 FOVY
2107 Specifies the field of view angle, in degrees, in the Y direction.
2108
2109 ASPECT
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
2112 (height).
2113
2114 ZNEAR
2115 Specifies the distance from the viewer to the near clipping plane
2116 (always positive).
2117
2118 ZFAR
2119 Specifies the distance from the viewer to the far clipping plane
2120 (always positive).
2121
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
2127 without distortion.
2128
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'.
2133
2134 Given F defined as follows:
2135
2136 F=COTANGENT\u2061(FOVY/2,) The generated matrix is
2137
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),)")
2140
2141 (define-foreign-procedures
2142 ((gluPickMatrix
2143 (x GLdouble)
2144 (y GLdouble)
2145 (delX GLdouble)
2146 (delY GLdouble)
2147 (viewport GLint-*)
2148 ->
2149 void))
2150 "Define a picking region.
2151
2152 X
2153 Y
2154
2155 Specify the center of a picking region in window coordinates.
2156
2157 DELX
2158 DELY
2159
2160 Specify the width and height, respectively, of the picking region
2161 in window coordinates.
2162
2163 VIEWPORT
2164 Specifies the current viewport (as from a `glGetIntegerv' call).
2165
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.
2173
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.
2180
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
2185 matrix.")
2186
2187 (define-foreign-procedures
2188 ((gluProject
2189 (objX GLdouble)
2190 (objY GLdouble)
2191 (objZ GLdouble)
2192 (model const-GLdouble-*)
2193 (proj const-GLdouble-*)
2194 (view const-GLint-*)
2195 (winX GLdouble*)
2196 (winY GLdouble*)
2197 (winZ GLdouble*)
2198 ->
2199 GLint))
2200 "Map object coordinates to window coordinates.
2201
2202 OBJX
2203 OBJY
2204
2205 OBJZ
2206
2207 Specify the object coordinates.
2208
2209 MODEL
2210 Specifies the current modelview matrix (as from a `glGetDoublev'
2211 call).
2212
2213 PROJ
2214 Specifies the current projection matrix (as from a `glGetDoublev'
2215 call).
2216
2217 VIEW
2218 Specifies the current viewport (as from a `glGetIntegerv' call).
2219
2220 WINX
2221 WINY
2222
2223 WINZ
2224
2225 Return the computed window coordinates.
2226
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.
2231
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
2234 follows:
2235
2236 V^″=P×M×V
2237
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
2240 order).
2241
2242 The window coordinates are then computed as follows:
2243
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")
2246
2247 (define-foreign-procedures
2248 ((gluPwlCurve
2249 (nurb GLUnurbs*)
2250 (count GLint)
2251 (data GLfloat*)
2252 (stride GLint)
2253 (type GLenum)
2254 ->
2255 void))
2256 "Describe a piecewise linear NURBS trimming curve.
2257
2258 NURB
2259 Specifies the NURBS object (created with `gluNewNurbsRenderer').
2260
2261 COUNT
2262 Specifies the number of points on the curve.
2263
2264 DATA
2265 Specifies an array containing the curve points.
2266
2267 STRIDE
2268 Specifies the offset (a number of single-precision floating-point
2269 values) between points on the curve.
2270
2271 TYPE
2272 Specifies the type of curve. Must be either `GLU_MAP1_TRIM_2' or
2273 `GLU_MAP1_TRIM_3'.
2274
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.
2282
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.")
2288
2289 (define-foreign-procedures
2290 ((gluQuadricCallback
2291 (quad GLUquadric*)
2292 (which GLenum)
2293 (CallBackFunc _GLUfuncptr)
2294 ->
2295 void))
2296 "Define a callback for a quadrics object.
2297
2298 QUAD
2299 Specifies the quadrics object (created with `gluNewQuadric').
2300
2301 WHICH
2302 Specifies the callback being defined. The only valid value is
2303 `GLU_ERROR'.
2304
2305 CALLBACKFUNC
2306 Specifies the function to be called.
2307
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
2311 erased.
2312
2313 The one legal callback is `GLU_ERROR':
2314
2315 `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.")
2320
2321 (define-foreign-procedures
2322 ((gluQuadricDrawStyle
2323 (quad GLUquadric*)
2324 (draw GLenum)
2325 ->
2326 void))
2327 "Specify the draw style desired for quadrics.
2328
2329 QUAD
2330 Specifies the quadrics object (created with `gluNewQuadric').
2331
2332 DRAW
2333 Specifies the desired draw style. Valid values are `GLU_FILL',
2334 `GLU_LINE', `GLU_SILHOUETTE', and `GLU_POINT'.
2335
2336 `gluQuadricDrawStyle' specifies the draw style for quadrics rendered
2337 with QUAD. The legal values are as follows:
2338
2339 `GLU_FILL'
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').
2343
2344 `GLU_LINE'
2345 Quadrics are rendered as a set of lines.
2346
2347 `GLU_SILHOUETTE'
2348 Quadrics are rendered as a set of lines, except that edges
2349 separating coplanar faces will not be drawn.
2350
2351 `GLU_POINT'
2352 Quadrics are rendered as a set of points.")
2353
2354 (define-foreign-procedures
2355 ((gluQuadricNormals
2356 (quad GLUquadric*)
2357 (normal GLenum)
2358 ->
2359 void))
2360 "Specify what kind of normals are desired for quadrics.
2361
2362 QUAD
2363 Specifies the quadrics object (created with `gluNewQuadric').
2364
2365 NORMAL
2366 Specifies the desired type of normals. Valid values are `GLU_NONE',
2367 `GLU_FLAT', and `GLU_SMOOTH'.
2368
2369 `gluQuadricNormals' specifies what kind of normals are desired for
2370 quadrics rendered with QUAD. The legal values are as follows:
2371
2372 `GLU_NONE'
2373 No normals are generated.
2374
2375 `GLU_FLAT'
2376 One normal is generated for every facet of a quadric.
2377
2378 `GLU_SMOOTH'
2379 One normal is generated for every vertex of a quadric. This is the
2380 initial value.")
2381
2382 (define-foreign-procedures
2383 ((gluQuadricOrientation
2384 (quad GLUquadric*)
2385 (orientation GLenum)
2386 ->
2387 void))
2388 "Specify inside/outside orientation for quadrics.
2389
2390 QUAD
2391 Specifies the quadrics object (created with `gluNewQuadric').
2392
2393 ORIENTATION
2394 Specifies the desired orientation. Valid values are `GLU_OUTSIDE'
2395 and `GLU_INSIDE'.
2396
2397 `gluQuadricOrientation' specifies what kind of orientation is desired
2398 for quadrics rendered with QUAD. The ORIENTATION values are as follows:
2399
2400 `GLU_OUTSIDE'
2401 Quadrics are drawn with normals pointing outward (the initial
2402 value).
2403
2404 `GLU_INSIDE'
2405 Quadrics are drawn with normals pointing inward.
2406
2407 Note that the interpretation of OUTWARD and INWARD depends on the
2408 quadric being drawn.")
2409
2410 (define-foreign-procedures
2411 ((gluQuadricTexture
2412 (quad GLUquadric*)
2413 (texture GLboolean)
2414 ->
2415 void))
2416 "Specify if texturing is desired for quadrics.
2417
2418 QUAD
2419 Specifies the quadrics object (created with `gluNewQuadric').
2420
2421 TEXTURE
2422 Specifies a flag indicating if texture coordinates should be
2423 generated.
2424
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'.
2429
2430 The manner in which texture coordinates are generated depends upon the
2431 specific quadric rendered.")
2432
2433 (define-foreign-procedures
2434 ((gluScaleImage
2435 (format GLenum)
2436 (wIn GLsizei)
2437 (hIn GLsizei)
2438 (typeIn GLenum)
2439 (dataIn const-void-*)
2440 (wOut GLsizei)
2441 (hOut GLsizei)
2442 (typeOut GLenum)
2443 (dataOut GLvoid*)
2444 ->
2445 GLint))
2446 "Scale an image to an arbitrary size.
2447
2448 FORMAT
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'.
2454
2455 WIN
2456 HIN
2457
2458 Specify in pixels the width and height, respectively, of the source
2459 image.
2460
2461 TYPEIN
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'.
2472
2473 DATAIN
2474 Specifies a pointer to the source image.
2475
2476 WOUT
2477 HOUT
2478
2479 Specify the width and height, respectively, in pixels of the
2480 destination image.
2481
2482 TYPEOUT
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'.
2493
2494 DATAOUT
2495 Specifies a pointer to the destination image.
2496
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
2499 destination image.
2500
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.
2505
2506 A return value of zero indicates success, otherwise a GLU error code is
2507 returned (see `gluErrorString').
2508
2509 See the `glReadPixels' reference page for a description of the
2510 acceptable values for the FORMAT, TYPEIN, and TYPEOUT parameters.
2511
2512 `GLU_INVALID_VALUE' is returned if WIN, HIN, WOUT, or HOUT is negative.
2513
2514 `GLU_INVALID_ENUM' is returned if FORMAT, TYPEIN, or TYPEOUT is not
2515 legal.
2516
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
2519 not `GLU_RGB'.
2520
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
2523 is not `GLU_RGB'.
2524
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'.
2528
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'.
2532
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'.
2536
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'.")
2540
2541 (define-foreign-procedures
2542 ((gluSphere
2543 (quad GLUquadric*)
2544 (radius GLdouble)
2545 (slices GLint)
2546 (stacks GLint)
2547 ->
2548 void))
2549 "Draw a sphere.
2550
2551 QUAD
2552 Specifies the quadrics object (created with `gluNewQuadric').
2553
2554 RADIUS
2555 Specifies the radius of the sphere.
2556
2557 SLICES
2558 Specifies the number of subdivisions around the Z axis (similar to
2559 lines of longitude).
2560
2561 STACKS
2562 Specifies the number of subdivisions along the Z axis (similar to
2563 lines of latitude).
2564
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).
2568
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
2572 sphere.
2573
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.")
2579
2580 (define-foreign-procedures
2581 ((gluTessBeginContour
2582 (tess GLUtesselator*)
2583 ->
2584 void)
2585 (gluTessEndContour (tess GLUtesselator*) -> void))
2586 "Delimit a contour description.
2587
2588 TESS
2589 Specifies the tessellation object (created with `gluNewTess').
2590
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'.")
2598
2599 (define-foreign-procedures
2600 ((gluTessBeginPolygon
2601 (tess GLUtesselator*)
2602 (data GLvoid*)
2603 ->
2604 void))
2605 "Delimit a polygon description.
2606
2607 TESS
2608 Specifies the tessellation object (created with `gluNewTess').
2609
2610 DATA
2611 Specifies a pointer to user polygon data.
2612
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
2621 details.
2622
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.
2627
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.")
2631
2632 (define-foreign-procedures
2633 ((gluTessCallback
2634 (tess GLUtesselator*)
2635 (which GLenum)
2636 (CallBackFunc _GLUfuncptr)
2637 ->
2638 void))
2639 "Define a callback for a tessellation object.
2640
2641 TESS
2642 Specifies the tessellation object (created with `gluNewTess').
2643
2644 WHICH
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'.
2651
2652 CALLBACKFUNC
2653 Specifies the function to be called.
2654
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
2658 becomes undefined.
2659
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:
2668
2669 `GLU_TESS_BEGIN'
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
2677 this callback is:
2678
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:
2684
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.
2694
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:
2701
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:
2707
2708 `GLU_TESS_VERTEX'
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:
2715
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:
2721
2722 `GLU_TESS_END'
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:
2726
2727 `GLU_TESS_END_DATA'
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:
2732
2733 `GLU_TESS_COMBINE'
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
2739 prototype is:
2740
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.
2746
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.
2752
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:
2756
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.
2762
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:
2768
2769 `GLU_TESS_ERROR'
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:
2779
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.
2791
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:
2797
2798
2799 void begin( GLenum type );
2800
2801
2802 void beginData( GLenum type, void *polygon_data );
2803
2804
2805 void edgeFlag( GLboolean flag );
2806
2807
2808 void edgeFlagData( GLboolean flag, void *polygon_data );
2809
2810
2811 void vertex( void *vertex_data );
2812
2813
2814 void vertexData( void *vertex_data, void *polygon_data );
2815
2816
2817 void end( void );
2818
2819
2820 void endData( void *polygon_data );
2821
2822
2823 void combine( GLdouble coords[3], void *vertex_data[4],
2824 GLfloat weight[4], void **outData );
2825
2826
2827 void myCombine( GLdouble coords[3], VERTEX *d[4],
2828 GLfloat w[4], VERTEX **dataOut )
2829 {
2830 VERTEX *new = new_vertex();
2831
2832 new->x = coords[0];
2833 new->y = coords[1];
2834 new->z = coords[2];
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;
2839 *dataOut = new;
2840 }
2841
2842
2843 void combineData( GLdouble coords[3], void *vertex_data[4],
2844 GLfloat weight[4], void **outData,
2845 void *polygon_data );
2846
2847
2848 void error( GLenum errno );
2849
2850
2851 void errorData( GLenum errno, void *polygon_data );")
2852
2853 (define-foreign-procedures
2854 ((gluTessEndPolygon (tess GLUtesselator*) -> void))
2855 "Delimit a polygon description.
2856
2857 TESS
2858 Specifies the tessellation object (created with `gluNewTess').
2859
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
2868 details.
2869
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.")
2873
2874 (define-foreign-procedures
2875 ((gluTessNormal
2876 (tess GLUtesselator*)
2877 (valueX GLdouble)
2878 (valueY GLdouble)
2879 (valueZ GLdouble)
2880 ->
2881 void))
2882 "Specify a normal for a polygon.
2883
2884 TESS
2885 Specifies the tessellation object (created with `gluNewTess').
2886
2887 VALUEX
2888 Specifies the first component of the normal.
2889
2890 VALUEY
2891 Specifies the second component of the normal.
2892
2893 VALUEZ
2894 Specifies the third component of the normal.
2895
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
2903 polygons.
2904
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).
2913
2914 The supplied normal persists until it is changed by another call to
2915 `gluTessNormal'.")
2916
2917 (define-foreign-procedures
2918 ((gluTessProperty
2919 (tess GLUtesselator*)
2920 (which GLenum)
2921 (data GLdouble)
2922 ->
2923 void))
2924 "Set a tessellation object property.
2925
2926 TESS
2927 Specifies the tessellation object (created with `gluNewTess').
2928
2929 WHICH
2930 Specifies the property to be set. Valid values are
2931 `GLU_TESS_WINDING_RULE', `GLU_TESS_BOUNDARY_ONLY', and
2932 `GLU_TESS_TOLERANCE'.
2933
2934 DATA
2935 Specifies the value of the indicated property.
2936
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:
2940
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'.
2946
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.
2950
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
2957 region.
2958
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.
2965
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
2973 each contour.
2974
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
2983 larger.
2984
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
2988 0.
2989
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.")
2995
2996 (define-foreign-procedures
2997 ((gluTessVertex
2998 (tess GLUtesselator*)
2999 (location GLdouble-*)
3000 (data GLvoid*)
3001 ->
3002 void))
3003 "Specify a vertex on a polygon.
3004
3005 TESS
3006 Specifies the tessellation object (created with `gluNewTess').
3007
3008 LOCATION
3009 Specifies the location of the vertex.
3010
3011 DATA
3012 Specifies an opaque pointer passed back to the program with the
3013 vertex callback (as specified by `gluTessCallback').
3014
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'.
3020
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).")
3026
3027 (define-foreign-procedures
3028 ((gluUnProject4
3029 (winX GLdouble)
3030 (winY GLdouble)
3031 (winZ GLdouble)
3032 (clipW GLdouble)
3033 (model const-GLdouble-*)
3034 (proj const-GLdouble-*)
3035 (view const-GLint-*)
3036 (nearVal GLdouble)
3037 (farVal GLdouble)
3038 (objX GLdouble*)
3039 (objY GLdouble*)
3040 (objZ GLdouble*)
3041 (objW GLdouble*)
3042 ->
3043 GLint))
3044 "Map window and clip coordinates to object coordinates.
3045
3046 WINX
3047 WINY
3048
3049 WINZ
3050
3051 Specify the window coordinates to be mapped.
3052
3053 CLIPW
3054 Specify the clip w coordinate to be mapped.
3055
3056 MODEL
3057 Specifies the modelview matrix (as from a `glGetDoublev' call).
3058
3059 PROJ
3060 Specifies the projection matrix (as from a `glGetDoublev' call).
3061
3062 VIEW
3063 Specifies the viewport (as from a `glGetIntegerv' call).
3064
3065 NEARVAL
3066 FARVAL
3067
3068 Specifies the near and far planes (as from a `glGetDoublev' call).
3069
3070 OBJX
3071 OBJY
3072
3073 OBJZ
3074
3075 OBJW
3076
3077 Returns the computed object coordinates.
3078
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.
3087
3088 To compute the coordinates (OBJX,OBJYOBJZOBJW) , `gluUnProject4'
3089 multiplies the normalized device coordinates by the inverse of MODEL *
3090 PROJ as follows:
3091
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),)
3096
3097 INV denotes matrix inversion.
3098
3099 `gluUnProject4' is equivalent to `gluUnProject' when CLIPW is 1, NEARVAL
3100 is 0, and FARVAL is 1.")
3101
3102 (define-foreign-procedures
3103 ((gluUnProject
3104 (winX GLdouble)
3105 (winY GLdouble)
3106 (winZ GLdouble)
3107 (model const-GLdouble-*)
3108 (proj const-GLdouble-*)
3109 (view const-GLint-*)
3110 (objX GLdouble*)
3111 (objY GLdouble*)
3112 (objZ GLdouble*)
3113 ->
3114 GLint))
3115 "Map window coordinates to object coordinates.
3116
3117 WINX
3118 WINY
3119
3120 WINZ
3121
3122 Specify the window coordinates to be mapped.
3123
3124 MODEL
3125 Specifies the modelview matrix (as from a `glGetDoublev' call).
3126
3127 PROJ
3128 Specifies the projection matrix (as from a `glGetDoublev' call).
3129
3130 VIEW
3131 Specifies the viewport (as from a `glGetIntegerv' call).
3132
3133 OBJX
3134 OBJY
3135
3136 OBJZ
3137
3138 Returns the computed object coordinates.
3139
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.
3144
3145 To compute the coordinates (OBJX,OBJYOBJZ) , `gluUnProject' multiplies
3146 the normalized device coordinates by the inverse of MODEL * PROJ as
3147 follows:
3148
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
3153 matrix notation.")
3154