Commit | Line | Data |
---|---|---|
8925f36f AW |
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 | ;;; | |
c7b31271 DH |
20 | ;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is |
21 | ;;; licensed under the SGI Free Software B License. For details, see | |
8925f36f AW |
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 | |
7ec693ed | 29 | (figl glu low-level) |
8925f36f | 30 | #:use-module |
25072f02 | 31 | (figl glu runtime) |
7ec693ed AW |
32 | #:use-module |
33 | (figl glu types) | |
8925f36f AW |
34 | #:export |
35 | (gluBeginCurve | |
bb894c9d | 36 | gluEndCurve |
8925f36f | 37 | gluBeginPolygon |
bb894c9d | 38 | gluEndPolygon |
8925f36f | 39 | gluBeginSurface |
bb894c9d | 40 | gluEndSurface |
8925f36f | 41 | gluBeginTrim |
bb894c9d | 42 | gluEndTrim |
8925f36f AW |
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 | |
bb894c9d | 85 | gluTessEndContour |
8925f36f AW |
86 | gluTessBeginPolygon |
87 | gluTessCallback | |
88 | gluTessEndPolygon | |
89 | gluTessNormal | |
90 | gluTessProperty | |
91 | gluTessVertex | |
92 | gluUnProject4 | |
93 | gluUnProject)) | |
94 | ||
25072f02 | 95 | (define-glu-procedures |
00239761 AW |
96 | ((gluBeginCurve (nurb GLUnurbs*) -> void) |
97 | (gluEndCurve (nurb GLUnurbs*) -> void)) | |
3c9b6116 AW |
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' | |
c7b31271 | 105 | to define the attributes of the curve. Exactly one of the calls to |
3c9b6116 | 106 | `gluNurbsCurve' must have a curve type of `GLU_MAP1_VERTEX_3' or |
c7b31271 DH |
107 | `GLU_MAP1_VERTEX_4'. To mark the end of the NURBS curve definition, |
108 | call `gluEndCurve'. | |
3c9b6116 | 109 | |
8925f36f | 110 | GL evaluators are used to render the NURBS curve as a series of line |
c7b31271 DH |
111 | segments. Evaluator state is preserved during rendering with |
112 | `glPushAttrib'(`GLU_EVAL_BIT') and `glPopAttrib'(). See the | |
3c9b6116 AW |
113 | `glPushAttrib' reference page for details on exactly what state these |
114 | calls preserve.") | |
8925f36f | 115 | |
25072f02 | 116 | (define-glu-procedures |
00239761 AW |
117 | ((gluBeginPolygon (tess GLUtesselator*) -> void) |
118 | (gluEndPolygon (tess GLUtesselator*) -> void)) | |
3c9b6116 AW |
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 | |
c7b31271 DH |
125 | nonconvex polygon. To define such a polygon, first call |
126 | `gluBeginPolygon'. Then define the contours of the polygon by calling | |
3c9b6116 | 127 | `gluTessVertex' for each vertex and `gluNextContour' to start each new |
c7b31271 DH |
128 | contour. Finally, call `gluEndPolygon' to signal the end of the |
129 | definition. See the `gluTessVertex' and `gluNextContour' reference | |
130 | pages for more details. | |
3c9b6116 AW |
131 | |
132 | Once `gluEndPolygon' is called, the polygon is tessellated, and the | |
c7b31271 | 133 | resulting triangles are described through callbacks. See |
3c9b6116 | 134 | `gluTessCallback' for descriptions of the callback functions.") |
8925f36f | 135 | |
25072f02 | 136 | (define-glu-procedures |
00239761 AW |
137 | ((gluBeginSurface (nurb GLUnurbs*) -> void) |
138 | (gluEndSurface (nurb GLUnurbs*) -> void)) | |
3c9b6116 AW |
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 | |
c7b31271 DH |
145 | definition. After calling `gluBeginSurface', make one or more calls to |
146 | `gluNurbsSurface' to define the attributes of the surface. Exactly one | |
3c9b6116 | 147 | of these calls to `gluNurbsSurface' must have a surface type of |
c7b31271 DH |
148 | `GLU_MAP2_VERTEX_3' or `GLU_MAP2_VERTEX_4'. To mark the end of the |
149 | NURBS surface definition, call `gluEndSurface'. | |
3c9b6116 AW |
150 | |
151 | Trimming of NURBS surfaces is supported with `gluBeginTrim', | |
c7b31271 DH |
152 | `gluPwlCurve', `gluNurbsCurve', and `gluEndTrim'. See the |
153 | `gluBeginTrim' reference page for details. | |
3c9b6116 | 154 | |
8925f36f | 155 | GL evaluators are used to render the NURBS surface as a set of polygons. |
3c9b6116 | 156 | Evaluator state is preserved during rendering with |
c7b31271 DH |
157 | `glPushAttrib'(`GLU_EVAL_BIT') and `glPopAttrib'. See the |
158 | `glPushAttrib' reference page for details on exactly what state these | |
159 | calls preserve.") | |
8925f36f | 160 | |
25072f02 | 161 | (define-glu-procedures |
00239761 AW |
162 | ((gluBeginTrim (nurb GLUnurbs*) -> void) |
163 | (gluEndTrim (nurb GLUnurbs*) -> void)) | |
3c9b6116 AW |
164 | "Delimit a NURBS trimming loop definition. |
165 | ||
166 | NURB | |
167 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
168 | ||
169 | Use `gluBeginTrim' to mark the beginning of a trimming loop and | |
c7b31271 | 170 | `gluEndTrim' to mark the end of a trimming loop. A trimming loop is a |
3c9b6116 | 171 | set of oriented curve segments (forming a closed curve) that define |
c7b31271 | 172 | boundaries of a NURBS surface. You include these trimming loops in the |
3c9b6116 AW |
173 | definition of a NURBS surface, between calls to `gluBeginSurface' and |
174 | `gluEndSurface'. | |
175 | ||
c7b31271 | 176 | The definition for a NURBS surface can contain many trimming loops. For |
3c9b6116 AW |
177 | example, if you wrote a definition for a NURBS surface that resembled a |
178 | rectangle with a hole punched out, the definition would contain two | |
c7b31271 DH |
179 | trimming loops. One loop would define the outer edge of the rectangle; |
180 | the other would define the hole punched out of the rectangle. The | |
3c9b6116 AW |
181 | definitions of each of these trimming loops would be bracketed by a |
182 | `gluBeginTrim'/`gluEndTrim' pair. | |
183 | ||
184 | The definition of a single closed trimming loop can consist of multiple | |
185 | curve segments, each described as a piecewise linear curve (see | |
186 | `gluPwlCurve') or as a single NURBS curve (see `gluNurbsCurve'), or as a | |
c7b31271 DH |
187 | combination of both in any order. The only library calls that can |
188 | appear in a trimming loop definition (between the calls to | |
189 | `gluBeginTrim' and `gluEndTrim') are `gluPwlCurve' and `gluNurbsCurve'. | |
3c9b6116 AW |
190 | |
191 | The area of the NURBS surface that is displayed is the region in the | |
192 | domain to the left of the trimming curve as the curve parameter | |
c7b31271 | 193 | increases. Thus, the retained region of the NURBS surface is inside a |
3c9b6116 AW |
194 | counterclockwise trimming loop and outside a clockwise trimming loop. |
195 | For the rectangle mentioned earlier, the trimming loop for the outer | |
196 | edge of the rectangle runs counterclockwise, while the trimming loop for | |
197 | the punched-out hole runs clockwise. | |
198 | ||
199 | If you use more than one curve to define a single trimming loop, the | |
200 | curve segments must form a closed loop (that is, the endpoint of each | |
201 | curve must be the starting point of the next curve, and the endpoint of | |
c7b31271 | 202 | the final curve must be the starting point of the first curve). If the |
3c9b6116 | 203 | endpoints of the curve are sufficiently close together but not exactly |
c7b31271 | 204 | coincident, they will be coerced to match. If the endpoints are not |
3c9b6116 AW |
205 | sufficiently close, an error results (see `gluNurbsCallback'). |
206 | ||
207 | If a trimming loop definition contains multiple curves, the direction of | |
208 | the curves must be consistent (that is, the inside must be to the left | |
c7b31271 DH |
209 | of all of the curves). Nested trimming loops are legal as long as the |
210 | curve orientations alternate correctly. If trimming curves are | |
3c9b6116 AW |
211 | self-intersecting, or intersect one another, an error results. |
212 | ||
213 | If no trimming information is given for a NURBS surface, the entire | |
214 | surface is drawn.") | |
8925f36f | 215 | |
25072f02 | 216 | (define-glu-procedures |
bb894c9d AW |
217 | ((gluBuild1DMipmapLevels |
218 | (target GLenum) | |
219 | (internalFormat GLint) | |
220 | (width GLsizei) | |
221 | (format GLenum) | |
222 | (type GLenum) | |
223 | (level GLint) | |
224 | (base GLint) | |
225 | (max GLint) | |
00239761 | 226 | (data const-void-*) |
bb894c9d AW |
227 | -> |
228 | GLint)) | |
3c9b6116 AW |
229 | "Builds a subset of one-dimensional mipmap levels. |
230 | ||
231 | TARGET | |
c7b31271 | 232 | Specifies the target texture. Must be `GLU_TEXTURE_1D'. |
3c9b6116 AW |
233 | |
234 | INTERNALFORMAT | |
c7b31271 DH |
235 | Requests the internal storage format of the texture image. The |
236 | most current version of the SGI implementation of GLU does not | |
237 | check this value for validity before passing it on to the | |
238 | underlying OpenGL implementation. A value that is not accepted by | |
239 | the OpenGL implementation will lead to an OpenGL error. The | |
240 | benefit of not checking this value at the GLU level is that OpenGL | |
241 | extensions can add new internal texture formats without requiring a | |
242 | revision of the GLU implementation. Older implementations of GLU | |
243 | check this value and raise a GLU error if it is not 1, 2, 3, or 4 | |
244 | or one of the following symbolic constants: `GLU_ALPHA', | |
245 | `GLU_ALPHA4', `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', | |
246 | `GLU_LUMINANCE', `GLU_LUMINANCE4', `GLU_LUMINANCE8', | |
247 | `GLU_LUMINANCE12', `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', | |
248 | `GLU_LUMINANCE4_ALPHA4', `GLU_LUMINANCE6_ALPHA2', | |
249 | `GLU_LUMINANCE8_ALPHA8', `GLU_LUMINANCE12_ALPHA4', | |
250 | `GLU_LUMINANCE12_ALPHA12', `GLU_LUMINANCE16_ALPHA16', | |
251 | `GLU_INTENSITY', `GLU_INTENSITY4', `GLU_INTENSITY8', | |
252 | `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB', `GLU_R3_G3_B2', | |
253 | `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10', `GLU_RGB12', | |
254 | `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4', `GLU_RGB5_A1', | |
255 | `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or `GLU_RGBA16'. | |
3c9b6116 AW |
256 | |
257 | WIDTH | |
c7b31271 | 258 | Specifies the width in pixels of the texture image. This should be |
3c9b6116 AW |
259 | a power of 2. |
260 | ||
261 | FORMAT | |
c7b31271 | 262 | Specifies the format of the pixel data. Must be one of: |
3c9b6116 AW |
263 | `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN', |
264 | `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR', | |
265 | `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'. | |
266 | ||
267 | TYPE | |
c7b31271 | 268 | Specifies the data type for DATA. Must be one of: |
3c9b6116 AW |
269 | `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP', |
270 | `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT', | |
271 | `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2', | |
272 | `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5', | |
273 | `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4', | |
274 | `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1', | |
275 | `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8', | |
276 | `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or | |
277 | `GLU_UNSIGNED_INT_2_10_10_10_REV'. | |
278 | ||
279 | LEVEL | |
280 | Specifies the mipmap level of the image data. | |
281 | ||
282 | BASE | |
283 | Specifies the minimum mipmap level to pass to `glTexImage1D'. | |
284 | ||
285 | MAX | |
286 | Specifies the maximum mipmap level to pass to `glTexImage1D'. | |
287 | ||
288 | DATA | |
289 | Specifies a pointer to the image data in memory. | |
290 | ||
291 | `gluBuild1DMipmapLevels' builds a subset of prefiltered one-dimensional | |
c7b31271 DH |
292 | texture maps of decreasing resolutions called a mipmap. This is used |
293 | for the antialiasing of texture mapped primitives. | |
3c9b6116 | 294 | |
8925f36f | 295 | A return value of zero indicates success, otherwise a GLU error code is |
3c9b6116 AW |
296 | returned (see `gluErrorString'). |
297 | ||
298 | A series of mipmap levels from BASE to MAX is built by decimating DATA | |
c7b31271 | 299 | in half until size 1×1 is reached. At each level, each texel in the |
3c9b6116 | 300 | halved mipmap level is an average of the corresponding two texels in the |
c7b31271 DH |
301 | larger mipmap level. `glTexImage1D' is called to load these mipmap |
302 | levels from BASE to MAX. If MAX is larger than the highest mipmap level | |
3c9b6116 AW |
303 | for the texture of the specified size, then a GLU error code is returned |
304 | (see `gluErrorString') and nothing is loaded. | |
305 | ||
306 | For example, if LEVEL is 2 and WIDTH is 16, the following levels are | |
c7b31271 DH |
307 | possible: 16×1 , 8×1 , 4×1 , 2×1 , 1×1 . These correspond to levels 2 |
308 | through 6 respectively. If BASE is 3 and MAX is 5, then only mipmap | |
309 | levels 8×1 , 4×1 and 2×1 are loaded. However, if MAX is 7, then an | |
310 | error is returned and nothing is loaded since MAX is larger than the | |
311 | highest mipmap level which is, in this case, 6. | |
3c9b6116 AW |
312 | |
313 | The highest mipmap level can be derived from the formula | |
314 | LOG_2\u2061(WIDTH×2^LEVEL,) . | |
315 | ||
316 | See the `glTexImage1D' reference page for a description of the | |
c7b31271 | 317 | acceptable values for TYPE parameter. See the `glDrawPixels' reference |
3c9b6116 AW |
318 | page for a description of the acceptable values for LEVEL parameter. |
319 | ||
320 | `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE or | |
321 | MAX is > the highest mipmap level for DATA. | |
322 | ||
323 | `GLU_INVALID_VALUE' is returned if WIDTH is < 1. | |
324 | ||
325 | `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE are | |
326 | not legal. | |
327 | ||
328 | `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2' | |
329 | or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'. | |
330 | ||
331 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
332 | `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
333 | is not `GLU_RGB'. | |
334 | ||
335 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
336 | `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and | |
337 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
338 | ||
339 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
340 | `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and | |
341 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
342 | ||
343 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
344 | `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT | |
345 | is neither `GLU_RGBA' nor `GLU_BGRA'. | |
346 | ||
347 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
348 | `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and | |
349 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") | |
8925f36f | 350 | |
25072f02 | 351 | (define-glu-procedures |
bb894c9d AW |
352 | ((gluBuild1DMipmaps |
353 | (target GLenum) | |
354 | (internalFormat GLint) | |
355 | (width GLsizei) | |
356 | (format GLenum) | |
357 | (type GLenum) | |
00239761 | 358 | (data const-void-*) |
bb894c9d AW |
359 | -> |
360 | GLint)) | |
3c9b6116 AW |
361 | "Builds a one-dimensional mipmap. |
362 | ||
363 | TARGET | |
c7b31271 | 364 | Specifies the target texture. Must be `GLU_TEXTURE_1D'. |
3c9b6116 AW |
365 | |
366 | INTERNALFORMAT | |
c7b31271 DH |
367 | Requests the internal storage format of the texture image. The |
368 | most current version of the SGI implementation of GLU does not | |
369 | check this value for validity before passing it on to the | |
370 | underlying OpenGL implementation. A value that is not accepted by | |
371 | the OpenGL implementation will lead to an OpenGL error. The | |
372 | benefit of not checking this value at the GLU level is that OpenGL | |
373 | extensions can add new internal texture formats without requiring a | |
374 | revision of the GLU implementation. Older implementations of GLU | |
375 | check this value and raise a GLU error if it is not 1, 2, 3, or 4 | |
376 | or one of the following symbolic constants: `GLU_ALPHA', | |
377 | `GLU_ALPHA4', `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', | |
378 | `GLU_LUMINANCE', `GLU_LUMINANCE4', `GLU_LUMINANCE8', | |
379 | `GLU_LUMINANCE12', `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', | |
380 | `GLU_LUMINANCE4_ALPHA4', `GLU_LUMINANCE6_ALPHA2', | |
381 | `GLU_LUMINANCE8_ALPHA8', `GLU_LUMINANCE12_ALPHA4', | |
382 | `GLU_LUMINANCE12_ALPHA12', `GLU_LUMINANCE16_ALPHA16', | |
383 | `GLU_INTENSITY', `GLU_INTENSITY4', `GLU_INTENSITY8', | |
384 | `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB', `GLU_R3_G3_B2', | |
385 | `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10', `GLU_RGB12', | |
386 | `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4', `GLU_RGB5_A1', | |
387 | `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or `GLU_RGBA16'. | |
3c9b6116 AW |
388 | |
389 | WIDTH | |
390 | Specifies the width, in pixels, of the texture image. | |
391 | ||
392 | FORMAT | |
c7b31271 | 393 | Specifies the format of the pixel data. Must be one of |
3c9b6116 AW |
394 | `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN', |
395 | `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR', | |
396 | `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'. | |
397 | ||
398 | TYPE | |
c7b31271 | 399 | Specifies the data type for DATA. Must be one of |
3c9b6116 AW |
400 | `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP', |
401 | `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT', | |
402 | `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2', | |
403 | `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5', | |
404 | `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4', | |
405 | `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1', | |
406 | `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8', | |
407 | `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or | |
408 | `GLU_UNSIGNED_INT_2_10_10_10_REV'. | |
409 | ||
410 | DATA | |
411 | Specifies a pointer to the image data in memory. | |
412 | ||
413 | `gluBuild1DMipmaps' builds a series of prefiltered one-dimensional | |
c7b31271 DH |
414 | texture maps of decreasing resolutions called a mipmap. This is used |
415 | for the antialiasing of texture mapped primitives. | |
3c9b6116 | 416 | |
8925f36f | 417 | A return value of zero indicates success, otherwise a GLU error code is |
3c9b6116 AW |
418 | returned (see `gluErrorString'). |
419 | ||
c7b31271 DH |
420 | Initially, the WIDTH of DATA is checked to see if it is a power of 2. If |
421 | not, a copy of DATA is scaled up or down to the nearest power of 2. (If | |
3c9b6116 AW |
422 | WIDTH is exactly between powers of 2, then the copy of DATA will scale |
423 | upwards.) This copy will be used for subsequent mipmapping operations | |
c7b31271 | 424 | described below. For example, if WIDTH is 57, then a copy of DATA will |
3c9b6116 AW |
425 | scale up to 64 before mipmapping takes place. |
426 | ||
427 | Then, proxy textures (see `glTexImage1D') are used to determine if the | |
c7b31271 | 428 | implementation can fit the requested texture. If not, WIDTH is |
3c9b6116 AW |
429 | continually halved until it fits. |
430 | ||
431 | Next, a series of mipmap levels is built by decimating a copy of DATA in | |
c7b31271 | 432 | half until size 1×1 is reached. At each level, each texel in the halved |
3c9b6116 AW |
433 | mipmap level is an average of the corresponding two texels in the larger |
434 | mipmap level. | |
435 | ||
c7b31271 DH |
436 | `glTexImage1D' is called to load each of these mipmap levels. Level 0 |
437 | is a copy of DATA. The highest level is LOG_2,\u2061(WIDTH,) . For example, | |
438 | if WIDTH is 64 and the implementation can store a texture of this size, | |
439 | the following mipmap levels are built: 64×1 , 32×1 , 16×1 , 8×1 , 4×1 , | |
440 | 2×1 , and 1×1 . These correspond to levels 0 through 6, respectively. | |
3c9b6116 AW |
441 | |
442 | See the `glTexImage1D' reference page for a description of the | |
c7b31271 | 443 | acceptable values for the TYPE parameter. See the `glDrawPixels' |
3c9b6116 AW |
444 | reference page for a description of the acceptable values for the DATA |
445 | parameter. | |
446 | ||
447 | `GLU_INVALID_VALUE' is returned if WIDTH is < 1. | |
448 | ||
449 | `GLU_INVALID_ENUM' is returned if FORMAT or TYPE are not legal. | |
450 | ||
451 | `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2' | |
452 | or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'. | |
453 | ||
454 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
455 | `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
456 | is not `GLU_RGB'. | |
457 | ||
458 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
459 | `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and | |
460 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
461 | ||
462 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
463 | `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and | |
464 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
465 | ||
466 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
467 | `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT | |
468 | is neither `GLU_RGBA' nor `GLU_BGRA'. | |
469 | ||
470 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
471 | `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and | |
472 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") | |
8925f36f | 473 | |
25072f02 | 474 | (define-glu-procedures |
bb894c9d AW |
475 | ((gluBuild2DMipmapLevels |
476 | (target GLenum) | |
477 | (internalFormat GLint) | |
478 | (width GLsizei) | |
479 | (height GLsizei) | |
480 | (format GLenum) | |
481 | (type GLenum) | |
482 | (level GLint) | |
483 | (base GLint) | |
484 | (max GLint) | |
00239761 | 485 | (data const-void-*) |
bb894c9d AW |
486 | -> |
487 | GLint)) | |
3c9b6116 AW |
488 | "Builds a subset of two-dimensional mipmap levels. |
489 | ||
490 | TARGET | |
c7b31271 | 491 | Specifies the target texture. Must be `GLU_TEXTURE_2D'. |
3c9b6116 AW |
492 | |
493 | INTERNALFORMAT | |
c7b31271 DH |
494 | Requests the internal storage format of the texture image. The |
495 | most current version of the SGI implementation of GLU does not | |
496 | check this value for validity before passing it on to the | |
497 | underlying OpenGL implementation. A value that is not accepted by | |
498 | the OpenGL implementation will lead to an OpenGL error. The | |
499 | benefit of not checking this value at the GLU level is that OpenGL | |
500 | extensions can add new internal texture formats without requiring a | |
501 | revision of the GLU implementation. Older implementations of GLU | |
502 | check this value and raise a GLU error if it is not 1, 2, 3, or 4 | |
503 | or one of the following symbolic constants: `GLU_ALPHA', | |
504 | `GLU_ALPHA4', `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', | |
505 | `GLU_LUMINANCE', `GLU_LUMINANCE4', `GLU_LUMINANCE8', | |
506 | `GLU_LUMINANCE12', `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', | |
507 | `GLU_LUMINANCE4_ALPHA4', `GLU_LUMINANCE6_ALPHA2', | |
508 | `GLU_LUMINANCE8_ALPHA8', `GLU_LUMINANCE12_ALPHA4', | |
509 | `GLU_LUMINANCE12_ALPHA12', `GLU_LUMINANCE16_ALPHA16', | |
510 | `GLU_INTENSITY', `GLU_INTENSITY4', `GLU_INTENSITY8', | |
511 | `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB', `GLU_R3_G3_B2', | |
512 | `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10', `GLU_RGB12', | |
513 | `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4', `GLU_RGB5_A1', | |
514 | `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or `GLU_RGBA16'. | |
3c9b6116 AW |
515 | |
516 | WIDTH | |
517 | HEIGHT | |
518 | ||
519 | Specifies the width and height, respectively, in pixels of the | |
c7b31271 | 520 | texture image. These should be a power of 2. |
3c9b6116 AW |
521 | |
522 | FORMAT | |
c7b31271 | 523 | Specifies the format of the pixel data. Must be one of |
3c9b6116 AW |
524 | `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN', |
525 | `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR', | |
526 | `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'. | |
527 | ||
528 | TYPE | |
c7b31271 | 529 | Specifies the data type for DATA. Must be one of |
3c9b6116 AW |
530 | `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP', |
531 | `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT', | |
532 | `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2', | |
533 | `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5', | |
534 | `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4', | |
535 | `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1', | |
536 | `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8', | |
537 | `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or | |
538 | `GLU_UNSIGNED_INT_2_10_10_10_REV'. | |
539 | ||
540 | LEVEL | |
541 | Specifies the mipmap level of the image data. | |
542 | ||
543 | BASE | |
544 | Specifies the minimum mipmap level to pass to `glTexImage2D'. | |
545 | ||
546 | MAX | |
547 | Specifies the maximum mipmap level to pass to `glTexImage2D'. | |
548 | ||
549 | DATA | |
550 | Specifies a pointer to the image data in memory. | |
551 | ||
552 | `gluBuild2DMipmapLevels' builds a subset of prefiltered two-dimensional | |
c7b31271 DH |
553 | texture maps of decreasing resolutions called a mipmap. This is used |
554 | for the antialiasing of texture mapped primitives. | |
3c9b6116 | 555 | |
8925f36f | 556 | A return value of zero indicates success, otherwise a GLU error code is |
3c9b6116 AW |
557 | returned (see `gluErrorString'). |
558 | ||
559 | A series of mipmap levels from BASE to MAX is built by decimating DATA | |
c7b31271 | 560 | in half along both dimensions until size 1×1 is reached. At each level, |
3c9b6116 | 561 | each texel in the halved mipmap level is an average of the corresponding |
c7b31271 | 562 | four texels in the larger mipmap level. (In the case of rectangular |
3c9b6116 | 563 | images, the decimation will ultimately reach an N×1 or 1×N |
c7b31271 DH |
564 | configuration. Here, two texels are averaged instead.) `glTexImage2D' |
565 | is called to load these mipmap levels from BASE to MAX. If MAX is | |
566 | larger than the highest mipmap level for the texture of the specified | |
567 | size, then a GLU error code is returned (see `gluErrorString') and | |
568 | nothing is loaded. | |
3c9b6116 AW |
569 | |
570 | For example, if LEVEL is 2 and WIDTH is 16 and HEIGHT is 8, the | |
c7b31271 DH |
571 | following levels are possible: 16×8 , 8×4 , 4×2 , 2×1 , 1×1 . These |
572 | correspond to levels 2 through 6 respectively. If BASE is 3 and MAX is | |
573 | 5, then only mipmap levels 8×4 , 4×2 , and 2×1 are loaded. However, if | |
3c9b6116 AW |
574 | MAX is 7, then an error is returned and nothing is loaded since MAX is |
575 | larger than the highest mipmap level which is, in this case, 6. | |
576 | ||
577 | The highest mipmap level can be derived from the formula | |
578 | LOG_2\u2061(MAX\u2061(WIDTH,HEIGHT)×2^LEVEL,) . | |
579 | ||
580 | See the `glTexImage1D' reference page for a description of the | |
c7b31271 DH |
581 | acceptable values for FORMAT parameter. See the `glDrawPixels' |
582 | reference page for a description of the acceptable values for TYPE | |
583 | parameter. | |
3c9b6116 AW |
584 | |
585 | `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE, | |
586 | or MAX is > the highest mipmap level for DATA. | |
587 | ||
588 | `GLU_INVALID_VALUE' is returned if WIDTH or HEIGHT is < 1. | |
589 | ||
590 | `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not | |
591 | legal. | |
592 | ||
593 | `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2' | |
594 | or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'. | |
595 | ||
596 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
597 | `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
598 | is not `GLU_RGB'. | |
599 | ||
600 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
601 | `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and | |
602 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
603 | ||
604 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
605 | `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and | |
606 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
607 | ||
608 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
609 | `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT | |
610 | is neither `GLU_RGBA' nor `GLU_BGRA'. | |
611 | ||
612 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
613 | `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and | |
614 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") | |
8925f36f | 615 | |
25072f02 | 616 | (define-glu-procedures |
bb894c9d AW |
617 | ((gluBuild2DMipmaps |
618 | (target GLenum) | |
619 | (internalFormat GLint) | |
620 | (width GLsizei) | |
621 | (height GLsizei) | |
622 | (format GLenum) | |
623 | (type GLenum) | |
00239761 | 624 | (data const-void-*) |
bb894c9d AW |
625 | -> |
626 | GLint)) | |
3c9b6116 AW |
627 | "Builds a two-dimensional mipmap. |
628 | ||
629 | TARGET | |
c7b31271 | 630 | Specifies the target texture. Must be `GLU_TEXTURE_2D'. |
3c9b6116 AW |
631 | |
632 | INTERNALFORMAT | |
c7b31271 DH |
633 | Requests the internal storage format of the texture image. The |
634 | most current version of the SGI implementation of GLU does not | |
635 | check this value for validity before passing it on to the | |
636 | underlying OpenGL implementation. A value that is not accepted by | |
637 | the OpenGL implementation will lead to an OpenGL error. The | |
638 | benefit of not checking this value at the GLU level is that OpenGL | |
639 | extensions can add new internal texture formats without requiring a | |
640 | revision of the GLU implementation. Older implementations of GLU | |
641 | check this value and raise a GLU error if it is not 1, 2, 3, or 4 | |
642 | or one of the following symbolic constants: `GLU_ALPHA', | |
643 | `GLU_ALPHA4', `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', | |
644 | `GLU_LUMINANCE', `GLU_LUMINANCE4', `GLU_LUMINANCE8', | |
645 | `GLU_LUMINANCE12', `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', | |
646 | `GLU_LUMINANCE4_ALPHA4', `GLU_LUMINANCE6_ALPHA2', | |
647 | `GLU_LUMINANCE8_ALPHA8', `GLU_LUMINANCE12_ALPHA4', | |
648 | `GLU_LUMINANCE12_ALPHA12', `GLU_LUMINANCE16_ALPHA16', | |
649 | `GLU_INTENSITY', `GLU_INTENSITY4', `GLU_INTENSITY8', | |
650 | `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB', `GLU_R3_G3_B2', | |
651 | `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10', `GLU_RGB12', | |
652 | `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4', `GLU_RGB5_A1', | |
653 | `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or `GLU_RGBA16'. | |
3c9b6116 AW |
654 | |
655 | WIDTH | |
656 | HEIGHT | |
657 | ||
658 | Specifies in pixels the width and height, respectively, of the | |
659 | texture image. | |
660 | ||
661 | FORMAT | |
c7b31271 | 662 | Specifies the format of the pixel data. Must be one of |
3c9b6116 AW |
663 | `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN', |
664 | `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR', | |
665 | `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'. | |
666 | ||
667 | TYPE | |
c7b31271 | 668 | Specifies the data type for DATA. Must be one of |
3c9b6116 AW |
669 | `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP', |
670 | `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT', | |
671 | `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2', | |
672 | `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5', | |
673 | `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4', | |
674 | `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1', | |
675 | `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8', | |
676 | `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or | |
677 | `GLU_UNSIGNED_INT_2_10_10_10_REV'. | |
678 | ||
679 | DATA | |
680 | Specifies a pointer to the image data in memory. | |
681 | ||
682 | `gluBuild2DMipmaps' builds a series of prefiltered two-dimensional | |
c7b31271 DH |
683 | texture maps of decreasing resolutions called a mipmap. This is used |
684 | for the antialiasing of texture-mapped primitives. | |
3c9b6116 | 685 | |
8925f36f | 686 | A return value of zero indicates success, otherwise a GLU error code is |
3c9b6116 AW |
687 | returned (see `gluErrorString'). |
688 | ||
689 | Initially, the WIDTH and HEIGHT of DATA are checked to see if they are a | |
c7b31271 DH |
690 | power of 2. If not, a copy of DATA (not DATA), is scaled up or down to |
691 | the nearest power of 2. This copy will be used for subsequent | |
692 | mipmapping operations described below. (If WIDTH or HEIGHT is exactly | |
693 | between powers of 2, then the copy of DATA will scale upwards.) For | |
694 | example, if WIDTH is 57 and HEIGHT is 23, then a copy of DATA will scale | |
695 | up to 64 in WIDTH and down to 16 in depth, before mipmapping takes | |
696 | place. | |
3c9b6116 AW |
697 | |
698 | Then, proxy textures (see `glTexImage2D') are used to determine if the | |
c7b31271 DH |
699 | implementation can fit the requested texture. If not, both dimensions |
700 | are continually halved until it fits. (If the OpenGL version is \\(<= | |
3c9b6116 AW |
701 | 1.0, both maximum texture dimensions are clamped to the value returned |
702 | by `glGetIntegerv' with the argument `GLU_MAX_TEXTURE_SIZE'.) | |
703 | ||
704 | Next, a series of mipmap levels is built by decimating a copy of DATA in | |
c7b31271 | 705 | half along both dimensions until size 1×1 is reached. At each level, |
3c9b6116 | 706 | each texel in the halved mipmap level is an average of the corresponding |
c7b31271 | 707 | four texels in the larger mipmap level. (In the case of rectangular |
3c9b6116 | 708 | images, the decimation will ultimately reach an N×1 or 1×N |
c7b31271 | 709 | configuration. Here, two texels are averaged instead.) |
3c9b6116 | 710 | |
c7b31271 DH |
711 | `glTexImage2D' is called to load each of these mipmap levels. Level 0 |
712 | is a copy of DATA. The highest level is LOG_2,\u2061(MAX\u2061(WIDTH,HEIGHT),) . | |
713 | For example, if WIDTH is 64 and HEIGHT is 16 and the implementation can | |
3c9b6116 AW |
714 | store a texture of this size, the following mipmap levels are built: |
715 | 64×16 , 32×8 , 16×4 , 8×2 , 4×1 , 2×1 , and 1×1 These correspond to | |
716 | levels 0 through 6, respectively. | |
717 | ||
718 | See the `glTexImage1D' reference page for a description of the | |
c7b31271 DH |
719 | acceptable values for FORMAT parameter. See the `glDrawPixels' |
720 | reference page for a description of the acceptable values for TYPE | |
721 | parameter. | |
3c9b6116 AW |
722 | |
723 | `GLU_INVALID_VALUE' is returned if WIDTH or HEIGHT is < 1. | |
724 | ||
725 | `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not | |
726 | legal. | |
727 | ||
728 | `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2' | |
729 | or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'. | |
730 | ||
731 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
732 | `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
733 | is not `GLU_RGB'. | |
734 | ||
735 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
736 | `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and | |
737 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
738 | ||
739 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
740 | `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and | |
741 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
742 | ||
743 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
744 | `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT | |
745 | is neither `GLU_RGBA' nor `GLU_BGRA'. | |
746 | ||
747 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
748 | `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and | |
749 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") | |
8925f36f | 750 | |
25072f02 | 751 | (define-glu-procedures |
bb894c9d AW |
752 | ((gluBuild3DMipmapLevels |
753 | (target GLenum) | |
754 | (internalFormat GLint) | |
755 | (width GLsizei) | |
756 | (height GLsizei) | |
757 | (depth GLsizei) | |
758 | (format GLenum) | |
759 | (type GLenum) | |
760 | (level GLint) | |
761 | (base GLint) | |
762 | (max GLint) | |
00239761 | 763 | (data const-void-*) |
bb894c9d AW |
764 | -> |
765 | GLint)) | |
3c9b6116 AW |
766 | "Builds a subset of three-dimensional mipmap levels. |
767 | ||
768 | TARGET | |
c7b31271 | 769 | Specifies the target texture. Must be `GLU_TEXTURE_3D'. |
3c9b6116 AW |
770 | |
771 | INTERNALFORMAT | |
c7b31271 DH |
772 | Requests the internal storage format of the texture image. The |
773 | most current version of the SGI implementation of GLU does not | |
774 | check this value for validity before passing it on to the | |
775 | underlying OpenGL implementation. A value that is not accepted by | |
776 | the OpenGL implementation will lead to an OpenGL error. The | |
777 | benefit of not checking this value at the GLU level is that OpenGL | |
778 | extensions can add new internal texture formats without requiring a | |
779 | revision of the GLU implementation. Older implementations of GLU | |
780 | check this value and raise a GLU error if it is not 1, 2, 3, or 4 | |
781 | or one of the following symbolic constants: `GLU_ALPHA', | |
782 | `GLU_ALPHA4', `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', | |
783 | `GLU_LUMINANCE', `GLU_LUMINANCE4', `GLU_LUMINANCE8', | |
784 | `GLU_LUMINANCE12', `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', | |
785 | `GLU_LUMINANCE4_ALPHA4', `GLU_LUMINANCE6_ALPHA2', | |
786 | `GLU_LUMINANCE8_ALPHA8', `GLU_LUMINANCE12_ALPHA4', | |
787 | `GLU_LUMINANCE12_ALPHA12', `GLU_LUMINANCE16_ALPHA16', | |
788 | `GLU_INTENSITY', `GLU_INTENSITY4', `GLU_INTENSITY8', | |
789 | `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB', `GLU_R3_G3_B2', | |
790 | `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10', `GLU_RGB12', | |
791 | `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4', `GLU_RGB5_A1', | |
792 | `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or `GLU_RGBA16'. | |
3c9b6116 AW |
793 | |
794 | WIDTH | |
795 | HEIGHT | |
796 | ||
797 | DEPTH | |
798 | ||
799 | Specifies in pixels the width, height and depth respectively, of | |
c7b31271 | 800 | the texture image. These should be a power of 2. |
3c9b6116 AW |
801 | |
802 | FORMAT | |
c7b31271 | 803 | Specifies the format of the pixel data. Must be one of |
3c9b6116 AW |
804 | `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN', |
805 | `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR', | |
806 | `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'. | |
807 | ||
808 | TYPE | |
c7b31271 | 809 | Specifies the data type for DATA. Must be one of |
3c9b6116 AW |
810 | `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP', |
811 | `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT', | |
812 | `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2', | |
813 | `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5', | |
814 | `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4', | |
815 | `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1', | |
816 | `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8', | |
817 | `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or | |
818 | `GLU_UNSIGNED_INT_2_10_10_10_REV'. | |
819 | ||
820 | LEVEL | |
821 | Specifies the mipmap level of the image data. | |
822 | ||
823 | BASE | |
824 | Specifies the minimum mipmap level to pass to `glTexImage3D'. | |
825 | ||
826 | MAX | |
827 | Specifies the maximum mipmap level to pass to `glTexImage3D'. | |
828 | ||
829 | DATA | |
830 | Specifies a pointer to the image data in memory. | |
831 | ||
832 | `gluBuild3DMipmapLevels' builds a subset of prefiltered | |
833 | three-dimensional texture maps of decreasing resolutions called a | |
c7b31271 | 834 | mipmap. This is used for the antialiasing of texture mapped primitives. |
3c9b6116 | 835 | |
8925f36f | 836 | A return value of zero indicates success, otherwise a GLU error code is |
3c9b6116 AW |
837 | returned (see `gluErrorString'). |
838 | ||
839 | A series of mipmap levels from BASE to MAX is built by decimating DATA | |
c7b31271 | 840 | in half along both dimensions until size 1×1×1 is reached. At each |
3c9b6116 | 841 | level, each texel in the halved mipmap level is an average of the |
c7b31271 DH |
842 | corresponding eight texels in the larger mipmap level. (If exactly one |
843 | of the dimensions is 1, four texels are averaged. If exactly two of the | |
3c9b6116 | 844 | dimensions are 1, two texels are averaged.) `glTexImage3D' is called to |
c7b31271 | 845 | load these mipmap levels from BASE to MAX. If MAX is larger than the |
3c9b6116 AW |
846 | highest mipmap level for the texture of the specified size, then a GLU |
847 | error code is returned (see `gluErrorString') and nothing is loaded. | |
848 | ||
849 | For example, if LEVEL is 2 and WIDTH is 16, HEIGHT is 8 and DEPTH is 4, | |
850 | the following levels are possible: 16×8×4 , 8×4×2 , 4×2×1 , 2×1×1 , | |
c7b31271 DH |
851 | 1×1×1 . These correspond to levels 2 through 6 respectively. If BASE |
852 | is 3 and MAX is 5, then only mipmap levels 8×4×2 , 4×2×1 , and 2×1×1 are | |
853 | loaded. However, if MAX is 7, then an error is returned and nothing is | |
3c9b6116 AW |
854 | loaded, since MAX is larger than the highest mipmap level which is, in |
855 | this case, 6. | |
856 | ||
857 | The highest mipmap level can be derived from the formula | |
858 | LOG_2\u2061(MAX\u2061(WIDTH,HEIGHTDEPTH)×2^LEVEL,) . | |
859 | ||
860 | See the `glTexImage1D' reference page for a description of the | |
c7b31271 DH |
861 | acceptable values for FORMAT parameter. See the `glDrawPixels' |
862 | reference page for a description of the acceptable values for TYPE | |
863 | parameter. | |
3c9b6116 AW |
864 | |
865 | `GLU_INVALID_VALUE' is returned if LEVEL > BASE, BASE < 0, MAX < BASE, | |
866 | or MAX is > the highest mipmap level for DATA. | |
867 | ||
868 | `GLU_INVALID_VALUE' is returned if WIDTH, HEIGHT, or DEPTH is < 1. | |
869 | ||
870 | `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not | |
871 | legal. | |
872 | ||
873 | `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2' | |
874 | or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'. | |
875 | ||
876 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
877 | `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
878 | is not `GLU_RGB'. | |
879 | ||
880 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
881 | `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and | |
882 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
883 | ||
884 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
885 | `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and | |
886 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
887 | ||
888 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
889 | `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT | |
890 | is neither `GLU_RGBA' nor `GLU_BGRA'. | |
891 | ||
892 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
893 | `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and | |
894 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") | |
8925f36f | 895 | |
25072f02 | 896 | (define-glu-procedures |
bb894c9d AW |
897 | ((gluBuild3DMipmaps |
898 | (target GLenum) | |
899 | (internalFormat GLint) | |
900 | (width GLsizei) | |
901 | (height GLsizei) | |
902 | (depth GLsizei) | |
903 | (format GLenum) | |
904 | (type GLenum) | |
00239761 | 905 | (data const-void-*) |
bb894c9d AW |
906 | -> |
907 | GLint)) | |
3c9b6116 AW |
908 | "Builds a three-dimensional mipmap. |
909 | ||
910 | TARGET | |
c7b31271 | 911 | Specifies the target texture. Must be `GLU_TEXTURE_3D'. |
3c9b6116 AW |
912 | |
913 | INTERNALFORMAT | |
c7b31271 DH |
914 | Requests the internal storage format of the texture image. The |
915 | most current version of the SGI implementation of GLU does not | |
916 | check this value for validity before passing it on to the | |
917 | underlying OpenGL implementation. A value that is not accepted by | |
918 | the OpenGL implementation will lead to an OpenGL error. The | |
919 | benefit of not checking this value at the GLU level is that OpenGL | |
920 | extensions can add new internal texture formats without requiring a | |
921 | revision of the GLU implementation. Older implementations of GLU | |
922 | check this value and raise a GLU error if it is not 1, 2, 3, or 4 | |
923 | or one of the following symbolic constants: `GLU_ALPHA', | |
924 | `GLU_ALPHA4', `GLU_ALPHA8', `GLU_ALPHA12', `GLU_ALPHA16', | |
925 | `GLU_LUMINANCE', `GLU_LUMINANCE4', `GLU_LUMINANCE8', | |
926 | `GLU_LUMINANCE12', `GLU_LUMINANCE16', `GLU_LUMINANCE_ALPHA', | |
927 | `GLU_LUMINANCE4_ALPHA4', `GLU_LUMINANCE6_ALPHA2', | |
928 | `GLU_LUMINANCE8_ALPHA8', `GLU_LUMINANCE12_ALPHA4', | |
929 | `GLU_LUMINANCE12_ALPHA12', `GLU_LUMINANCE16_ALPHA16', | |
930 | `GLU_INTENSITY', `GLU_INTENSITY4', `GLU_INTENSITY8', | |
931 | `GLU_INTENSITY12', `GLU_INTENSITY16', `GLU_RGB', `GLU_R3_G3_B2', | |
932 | `GLU_RGB4', `GLU_RGB5', `GLU_RGB8', `GLU_RGB10', `GLU_RGB12', | |
933 | `GLU_RGB16', `GLU_RGBA', `GLU_RGBA2', `GLU_RGBA4', `GLU_RGB5_A1', | |
934 | `GLU_RGBA8', `GLU_RGB10_A2', `GLU_RGBA12', or `GLU_RGBA16'. | |
3c9b6116 AW |
935 | |
936 | WIDTH | |
937 | HEIGHT | |
938 | ||
939 | DEPTH | |
940 | ||
941 | Specifies in pixels the width, height and depth respectively, in | |
942 | pixels of the texture image. | |
943 | ||
944 | FORMAT | |
c7b31271 | 945 | Specifies the format of the pixel data. Must be one of |
3c9b6116 AW |
946 | `GLU_COLOR_INDEX', `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN', |
947 | `GLU_BLUE', `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR', | |
948 | `GLU_BGRA', `GLU_LUMINANCE', or `GLU_LUMINANCE_ALPHA'. | |
949 | ||
950 | TYPE | |
c7b31271 | 951 | Specifies the data type for DATA. Must be one of: |
3c9b6116 AW |
952 | `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP', |
953 | `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT', | |
954 | `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2', | |
955 | `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5', | |
956 | `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4', | |
957 | `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1', | |
958 | `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8', | |
959 | `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or | |
960 | `GLU_UNSIGNED_INT_2_10_10_10_REV'. | |
961 | ||
962 | DATA | |
963 | Specifies a pointer to the image data in memory. | |
964 | ||
965 | `gluBuild3DMipmaps' builds a series of prefiltered three-dimensional | |
c7b31271 DH |
966 | texture maps of decreasing resolutions called a mipmap. This is used |
967 | for the antialiasing of texture-mapped primitives. | |
3c9b6116 | 968 | |
8925f36f | 969 | A return value of zero indicates success, otherwise a GLU error code is |
3c9b6116 AW |
970 | returned (see `gluErrorString'). |
971 | ||
972 | Initially, the WIDTH, HEIGHT and DEPTH of DATA are checked to see if | |
c7b31271 DH |
973 | they are a power of 2. If not, a copy of DATA is made and scaled up or |
974 | down to the nearest power of 2. (If WIDTH, HEIGHT, or DEPTH is exactly | |
3c9b6116 AW |
975 | between powers of 2, then the copy of DATA will scale upwards.) This |
976 | copy will be used for subsequent mipmapping operations described below. | |
977 | For example, if WIDTH is 57, HEIGHT is 23, and DEPTH is 24, then a copy | |
978 | of DATA will scale up to 64 in width, down to 16 in height, and up to 32 | |
979 | in depth before mipmapping takes place. | |
980 | ||
981 | Then, proxy textures (see `glTexImage3D') are used to determine if the | |
c7b31271 | 982 | implementation can fit the requested texture. If not, all three |
3c9b6116 AW |
983 | dimensions are continually halved until it fits. |
984 | ||
985 | Next, a series of mipmap levels is built by decimating a copy of DATA in | |
c7b31271 | 986 | half along all three dimensions until size 1×1×1 is reached. At each |
3c9b6116 | 987 | level, each texel in the halved mipmap level is an average of the |
c7b31271 DH |
988 | corresponding eight texels in the larger mipmap level. (If exactly one |
989 | of the dimensions is 1, four texels are averaged. If exactly two of the | |
3c9b6116 AW |
990 | dimensions are 1, two texels are averaged.) |
991 | ||
c7b31271 DH |
992 | `glTexImage3D' is called to load each of these mipmap levels. Level 0 |
993 | is a copy of DATA. The highest level is | |
994 | LOG_2,\u2061(MAX\u2061(WIDTH,HEIGHTDEPTH),) . For example, if WIDTH is 64, HEIGHT | |
995 | is 16, and DEPTH is 32, and the implementation can store a texture of | |
996 | this size, the following mipmap levels are built: 64×16×32 , 32×8×16 , | |
997 | 16×4×8 , 8×2×4 , 4×1×2 , 2×1×1 , and 1×1×1 . These correspond to levels | |
998 | 0 through 6, respectively. | |
3c9b6116 AW |
999 | |
1000 | See the `glTexImage1D' reference page for a description of the | |
c7b31271 DH |
1001 | acceptable values for FORMAT parameter. See the `glDrawPixels' |
1002 | reference page for a description of the acceptable values for TYPE | |
1003 | parameter. | |
3c9b6116 AW |
1004 | |
1005 | `GLU_INVALID_VALUE' is returned if WIDTH, HEIGHT, or DEPTH is < 1. | |
1006 | ||
1007 | `GLU_INVALID_ENUM' is returned if INTERNALFORMAT, FORMAT, or TYPE is not | |
1008 | legal. | |
1009 | ||
1010 | `GLU_INVALID_OPERATION' is returned if TYPE is `GLU_UNSIGNED_BYTE_3_3_2' | |
1011 | or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is not `GLU_RGB'. | |
1012 | ||
1013 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
1014 | `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
1015 | is not `GLU_RGB'. | |
1016 | ||
1017 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
1018 | `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and | |
1019 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
1020 | ||
1021 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
1022 | `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and | |
1023 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
1024 | ||
1025 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
1026 | `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT | |
1027 | is neither `GLU_RGBA' nor `GLU_BGRA'. | |
1028 | ||
1029 | `GLU_INVALID_OPERATION' is returned if TYPE is | |
1030 | `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and | |
1031 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") | |
8925f36f | 1032 | |
25072f02 | 1033 | (define-glu-procedures |
bb894c9d | 1034 | ((gluCheckExtension |
00239761 AW |
1035 | (extName const-GLubyte-*) |
1036 | (extString const-GLubyte-*) | |
bb894c9d AW |
1037 | -> |
1038 | GLboolean)) | |
3c9b6116 AW |
1039 | "Determines if an extension name is supported. |
1040 | ||
1041 | EXTNAME | |
1042 | Specifies an extension name. | |
1043 | ||
1044 | EXTSTRING | |
1045 | Specifies a space-separated list of extension names supported. | |
1046 | ||
1047 | `gluCheckExtension' returns `GLU_TRUE' if EXTNAME is supported otherwise | |
1048 | `GLU_FALSE' is returned. | |
1049 | ||
1050 | This is used to check for the presence for OpenGL, GLU, or GLX extension | |
1051 | names by passing the extension strings returned by `glGetString', | |
1052 | `gluGetString', `glXGetClientString', `glXQueryExtensionsString', or | |
1053 | `glXQueryServerString', respectively, as EXTSTRING.") | |
8925f36f | 1054 | |
25072f02 | 1055 | (define-glu-procedures |
bb894c9d | 1056 | ((gluCylinder |
00239761 | 1057 | (quad GLUquadric*) |
bb894c9d AW |
1058 | (base GLdouble) |
1059 | (top GLdouble) | |
1060 | (height GLdouble) | |
1061 | (slices GLint) | |
1062 | (stacks GLint) | |
1063 | -> | |
1064 | void)) | |
3c9b6116 AW |
1065 | "Draw a cylinder. |
1066 | ||
1067 | QUAD | |
1068 | Specifies the quadrics object (created with `gluNewQuadric'). | |
1069 | ||
1070 | BASE | |
1071 | Specifies the radius of the cylinder at Z = 0. | |
1072 | ||
1073 | TOP | |
1074 | Specifies the radius of the cylinder at Z = HEIGHT. | |
1075 | ||
1076 | HEIGHT | |
1077 | Specifies the height of the cylinder. | |
1078 | ||
1079 | SLICES | |
1080 | Specifies the number of subdivisions around the Z axis. | |
1081 | ||
1082 | STACKS | |
1083 | Specifies the number of subdivisions along the Z axis. | |
1084 | ||
c7b31271 DH |
1085 | `gluCylinder' draws a cylinder oriented along the Z axis. The base of |
1086 | the cylinder is placed at Z = 0 and the top at Z=HEIGHT . Like a | |
1087 | sphere, a cylinder is subdivided around the Z axis into slices and along | |
1088 | the Z axis into stacks. | |
3c9b6116 AW |
1089 | |
1090 | Note that if TOP is set to 0.0, this routine generates a cone. | |
1091 | ||
1092 | If the orientation is set to `GLU_OUTSIDE' (with | |
1093 | `gluQuadricOrientation'), then any generated normals point away from the | |
c7b31271 | 1094 | Z axis. Otherwise, they point toward the Z axis. |
3c9b6116 AW |
1095 | |
1096 | If texturing is turned on (with `gluQuadricTexture'), then texture | |
1097 | coordinates are generated so that T ranges linearly from 0.0 at Z = 0 to | |
1098 | 1.0 at Z = HEIGHT, and S ranges from 0.0 at the +Y axis, to 0.25 at the | |
1099 | +X axis, to 0.5 at the -Y axis, to 0.75 at the \\-X axis, and back to 1.0 | |
1100 | at the +Y axis.") | |
8925f36f | 1101 | |
25072f02 | 1102 | (define-glu-procedures |
00239761 | 1103 | ((gluDeleteNurbsRenderer (nurb GLUnurbs*) -> void)) |
3c9b6116 AW |
1104 | "Destroy a NURBS object. |
1105 | ||
1106 | NURB | |
1107 | Specifies the NURBS object to be destroyed. | |
1108 | ||
1109 | `gluDeleteNurbsRenderer' destroys the NURBS object (which was created | |
c7b31271 | 1110 | with `gluNewNurbsRenderer') and frees any memory it uses. Once |
3c9b6116 | 1111 | `gluDeleteNurbsRenderer' has been called, NURB cannot be used again.") |
8925f36f | 1112 | |
25072f02 | 1113 | (define-glu-procedures |
00239761 | 1114 | ((gluDeleteQuadric (quad GLUquadric*) -> void)) |
3c9b6116 AW |
1115 | "Destroy a quadrics object. |
1116 | ||
1117 | QUAD | |
1118 | Specifies the quadrics object to be destroyed. | |
1119 | ||
1120 | `gluDeleteQuadric' destroys the quadrics object (created with | |
c7b31271 | 1121 | `gluNewQuadric') and frees any memory it uses. Once `gluDeleteQuadric' |
3c9b6116 | 1122 | has been called, QUAD cannot be used again.") |
8925f36f | 1123 | |
25072f02 | 1124 | (define-glu-procedures |
00239761 | 1125 | ((gluDeleteTess (tess GLUtesselator*) -> void)) |
3c9b6116 AW |
1126 | "Destroy a tessellation object. |
1127 | ||
1128 | TESS | |
1129 | Specifies the tessellation object to destroy. | |
1130 | ||
1131 | `gluDeleteTess' destroys the indicated tessellation object (which was | |
1132 | created with `gluNewTess') and frees any memory that it used.") | |
8925f36f | 1133 | |
25072f02 | 1134 | (define-glu-procedures |
bb894c9d | 1135 | ((gluDisk |
00239761 | 1136 | (quad GLUquadric*) |
bb894c9d AW |
1137 | (inner GLdouble) |
1138 | (outer GLdouble) | |
1139 | (slices GLint) | |
1140 | (loops GLint) | |
1141 | -> | |
1142 | void)) | |
3c9b6116 AW |
1143 | "Draw a disk. |
1144 | ||
1145 | QUAD | |
1146 | Specifies the quadrics object (created with `gluNewQuadric'). | |
1147 | ||
1148 | INNER | |
1149 | Specifies the inner radius of the disk (may be 0). | |
1150 | ||
1151 | OUTER | |
1152 | Specifies the outer radius of the disk. | |
1153 | ||
1154 | SLICES | |
1155 | Specifies the number of subdivisions around the Z axis. | |
1156 | ||
1157 | LOOPS | |
1158 | Specifies the number of concentric rings about the origin into | |
1159 | which the disk is subdivided. | |
1160 | ||
c7b31271 DH |
1161 | `gluDisk' renders a disk on the Z = 0 plane. The disk has a radius of |
1162 | OUTER and contains a concentric circular hole with a radius of INNER. If | |
1163 | INNER is 0, then no hole is generated. The disk is subdivided around | |
1164 | the Z axis into slices (like pizza slices) and also about the Z axis | |
1165 | into rings (as specified by SLICES and LOOPS, respectively). | |
3c9b6116 AW |
1166 | |
1167 | With respect to orientation, the +Z side of the disk is considered to be | |
c7b31271 | 1168 | ``outside'' (see `gluQuadricOrientation'). This means that if the |
3c9b6116 | 1169 | orientation is set to `GLU_OUTSIDE', then any normals generated point |
c7b31271 | 1170 | along the +Z axis. Otherwise, they point along the \\-Z axis. |
3c9b6116 AW |
1171 | |
1172 | If texturing has been turned on (with `gluQuadricTexture'), texture | |
1173 | coordinates are generated linearly such that where R=OUTER , the value | |
1174 | at (R, 0, 0) is (1, 0.5), at (0, R, 0) it is (0.5, 1), at (\\-R, 0, 0) it | |
1175 | is (0, 0.5), and at (0, \\-R, 0) it is (0.5, 0).") | |
8925f36f | 1176 | |
25072f02 | 1177 | (define-glu-procedures |
00239761 AW |
1178 | ((gluErrorString |
1179 | (error GLenum) | |
1180 | -> | |
1181 | const-GLubyte-*)) | |
3c9b6116 AW |
1182 | "Produce an error string from a GL or GLU error code. |
1183 | ||
1184 | ERROR | |
1185 | Specifies a GL or GLU error code. | |
1186 | ||
1187 | `gluErrorString' produces an error string from a GL or GLU error code. | |
c7b31271 | 1188 | The string is in ISO Latin 1 format. For example, |
3c9b6116 AW |
1189 | `gluErrorString'(`GLU_OUT_OF_MEMORY') returns the string OUT OF MEMORY. |
1190 | ||
1191 | The standard GLU error codes are `GLU_INVALID_ENUM', | |
c7b31271 DH |
1192 | `GLU_INVALID_VALUE', and `GLU_OUT_OF_MEMORY'. Certain other GLU |
1193 | functions can return specialized error codes through callbacks. See the | |
3c9b6116 AW |
1194 | `glGetError' reference page for the list of GL error codes. |
1195 | ||
1196 | `NULL' is returned if ERROR is not a valid GL or GLU error code.") | |
8925f36f | 1197 | |
25072f02 | 1198 | (define-glu-procedures |
bb894c9d | 1199 | ((gluGetNurbsProperty |
00239761 | 1200 | (nurb GLUnurbs*) |
bb894c9d | 1201 | (property GLenum) |
00239761 | 1202 | (data GLfloat*) |
bb894c9d AW |
1203 | -> |
1204 | void)) | |
3c9b6116 AW |
1205 | "Get a NURBS property. |
1206 | ||
1207 | NURB | |
1208 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
1209 | ||
1210 | PROPERTY | |
c7b31271 | 1211 | Specifies the property whose value is to be fetched. Valid values |
3c9b6116 AW |
1212 | are `GLU_CULLING', `GLU_SAMPLING_TOLERANCE', `GLU_DISPLAY_MODE', |
1213 | `GLU_AUTO_LOAD_MATRIX', `GLU_PARAMETRIC_TOLERANCE', | |
1214 | `GLU_SAMPLING_METHOD', `GLU_U_STEP', `GLU_V_STEP', and | |
1215 | `GLU_NURBS_MODE'. | |
1216 | ||
1217 | DATA | |
1218 | Specifies a pointer to the location into which the value of the | |
1219 | named property is written. | |
1220 | ||
1221 | `gluGetNurbsProperty' retrieves properties stored in a NURBS object. | |
1222 | These properties affect the way that NURBS curves and surfaces are | |
c7b31271 | 1223 | rendered. See the `gluNurbsProperty' reference page for information |
3c9b6116 | 1224 | about what the properties are and what they do.") |
8925f36f | 1225 | |
25072f02 | 1226 | (define-glu-procedures |
00239761 | 1227 | ((gluGetString (name GLenum) -> const-GLubyte-*)) |
3c9b6116 AW |
1228 | "Return a string describing the GLU version or GLU extensions . |
1229 | ||
1230 | NAME | |
1231 | Specifies a symbolic constant, one of `GLU_VERSION', or | |
1232 | `GLU_EXTENSIONS'. | |
1233 | ||
1234 | `gluGetString' returns a pointer to a static string describing the GLU | |
1235 | version or the GLU extensions that are supported. | |
1236 | ||
1237 | The version number is one of the following forms: | |
1238 | ||
1239 | MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER. | |
1240 | ||
1241 | The version string is of the following form: | |
1242 | ||
1243 | VERSION NUMBER<SPACE>VENDOR-SPECIFIC INFORMATION | |
1244 | ||
c7b31271 | 1245 | Vendor-specific information is optional. Its format and contents depend |
3c9b6116 AW |
1246 | on the implementation. |
1247 | ||
c7b31271 DH |
1248 | The standard GLU contains a basic set of features and capabilities. If |
1249 | a company or group of companies wish to support other features, these | |
1250 | may be included as extensions to the GLU. If NAME is `GLU_EXTENSIONS', | |
1251 | then `gluGetString' returns a space-separated list of names of supported | |
1252 | GLU extensions. (Extension names never contain spaces.) | |
3c9b6116 AW |
1253 | |
1254 | All strings are null-terminated. | |
1255 | ||
1256 | NULL is returned if NAME is not `GLU_VERSION' or `GLU_EXTENSIONS'.") | |
8925f36f | 1257 | |
25072f02 | 1258 | (define-glu-procedures |
bb894c9d | 1259 | ((gluGetTessProperty |
00239761 | 1260 | (tess GLUtesselator*) |
bb894c9d | 1261 | (which GLenum) |
00239761 | 1262 | (data GLdouble*) |
bb894c9d AW |
1263 | -> |
1264 | void)) | |
3c9b6116 AW |
1265 | "Get a tessellation object property. |
1266 | ||
1267 | TESS | |
1268 | Specifies the tessellation object (created with `gluNewTess'). | |
1269 | ||
1270 | WHICH | |
c7b31271 | 1271 | Specifies the property whose value is to be fetched. Valid values |
3c9b6116 AW |
1272 | are `GLU_TESS_WINDING_RULE', `GLU_TESS_BOUNDARY_ONLY', and |
1273 | `GLU_TESS_TOLERANCE'. | |
1274 | ||
1275 | DATA | |
1276 | Specifies a pointer to the location into which the value of the | |
1277 | named property is written. | |
1278 | ||
1279 | `gluGetTessProperty' retrieves properties stored in a tessellation | |
c7b31271 DH |
1280 | object. These properties affect the way that tessellation objects are |
1281 | interpreted and rendered. See the `gluTessProperty' reference page for | |
3c9b6116 | 1282 | information about the properties and what they do.") |
8925f36f | 1283 | |
25072f02 | 1284 | (define-glu-procedures |
bb894c9d | 1285 | ((gluLoadSamplingMatrices |
00239761 AW |
1286 | (nurb GLUnurbs*) |
1287 | (model const-GLfloat-*) | |
1288 | (perspective const-GLfloat-*) | |
1289 | (view const-GLint-*) | |
bb894c9d AW |
1290 | -> |
1291 | void)) | |
3c9b6116 AW |
1292 | "Load NURBS sampling and culling matrices. |
1293 | ||
1294 | NURB | |
1295 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
1296 | ||
1297 | MODEL | |
1298 | Specifies a modelview matrix (as from a `glGetFloatv' call). | |
1299 | ||
1300 | PERSPECTIVE | |
1301 | Specifies a projection matrix (as from a `glGetFloatv' call). | |
1302 | ||
1303 | VIEW | |
1304 | Specifies a viewport (as from a `glGetIntegerv' call). | |
1305 | ||
1306 | `gluLoadSamplingMatrices' uses MODEL, PERSPECTIVE, and VIEW to recompute | |
c7b31271 | 1307 | the sampling and culling matrices stored in NURB. The sampling matrix |
3c9b6116 AW |
1308 | determines how finely a NURBS curve or surface must be tessellated to |
1309 | satisfy the sampling tolerance (as determined by the | |
c7b31271 | 1310 | `GLU_SAMPLING_TOLERANCE' property). The culling matrix is used in |
3c9b6116 AW |
1311 | deciding if a NURBS curve or surface should be culled before rendering |
1312 | (when the `GLU_CULLING' property is turned on). | |
1313 | ||
1314 | `gluLoadSamplingMatrices' is necessary only if the | |
1315 | `GLU_AUTO_LOAD_MATRIX' property is turned off (see `gluNurbsProperty'). | |
1316 | Although it can be convenient to leave the `GLU_AUTO_LOAD_MATRIX' | |
c7b31271 | 1317 | property turned on, there can be a performance penalty for doing so. (A |
3c9b6116 AW |
1318 | round trip to the GL server is needed to fetch the current values of the |
1319 | modelview matrix, projection matrix, and viewport.)") | |
8925f36f | 1320 | |
25072f02 | 1321 | (define-glu-procedures |
bb894c9d AW |
1322 | ((gluLookAt |
1323 | (eyeX GLdouble) | |
1324 | (eyeY GLdouble) | |
1325 | (eyeZ GLdouble) | |
1326 | (centerX GLdouble) | |
1327 | (centerY GLdouble) | |
1328 | (centerZ GLdouble) | |
1329 | (upX GLdouble) | |
1330 | (upY GLdouble) | |
1331 | (upZ GLdouble) | |
1332 | -> | |
1333 | void)) | |
3c9b6116 AW |
1334 | "Define a viewing transformation. |
1335 | ||
1336 | EYEX | |
1337 | EYEY | |
1338 | ||
1339 | EYEZ | |
1340 | ||
1341 | Specifies the position of the eye point. | |
1342 | ||
1343 | CENTERX | |
1344 | CENTERY | |
1345 | ||
1346 | CENTERZ | |
1347 | ||
1348 | Specifies the position of the reference point. | |
1349 | ||
1350 | UPX | |
1351 | UPY | |
1352 | ||
1353 | UPZ | |
1354 | ||
1355 | Specifies the direction of the UP vector. | |
1356 | ||
1357 | `gluLookAt' creates a viewing matrix derived from an eye point, a | |
1358 | reference point indicating the center of the scene, and an UP vector. | |
1359 | ||
1360 | The matrix maps the reference point to the negative Z axis and the eye | |
c7b31271 | 1361 | point to the origin. When a typical projection matrix is used, the |
3c9b6116 AW |
1362 | center of the scene therefore maps to the center of the viewport. |
1363 | Similarly, the direction described by the UP vector projected onto the | |
1364 | viewing plane is mapped to the positive Y axis so that it points upward | |
c7b31271 DH |
1365 | in the viewport. The UP vector must not be parallel to the line of |
1366 | sight from the eye point to the reference point. | |
3c9b6116 AW |
1367 | |
1368 | Let | |
1369 | ||
1370 | F=((CENTERX-EYEX), (CENTERY-EYEY), (CENTERZ-EYEZ),) | |
1371 | ||
1372 | ||
1373 | ||
1374 | Let UP be the vector (UPX,UPYUPZ) . | |
1375 | ||
1376 | Then normalize as follows: F=F/∥F,∥, | |
1377 | ||
1378 | UP^″=UP/∥UP,∥, | |
1379 | ||
1380 | ||
1381 | ||
1382 | Finally, let S=F×UP^″ , and U=S×F . | |
1383 | ||
1384 | ||
1385 | ||
1386 | M is then constructed as follows: M=((S\u2061[0,] S\u2061[1,] S\u2061[2,] 0), (U\u2061[0,] | |
1387 | U\u2061[1,] U\u2061[2,] 0), (-F\u2061[0,] -F\u2061[1,] -F\u2061[2,] 0), (0 0 0 1),) | |
1388 | ||
1389 | and `gluLookAt' is equivalent to | |
1390 | ||
1391 | ||
1392 | glMultMatrixf(M); | |
1393 | glTranslated(-eyex, -eyey, -eyez);") | |
8925f36f | 1394 | |
25072f02 | 1395 | (define-glu-procedures |
00239761 | 1396 | ((gluNewNurbsRenderer -> GLUnurbs*)) |
3c9b6116 AW |
1397 | "Create a NURBS object. |
1398 | ||
1399 | `gluNewNurbsRenderer' creates and returns a pointer to a new NURBS | |
c7b31271 DH |
1400 | object. This object must be referred to when calling NURBS rendering |
1401 | and control functions. A return value of 0 means that there is not | |
1402 | enough memory to allocate the object.") | |
8925f36f | 1403 | |
25072f02 | 1404 | (define-glu-procedures |
00239761 | 1405 | ((gluNewQuadric -> GLUquadric*)) |
3c9b6116 AW |
1406 | "Create a quadrics object. |
1407 | ||
1408 | `gluNewQuadric' creates and returns a pointer to a new quadrics object. | |
1409 | This object must be referred to when calling quadrics rendering and | |
c7b31271 | 1410 | control functions. A return value of 0 means that there is not enough |
3c9b6116 | 1411 | memory to allocate the object.") |
8925f36f | 1412 | |
25072f02 | 1413 | (define-glu-procedures |
00239761 | 1414 | ((gluNewTess -> GLUtesselator*)) |
3c9b6116 AW |
1415 | "Create a tessellation object. |
1416 | ||
1417 | `gluNewTess' creates and returns a pointer to a new tessellation object. | |
c7b31271 | 1418 | This object must be referred to when calling tessellation functions. A |
3c9b6116 AW |
1419 | return value of 0 means that there is not enough memory to allocate the |
1420 | object.") | |
8925f36f | 1421 | |
25072f02 | 1422 | (define-glu-procedures |
00239761 AW |
1423 | ((gluNextContour |
1424 | (tess GLUtesselator*) | |
1425 | (type GLenum) | |
1426 | -> | |
1427 | void)) | |
3c9b6116 | 1428 | "Mark the beginning of another contour. |
8925f36f | 1429 | |
3c9b6116 AW |
1430 | TESS |
1431 | Specifies the tessellation object (created with `gluNewTess'). | |
1432 | ||
1433 | TYPE | |
c7b31271 | 1434 | Specifies the type of the contour being defined. Valid values are |
3c9b6116 AW |
1435 | `GLU_EXTERIOR', `GLU_INTERIOR', `GLU_UNKNOWN', `GLU_CCW', and |
1436 | `GLU_CW'. | |
1437 | ||
1438 | `gluNextContour' is used in describing polygons with multiple contours. | |
1439 | After the first contour has been described through a series of | |
1440 | `gluTessVertex' calls, a `gluNextContour' call indicates that the | |
1441 | previous contour is complete and that the next contour is about to | |
c7b31271 DH |
1442 | begin. Another series of `gluTessVertex' calls is then used to describe |
1443 | the new contour. This process can be repeated until all contours have | |
3c9b6116 AW |
1444 | been described. |
1445 | ||
c7b31271 | 1446 | TYPE defines what type of contour follows. The legal contour types are |
3c9b6116 AW |
1447 | as follows: |
1448 | ||
1449 | `GLU_EXTERIOR' | |
1450 | An exterior contour defines an exterior boundary of the polygon. | |
1451 | ||
1452 | `GLU_INTERIOR' | |
1453 | An interior contour defines an interior boundary of the polygon | |
1454 | (such as a hole). | |
1455 | ||
1456 | `GLU_UNKNOWN' | |
1457 | An unknown contour is analyzed by the library to determine if it is | |
1458 | interior or exterior. | |
1459 | ||
1460 | `GLU_CCW', | |
1461 | `GLU_CW' | |
1462 | The first `GLU_CCW' or `GLU_CW' contour defined is considered to be | |
c7b31271 | 1463 | exterior. All other contours are considered to be exterior if they |
3c9b6116 AW |
1464 | are oriented in the same direction (clockwise or counterclockwise) |
1465 | as the first contour, and interior if they are not. | |
1466 | ||
1467 | If one contour is of type `GLU_CCW' or `GLU_CW', then all contours must | |
1468 | be of the same type (if they are not, then all `GLU_CCW' and `GLU_CW' | |
1469 | contours will be changed to `GLU_UNKNOWN'). | |
1470 | ||
1471 | Note that there is no real difference between the `GLU_CCW' and `GLU_CW' | |
1472 | contour types. | |
1473 | ||
1474 | Before the first contour is described, `gluNextContour' can be called to | |
c7b31271 | 1475 | define the type of the first contour. If `gluNextContour' is not called |
3c9b6116 AW |
1476 | before the first contour, then the first contour is marked |
1477 | `GLU_EXTERIOR'. | |
1478 | ||
1479 | This command is obsolete and is provided for backward compatibility | |
c7b31271 | 1480 | only. Calls to `gluNextContour' are mapped to `gluTessEndContour' |
3c9b6116 AW |
1481 | followed by `gluTessBeginContour'.") |
1482 | ||
25072f02 | 1483 | (define-glu-procedures |
bb894c9d | 1484 | ((gluNurbsCallbackDataEXT |
00239761 AW |
1485 | (nurb GLUnurbs*) |
1486 | (userData GLvoid*) | |
bb894c9d AW |
1487 | -> |
1488 | void)) | |
3c9b6116 AW |
1489 | "Set a user data pointer. |
1490 | ||
1491 | NURB | |
1492 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
1493 | ||
1494 | USERDATA | |
1495 | Specifies a pointer to the user's data. | |
1496 | ||
1497 | `gluNurbsCallbackDataEXT' is used to pass a pointer to the application's | |
c7b31271 | 1498 | data to NURBS tessellator. A copy of this pointer will be passed by the |
3c9b6116 | 1499 | tessellator in the NURBS callback functions (set by `gluNurbsCallback').") |
8925f36f | 1500 | |
25072f02 | 1501 | (define-glu-procedures |
bb894c9d | 1502 | ((gluNurbsCallbackData |
00239761 AW |
1503 | (nurb GLUnurbs*) |
1504 | (userData GLvoid*) | |
bb894c9d AW |
1505 | -> |
1506 | void)) | |
3c9b6116 AW |
1507 | "Set a user data pointer. |
1508 | ||
1509 | NURB | |
1510 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
1511 | ||
1512 | USERDATA | |
1513 | Specifies a pointer to the user's data. | |
1514 | ||
1515 | `gluNurbsCallbackData' is used to pass a pointer to the application's | |
c7b31271 | 1516 | data to NURBS tessellator. A copy of this pointer will be passed by the |
3c9b6116 | 1517 | tessellator in the NURBS callback functions (set by `gluNurbsCallback').") |
8925f36f | 1518 | |
25072f02 | 1519 | (define-glu-procedures |
bb894c9d | 1520 | ((gluNurbsCallback |
00239761 | 1521 | (nurb GLUnurbs*) |
bb894c9d AW |
1522 | (which GLenum) |
1523 | (CallBackFunc _GLUfuncptr) | |
1524 | -> | |
1525 | void)) | |
3c9b6116 AW |
1526 | "Define a callback for a NURBS object. |
1527 | ||
1528 | NURB | |
1529 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
1530 | ||
1531 | WHICH | |
c7b31271 | 1532 | Specifies the callback being defined. Valid values are |
3c9b6116 AW |
1533 | `GLU_NURBS_BEGIN', `GLU_NURBS_VERTEX', `GLU_NURBS_NORMAL', |
1534 | `GLU_NURBS_COLOR', `GLU_NURBS_TEXTURE_COORD', `GLU_NURBS_END', | |
1535 | `GLU_NURBS_BEGIN_DATA', `GLU_NURBS_VERTEX_DATA', | |
1536 | `GLU_NURBS_NORMAL_DATA', `GLU_NURBS_COLOR_DATA', | |
1537 | `GLU_NURBS_TEXTURE_COORD_DATA', `GLU_NURBS_END_DATA', and | |
1538 | `GLU_NURBS_ERROR'. | |
1539 | ||
1540 | CALLBACKFUNC | |
1541 | Specifies the function that the callback calls. | |
1542 | ||
1543 | `gluNurbsCallback' is used to define a callback to be used by a NURBS | |
c7b31271 DH |
1544 | object. If the specified callback is already defined, then it is |
1545 | replaced. If CALLBACKFUNC is NULL, then this callback will not get | |
3c9b6116 AW |
1546 | invoked and the related data, if any, will be lost. |
1547 | ||
1548 | Except the error callback, these callbacks are used by NURBS tessellator | |
1549 | (when `GLU_NURBS_MODE' is set to be `GLU_NURBS_TESSELLATOR') to return | |
c7b31271 | 1550 | back the OpenGL polygon primitives resulting from the tessellation. Note |
3c9b6116 | 1551 | that there are two versions of each callback: one with a user data |
c7b31271 | 1552 | pointer and one without. If both versions for a particular callback are |
3c9b6116 AW |
1553 | specified then the callback with the user data pointer will be used. |
1554 | Note that ``userData'' is a copy of the pointer that was specified at | |
1555 | the last call to `gluNurbsCallbackData'. | |
1556 | ||
1557 | The error callback function is effective no matter which value that | |
c7b31271 | 1558 | `GLU_NURBS_MODE' is set to. All other callback functions are effective |
3c9b6116 AW |
1559 | only when `GLU_NURBS_MODE' is set to `GLU_NURBS_TESSELLATOR'. |
1560 | ||
1561 | The legal callbacks are as follows: | |
1562 | ||
1563 | `GLU_NURBS_BEGIN' | |
1564 | ||
1565 | ||
c7b31271 DH |
1566 | The begin callback indicates the start of a primitive. The |
1567 | function takes a single argument of type GLenum, which can be one | |
1568 | of `GLU_LINES', `GLU_LINE_STRIP', `GLU_TRIANGLE_FAN', | |
1569 | `GLU_TRIANGLE_STRIP', `GLU_TRIANGLES', or `GLU_QUAD_STRIP'. The | |
1570 | default begin callback function is NULL. The function prototype | |
1571 | for this callback looks like: | |
3c9b6116 AW |
1572 | |
1573 | `GLU_NURBS_BEGIN_DATA' | |
1574 | ||
1575 | ||
1576 | The same as the `GLU_NURBS_BEGIN' callback except that it takes an | |
c7b31271 DH |
1577 | additional pointer argument. This pointer is a copy of the pointer |
1578 | that was specified at the last call to `gluNurbsCallbackData'. The | |
1579 | default callback function is NULL. The function prototype for this | |
3c9b6116 AW |
1580 | callback function looks like: |
1581 | ||
1582 | `GLU_NURBS_VERTEX' | |
1583 | ||
1584 | ||
c7b31271 | 1585 | The vertex callback indicates a vertex of the primitive. The |
3c9b6116 AW |
1586 | coordinates of the vertex are stored in the parameter ``vertex''. |
1587 | All the generated vertices have dimension 3; that is, homogeneous | |
c7b31271 DH |
1588 | coordinates have been transformed into affine coordinates. The |
1589 | default vertex callback function is NULL. The function prototype | |
3c9b6116 AW |
1590 | for this callback function looks like: |
1591 | ||
1592 | `GLU_NURBS_VERTEX_DATA' | |
1593 | ||
1594 | ||
1595 | This is the same as the `GLU_NURBS_VERTEX' callback, except that it | |
c7b31271 DH |
1596 | takes an additional pointer argument. This pointer is a copy of |
1597 | the pointer that was specified at the last call to | |
1598 | `gluNurbsCallbackData'. The default callback function is NULL. The | |
3c9b6116 AW |
1599 | function prototype for this callback function looks like: |
1600 | ||
1601 | `GLU_NURBS_NORMAL' | |
1602 | ||
1603 | ||
1604 | The normal callback is invoked as the vertex normal is generated. | |
1605 | The components of the normal are stored in the parameter | |
1606 | ``normal.'' In the case of a NURBS curve, the callback function is | |
1607 | effective only when the user provides a normal map | |
c7b31271 | 1608 | (`GLU_MAP1_NORMAL'). In the case of a NURBS surface, if a normal |
3c9b6116 | 1609 | map (`GLU_MAP2_NORMAL') is provided, then the generated normal is |
c7b31271 DH |
1610 | computed from the normal map. If a normal map is not provided, |
1611 | then a surface normal is computed in a manner similar to that | |
1612 | described for evaluators when `GLU_AUTO_NORMAL' is enabled. The | |
1613 | default normal callback function is NULL. The function prototype | |
1614 | for this callback function looks like: | |
3c9b6116 AW |
1615 | |
1616 | `GLU_NURBS_NORMAL_DATA' | |
1617 | ||
1618 | ||
1619 | The same as the `GLU_NURBS_NORMAL' callback except that it takes an | |
c7b31271 DH |
1620 | additional pointer argument. This pointer is a copy of the pointer |
1621 | that was specified at the last call to `gluNurbsCallbackData'. The | |
1622 | default callback function is NULL. The function prototype for this | |
3c9b6116 AW |
1623 | callback function looks like: |
1624 | ||
1625 | `GLU_NURBS_COLOR' | |
1626 | ||
1627 | ||
1628 | The color callback is invoked as the color of a vertex is | |
c7b31271 | 1629 | generated. The components of the color are stored in the parameter |
3c9b6116 | 1630 | ``color.'' This callback is effective only when the user provides a |
c7b31271 DH |
1631 | color map (`GLU_MAP1_COLOR_4' or `GLU_MAP2_COLOR_4'). ``color'' |
1632 | contains four components: R, G, B, A. The default color callback | |
1633 | function is NULL. The prototype for this callback function looks | |
3c9b6116 AW |
1634 | like: |
1635 | ||
1636 | `GLU_NURBS_COLOR_DATA' | |
1637 | ||
1638 | ||
1639 | The same as the `GLU_NURBS_COLOR' callback except that it takes an | |
c7b31271 DH |
1640 | additional pointer argument. This pointer is a copy of the pointer |
1641 | that was specified at the last call to `gluNurbsCallbackData'. The | |
1642 | default callback function is NULL. The function prototype for this | |
3c9b6116 AW |
1643 | callback function looks like: |
1644 | ||
1645 | `GLU_NURBS_TEXTURE_COORD' | |
1646 | ||
1647 | ||
1648 | The texture callback is invoked as the texture coordinates of a | |
c7b31271 DH |
1649 | vertex are generated. These coordinates are stored in the |
1650 | parameter ``texCoord.'' The number of texture coordinates can be 1, | |
1651 | 2, 3, or 4 depending on which type of texture map is specified | |
3c9b6116 AW |
1652 | (`GLU_MAP1_TEXTURE_COORD_1', `GLU_MAP1_TEXTURE_COORD_2', |
1653 | `GLU_MAP1_TEXTURE_COORD_3', `GLU_MAP1_TEXTURE_COORD_4', | |
1654 | `GLU_MAP2_TEXTURE_COORD_1', `GLU_MAP2_TEXTURE_COORD_2', | |
c7b31271 | 1655 | `GLU_MAP2_TEXTURE_COORD_3', `GLU_MAP2_TEXTURE_COORD_4'). If no |
3c9b6116 | 1656 | texture map is specified, this callback function will not be |
c7b31271 DH |
1657 | called. The default texture callback function is NULL. The |
1658 | function prototype for this callback function looks like: | |
3c9b6116 AW |
1659 | |
1660 | `GLU_NURBS_TEXTURE_COORD_DATA' | |
1661 | ||
1662 | ||
1663 | This is the same as the `GLU_NURBS_TEXTURE_COORD' callback, except | |
c7b31271 | 1664 | that it takes an additional pointer argument. This pointer is a |
3c9b6116 | 1665 | copy of the pointer that was specified at the last call to |
c7b31271 | 1666 | `gluNurbsCallbackData'. The default callback function is NULL. The |
3c9b6116 AW |
1667 | function prototype for this callback function looks like: |
1668 | ||
1669 | `GLU_NURBS_END' | |
1670 | ||
1671 | ||
c7b31271 DH |
1672 | The end callback is invoked at the end of a primitive. The default |
1673 | end callback function is NULL. The function prototype for this | |
3c9b6116 AW |
1674 | callback function looks like: |
1675 | ||
1676 | `GLU_NURBS_END_DATA' | |
1677 | ||
1678 | ||
1679 | This is the same as the `GLU_NURBS_END' callback, except that it | |
c7b31271 DH |
1680 | takes an additional pointer argument. This pointer is a copy of |
1681 | the pointer that was specified at the last call to | |
1682 | `gluNurbsCallbackData'. The default callback function is NULL. The | |
3c9b6116 AW |
1683 | function prototype for this callback function looks like: |
1684 | ||
1685 | `GLU_NURBS_ERROR' | |
1686 | ||
1687 | ||
c7b31271 | 1688 | The error function is called when an error is encountered. Its |
3c9b6116 | 1689 | single argument is of type GLenum, and it indicates the specific |
c7b31271 DH |
1690 | error that occurred. There are 37 errors unique to NURBS, named |
1691 | `GLU_NURBS_ERROR1' through `GLU_NURBS_ERROR37'. Character strings | |
3c9b6116 AW |
1692 | describing these errors can be retrieved with `gluErrorString'. |
1693 | ||
1694 | ||
1695 | void begin( GLenum type ); | |
1696 | ||
1697 | ||
1698 | void beginData(GLenum type, void *userData); | |
1699 | ||
1700 | ||
1701 | void vertex( GLfloat *vertex ); | |
1702 | ||
1703 | ||
1704 | void vertexData( GLfloat *vertex, void *userData ); | |
1705 | ||
1706 | ||
1707 | void normal( GLfloat *normal ); | |
1708 | ||
1709 | ||
1710 | void normalData( GLfloat *normal, void *userData ); | |
1711 | ||
1712 | ||
1713 | void color( GLfloat *color ); | |
1714 | ||
1715 | ||
1716 | void colorData( GLfloat *color, void *userData ); | |
1717 | ||
1718 | ||
1719 | void texCoord( GLfloat *texCoord ); | |
1720 | ||
1721 | ||
1722 | void texCoordData( GLfloat *texCoord, void *userData ); | |
1723 | ||
1724 | ||
1725 | void end( void ); | |
1726 | ||
1727 | ||
1728 | void endData( void *userData );") | |
8925f36f | 1729 | |
25072f02 | 1730 | (define-glu-procedures |
bb894c9d | 1731 | ((gluNurbsCurve |
00239761 | 1732 | (nurb GLUnurbs*) |
bb894c9d | 1733 | (knotCount GLint) |
00239761 | 1734 | (knots GLfloat-*) |
bb894c9d | 1735 | (stride GLint) |
00239761 | 1736 | (control GLfloat-*) |
bb894c9d AW |
1737 | (order GLint) |
1738 | (type GLenum) | |
1739 | -> | |
1740 | void)) | |
3c9b6116 AW |
1741 | "Define the shape of a NURBS curve. |
1742 | ||
1743 | NURB | |
1744 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
1745 | ||
1746 | KNOTCOUNT | |
c7b31271 DH |
1747 | Specifies the number of knots in KNOTS. KNOTCOUNT equals the |
1748 | number of control points plus the order. | |
3c9b6116 AW |
1749 | |
1750 | KNOTS | |
1751 | Specifies an array of KNOTCOUNT nondecreasing knot values. | |
1752 | ||
1753 | STRIDE | |
1754 | Specifies the offset (as a number of single-precision | |
1755 | floating-point values) between successive curve control points. | |
1756 | ||
1757 | CONTROL | |
c7b31271 | 1758 | Specifies a pointer to an array of control points. The coordinates |
3c9b6116 AW |
1759 | must agree with TYPE, specified below. |
1760 | ||
1761 | ORDER | |
c7b31271 | 1762 | Specifies the order of the NURBS curve. ORDER equals degree + 1, |
3c9b6116 AW |
1763 | hence a cubic curve has an order of 4. |
1764 | ||
1765 | TYPE | |
c7b31271 | 1766 | Specifies the type of the curve. If this curve is defined within a |
3c9b6116 AW |
1767 | `gluBeginCurve'/`gluEndCurve' pair, then the type can be any of the |
1768 | valid one-dimensional evaluator types (such as `GLU_MAP1_VERTEX_3' | |
c7b31271 DH |
1769 | or `GLU_MAP1_COLOR_4'). Between a `gluBeginTrim'/`gluEndTrim' |
1770 | pair, the only valid types are `GLU_MAP1_TRIM_2' and | |
1771 | `GLU_MAP1_TRIM_3'. | |
3c9b6116 AW |
1772 | |
1773 | Use `gluNurbsCurve' to describe a NURBS curve. | |
1774 | ||
1775 | When `gluNurbsCurve' appears between a `gluBeginCurve'/`gluEndCurve' | |
c7b31271 | 1776 | pair, it is used to describe a curve to be rendered. Positional, |
3c9b6116 AW |
1777 | texture, and color coordinates are associated by presenting each as a |
1778 | separate `gluNurbsCurve' between a `gluBeginCurve'/`gluEndCurve' pair. | |
1779 | No more than one call to `gluNurbsCurve' for each of color, position, | |
1780 | and texture data can be made within a single | |
c7b31271 | 1781 | `gluBeginCurve'/`gluEndCurve' pair. Exactly one call must be made to |
3c9b6116 AW |
1782 | describe the position of the curve (a TYPE of `GLU_MAP1_VERTEX_3' or |
1783 | `GLU_MAP1_VERTEX_4'). | |
1784 | ||
1785 | When `gluNurbsCurve' appears between a `gluBeginTrim'/`gluEndTrim' pair, | |
c7b31271 | 1786 | it is used to describe a trimming curve on a NURBS surface. If TYPE is |
3c9b6116 | 1787 | `GLU_MAP1_TRIM_2', then it describes a curve in two-dimensional (U and |
c7b31271 DH |
1788 | V) parameter space. If it is `GLU_MAP1_TRIM_3', then it describes a |
1789 | curve in two-dimensional homogeneous (U, V, and W) parameter space. See | |
3c9b6116 AW |
1790 | the `gluBeginTrim' reference page for more discussion about trimming |
1791 | curves.") | |
8925f36f | 1792 | |
25072f02 | 1793 | (define-glu-procedures |
bb894c9d | 1794 | ((gluNurbsProperty |
00239761 | 1795 | (nurb GLUnurbs*) |
bb894c9d AW |
1796 | (property GLenum) |
1797 | (value GLfloat) | |
1798 | -> | |
1799 | void)) | |
3c9b6116 AW |
1800 | "Set a NURBS property. |
1801 | ||
1802 | NURB | |
1803 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
1804 | ||
1805 | PROPERTY | |
c7b31271 | 1806 | Specifies the property to be set. Valid values are |
3c9b6116 AW |
1807 | `GLU_SAMPLING_TOLERANCE', `GLU_DISPLAY_MODE', `GLU_CULLING', |
1808 | `GLU_AUTO_LOAD_MATRIX', `GLU_PARAMETRIC_TOLERANCE', | |
1809 | `GLU_SAMPLING_METHOD', `GLU_U_STEP', `GLU_V_STEP', or | |
1810 | `GLU_NURBS_MODE'. | |
1811 | ||
1812 | VALUE | |
c7b31271 | 1813 | Specifies the value of the indicated property. It may be a numeric |
3c9b6116 AW |
1814 | value or one of `GLU_OUTLINE_POLYGON', `GLU_FILL', |
1815 | `GLU_OUTLINE_PATCH', `GLU_TRUE', `GLU_FALSE', `GLU_PATH_LENGTH', | |
1816 | `GLU_PARAMETRIC_ERROR', `GLU_DOMAIN_DISTANCE', | |
1817 | `GLU_NURBS_RENDERER', or `GLU_NURBS_TESSELLATOR'. | |
1818 | ||
1819 | `gluNurbsProperty' is used to control properties stored in a NURBS | |
c7b31271 | 1820 | object. These properties affect the way that a NURBS curve is rendered. |
3c9b6116 AW |
1821 | The accepted values for PROPERTY are as follows: |
1822 | ||
1823 | `GLU_NURBS_MODE' | |
1824 | VALUE should be set to be either `GLU_NURBS_RENDERER' or | |
c7b31271 | 1825 | `GLU_NURBS_TESSELLATOR'. When set to `GLU_NURBS_RENDERER', NURBS |
3c9b6116 | 1826 | objects are tessellated into OpenGL primitives and sent to the |
c7b31271 | 1827 | pipeline for rendering. When set to `GLU_NURBS_TESSELLATOR', NURBS |
3c9b6116 AW |
1828 | objects are tessellated into OpenGL primitives but the vertices, |
1829 | normals, colors, and/or textures are retrieved back through a | |
c7b31271 DH |
1830 | callback interface (see `gluNurbsCallback'). This allows the user |
1831 | to cache the tessellated results for further processing. The | |
3c9b6116 AW |
1832 | initial value is `GLU_NURBS_RENDERER'. |
1833 | ||
1834 | `GLU_SAMPLING_METHOD' | |
c7b31271 | 1835 | Specifies how a NURBS surface should be tessellated. VALUE may be |
3c9b6116 AW |
1836 | one of `GLU_PATH_LENGTH', `GLU_PARAMETRIC_ERROR', |
1837 | `GLU_DOMAIN_DISTANCE', `GLU_OBJECT_PATH_LENGTH', or | |
c7b31271 | 1838 | `GLU_OBJECT_PARAMETRIC_ERROR'. When set to `GLU_PATH_LENGTH', the |
3c9b6116 AW |
1839 | surface is rendered so that the maximum length, in pixels, of the |
1840 | edges of the tessellation polygons is no greater than what is | |
1841 | specified by `GLU_SAMPLING_TOLERANCE'. | |
1842 | ||
1843 | `GLU_PARAMETRIC_ERROR' specifies that the surface is rendered in | |
1844 | such a way that the value specified by `GLU_PARAMETRIC_TOLERANCE' | |
1845 | describes the maximum distance, in pixels, between the tessellation | |
1846 | polygons and the surfaces they approximate. | |
1847 | ||
1848 | `GLU_DOMAIN_DISTANCE' allows users to specify, in parametric | |
1849 | coordinates, how many sample points per unit length are taken in U, | |
1850 | V direction. | |
1851 | ||
1852 | `GLU_OBJECT_PATH_LENGTH' is similar to `GLU_PATH_LENGTH' except | |
1853 | that it is view independent; that is, the surface is rendered so | |
1854 | that the maximum length, in object space, of edges of the | |
1855 | tessellation polygons is no greater than what is specified by | |
1856 | `GLU_SAMPLING_TOLERANCE'. | |
1857 | ||
1858 | `GLU_OBJECT_PARAMETRIC_ERROR' is similar to `GLU_PARAMETRIC_ERROR' | |
1859 | except that it is view independent; that is, the surface is | |
1860 | rendered in such a way that the value specified by | |
1861 | `GLU_PARAMETRIC_TOLERANCE' describes the maximum distance, in | |
1862 | object space, between the tessellation polygons and the surfaces | |
1863 | they approximate. | |
1864 | ||
1865 | The initial value of `GLU_SAMPLING_METHOD' is `GLU_PATH_LENGTH'. | |
1866 | ||
1867 | `GLU_SAMPLING_TOLERANCE' | |
1868 | Specifies the maximum length, in pixels or in object space length | |
1869 | unit, to use when the sampling method is set to `GLU_PATH_LENGTH' | |
c7b31271 | 1870 | or `GLU_OBJECT_PATH_LENGTH'. The NURBS code is conservative when |
3c9b6116 | 1871 | rendering a curve or surface, so the actual length can be somewhat |
c7b31271 | 1872 | shorter. The initial value is 50.0 pixels. |
3c9b6116 AW |
1873 | |
1874 | `GLU_PARAMETRIC_TOLERANCE' | |
1875 | Specifies the maximum distance, in pixels or in object space length | |
1876 | unit, to use when the sampling method is `GLU_PARAMETRIC_ERROR' or | |
c7b31271 | 1877 | `GLU_OBJECT_PARAMETRIC_ERROR'. The initial value is 0.5. |
3c9b6116 AW |
1878 | |
1879 | `GLU_U_STEP' | |
1880 | Specifies the number of sample points per unit length taken along | |
c7b31271 DH |
1881 | the U axis in parametric coordinates. It is needed when |
1882 | `GLU_SAMPLING_METHOD' is set to `GLU_DOMAIN_DISTANCE'. The initial | |
3c9b6116 AW |
1883 | value is 100. |
1884 | ||
1885 | `GLU_V_STEP' | |
1886 | Specifies the number of sample points per unit length taken along | |
c7b31271 DH |
1887 | the V axis in parametric coordinate. It is needed when |
1888 | `GLU_SAMPLING_METHOD' is set to `GLU_DOMAIN_DISTANCE'. The initial | |
3c9b6116 AW |
1889 | value is 100. |
1890 | ||
1891 | `GLU_DISPLAY_MODE' | |
1892 | VALUE can be set to `GLU_OUTLINE_POLYGON', `GLU_FILL', or | |
c7b31271 | 1893 | `GLU_OUTLINE_PATCH'. When `GLU_NURBS_MODE' is set to be |
3c9b6116 | 1894 | `GLU_NURBS_RENDERER', VALUE defines how a NURBS surface should be |
c7b31271 DH |
1895 | rendered. When VALUE is set to `GLU_FILL', the surface is rendered |
1896 | as a set of polygons. When VALUE is set to `GLU_OUTLINE_POLYGON', | |
3c9b6116 | 1897 | the NURBS library draws only the outlines of the polygons created |
c7b31271 | 1898 | by tessellation. When VALUE is set to `GLU_OUTLINE_PATCH' just the |
3c9b6116 AW |
1899 | outlines of patches and trim curves defined by the user are drawn. |
1900 | ||
1901 | When `GLU_NURBS_MODE' is set to be `GLU_NURBS_TESSELLATOR', VALUE | |
c7b31271 | 1902 | defines how a NURBS surface should be tessellated. When |
3c9b6116 AW |
1903 | `GLU_DISPLAY_MODE' is set to `GLU_FILL' or `GLU_OUTLINE_POLYGON', |
1904 | the NURBS surface is tessellated into OpenGL triangle primitives | |
c7b31271 | 1905 | that can be retrieved back through callback functions. If |
3c9b6116 AW |
1906 | `GLU_DISPLAY_MODE' is set to `GLU_OUTLINE_PATCH', only the outlines |
1907 | of the patches and trim curves are generated as a sequence of line | |
1908 | strips that can be retrieved back through callback functions. | |
1909 | ||
1910 | The initial value is `GLU_FILL'. | |
1911 | ||
1912 | `GLU_CULLING' | |
1913 | VALUE is a boolean value that, when set to `GLU_TRUE', indicates | |
1914 | that a NURBS curve should be discarded prior to tessellation if its | |
c7b31271 | 1915 | control points lie outside the current viewport. The initial value |
3c9b6116 AW |
1916 | is `GLU_FALSE'. |
1917 | ||
1918 | `GLU_AUTO_LOAD_MATRIX' | |
c7b31271 | 1919 | VALUE is a boolean value. When set to `GLU_TRUE', the NURBS code |
3c9b6116 AW |
1920 | downloads the projection matrix, the modelview matrix, and the |
1921 | viewport from the GL server to compute sampling and culling | |
c7b31271 | 1922 | matrices for each NURBS curve that is rendered. Sampling and |
3c9b6116 AW |
1923 | culling matrices are required to determine the tessellation of a |
1924 | NURBS surface into line segments or polygons and to cull a NURBS | |
1925 | surface if it lies outside the viewport. | |
1926 | ||
1927 | If this mode is set to `GLU_FALSE', then the program needs to | |
1928 | provide a projection matrix, a modelview matrix, and a viewport for | |
1929 | the NURBS renderer to use to construct sampling and culling | |
c7b31271 DH |
1930 | matrices. This can be done with the `gluLoadSamplingMatrices' |
1931 | function. This mode is initially set to `GLU_TRUE'. Changing it | |
3c9b6116 AW |
1932 | from `GLU_TRUE' to `GLU_FALSE' does not affect the sampling and |
1933 | culling matrices until `gluLoadSamplingMatrices' is called.") | |
8925f36f | 1934 | |
25072f02 | 1935 | (define-glu-procedures |
bb894c9d | 1936 | ((gluNurbsSurface |
00239761 | 1937 | (nurb GLUnurbs*) |
bb894c9d | 1938 | (sKnotCount GLint) |
00239761 | 1939 | (sKnots GLfloat*) |
bb894c9d | 1940 | (tKnotCount GLint) |
00239761 | 1941 | (tKnots GLfloat*) |
bb894c9d AW |
1942 | (sStride GLint) |
1943 | (tStride GLint) | |
00239761 | 1944 | (control GLfloat*) |
bb894c9d AW |
1945 | (sOrder GLint) |
1946 | (tOrder GLint) | |
1947 | (type GLenum) | |
1948 | -> | |
1949 | void)) | |
3c9b6116 AW |
1950 | "Define the shape of a NURBS surface. |
1951 | ||
1952 | NURB | |
1953 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
1954 | ||
1955 | SKNOTCOUNT | |
1956 | Specifies the number of knots in the parametric U direction. | |
1957 | ||
1958 | SKNOTS | |
1959 | Specifies an array of SKNOTCOUNT nondecreasing knot values in the | |
1960 | parametric U direction. | |
1961 | ||
1962 | TKNOTCOUNT | |
1963 | Specifies the number of knots in the parametric V direction. | |
1964 | ||
1965 | TKNOTS | |
1966 | Specifies an array of TKNOTCOUNT nondecreasing knot values in the | |
1967 | parametric V direction. | |
1968 | ||
1969 | SSTRIDE | |
1970 | Specifies the offset (as a number of single-precision | |
1971 | floating-point values) between successive control points in the | |
1972 | parametric U direction in CONTROL. | |
1973 | ||
1974 | TSTRIDE | |
1975 | Specifies the offset (in single-precision floating-point values) | |
1976 | between successive control points in the parametric V direction in | |
1977 | CONTROL. | |
1978 | ||
1979 | CONTROL | |
1980 | Specifies an array containing control points for the NURBS surface. | |
1981 | The offsets between successive control points in the parametric U | |
1982 | and V directions are given by SSTRIDE and TSTRIDE. | |
1983 | ||
1984 | SORDER | |
1985 | Specifies the order of the NURBS surface in the parametric U | |
c7b31271 | 1986 | direction. The order is one more than the degree, hence a surface |
3c9b6116 AW |
1987 | that is cubic in U has a U order of 4. |
1988 | ||
1989 | TORDER | |
1990 | Specifies the order of the NURBS surface in the parametric V | |
c7b31271 | 1991 | direction. The order is one more than the degree, hence a surface |
3c9b6116 AW |
1992 | that is cubic in V has a V order of 4. |
1993 | ||
1994 | TYPE | |
c7b31271 | 1995 | Specifies type of the surface. TYPE can be any of the valid |
3c9b6116 AW |
1996 | two-dimensional evaluator types (such as `GLU_MAP2_VERTEX_3' or |
1997 | `GLU_MAP2_COLOR_4'). | |
1998 | ||
1999 | Use `gluNurbsSurface' within a NURBS (Non-Uniform Rational B-Spline) | |
2000 | surface definition to describe the shape of a NURBS surface (before any | |
c7b31271 DH |
2001 | trimming). To mark the beginning of a NURBS surface definition, use the |
2002 | `gluBeginSurface' command. To mark the end of a NURBS surface | |
2003 | definition, use the `gluEndSurface' command. Call `gluNurbsSurface' | |
3c9b6116 AW |
2004 | within a NURBS surface definition only. |
2005 | ||
2006 | Positional, texture, and color coordinates are associated with a surface | |
2007 | by presenting each as a separate `gluNurbsSurface' between a | |
c7b31271 | 2008 | `gluBeginSurface'/`gluEndSurface' pair. No more than one call to |
3c9b6116 | 2009 | `gluNurbsSurface' for each of color, position, and texture data can be |
c7b31271 DH |
2010 | made within a single `gluBeginSurface'/`gluEndSurface' pair. Exactly |
2011 | one call must be made to describe the position of the surface (a TYPE of | |
3c9b6116 AW |
2012 | `GLU_MAP2_VERTEX_3' or `GLU_MAP2_VERTEX_4'). |
2013 | ||
2014 | A NURBS surface can be trimmed by using the commands `gluNurbsCurve' and | |
2015 | `gluPwlCurve' between calls to `gluBeginTrim' and `gluEndTrim'. | |
2016 | ||
2017 | Note that a `gluNurbsSurface' with SKNOTCOUNT knots in the U direction | |
2018 | and TKNOTCOUNT knots in the V direction with orders SORDER and TORDER | |
2019 | must have (SKNOTCOUNT - SORDER) TIMES (TKNOTCOUNT - TORDER) control | |
2020 | points.") | |
8925f36f | 2021 | |
25072f02 | 2022 | (define-glu-procedures |
bb894c9d AW |
2023 | ((gluOrtho2D |
2024 | (left GLdouble) | |
2025 | (right GLdouble) | |
2026 | (bottom GLdouble) | |
2027 | (top GLdouble) | |
2028 | -> | |
2029 | void)) | |
3c9b6116 AW |
2030 | "Define a 2D orthographic projection matrix. |
2031 | ||
2032 | LEFT | |
2033 | RIGHT | |
2034 | ||
2035 | Specify the coordinates for the left and right vertical clipping | |
2036 | planes. | |
2037 | ||
2038 | BOTTOM | |
2039 | TOP | |
2040 | ||
2041 | Specify the coordinates for the bottom and top horizontal clipping | |
2042 | planes. | |
2043 | ||
c7b31271 | 2044 | `gluOrtho2D' sets up a two-dimensional orthographic viewing region. This |
3c9b6116 | 2045 | is equivalent to calling `glOrtho' with NEAR=-1 and FAR=1 .") |
8925f36f | 2046 | |
25072f02 | 2047 | (define-glu-procedures |
bb894c9d | 2048 | ((gluPartialDisk |
00239761 | 2049 | (quad GLUquadric*) |
bb894c9d AW |
2050 | (inner GLdouble) |
2051 | (outer GLdouble) | |
2052 | (slices GLint) | |
2053 | (loops GLint) | |
2054 | (start GLdouble) | |
2055 | (sweep GLdouble) | |
2056 | -> | |
2057 | void)) | |
3c9b6116 AW |
2058 | "Draw an arc of a disk. |
2059 | ||
2060 | QUAD | |
2061 | Specifies a quadrics object (created with `gluNewQuadric'). | |
2062 | ||
2063 | INNER | |
2064 | Specifies the inner radius of the partial disk (can be 0). | |
2065 | ||
2066 | OUTER | |
2067 | Specifies the outer radius of the partial disk. | |
2068 | ||
2069 | SLICES | |
2070 | Specifies the number of subdivisions around the Z axis. | |
2071 | ||
2072 | LOOPS | |
2073 | Specifies the number of concentric rings about the origin into | |
2074 | which the partial disk is subdivided. | |
2075 | ||
2076 | START | |
2077 | Specifies the starting angle, in degrees, of the disk portion. | |
2078 | ||
2079 | SWEEP | |
2080 | Specifies the sweep angle, in degrees, of the disk portion. | |
2081 | ||
c7b31271 DH |
2082 | `gluPartialDisk' renders a partial disk on the Z=0 plane. A partial |
2083 | disk is similar to a full disk, except that only the subset of the disk | |
2084 | from START through START + SWEEP is included (where 0 degrees is along | |
2085 | the +\\f2y\\f axis, 90 degrees along the +X axis, 180 degrees along the | |
2086 | \\-Y axis, and 270 degrees along the \\-X axis). | |
3c9b6116 AW |
2087 | |
2088 | The partial disk has a radius of OUTER and contains a concentric | |
c7b31271 DH |
2089 | circular hole with a radius of INNER. If INNER is 0, then no hole is |
2090 | generated. The partial disk is subdivided around the Z axis into slices | |
3c9b6116 AW |
2091 | (like pizza slices) and also about the Z axis into rings (as specified |
2092 | by SLICES and LOOPS, respectively). | |
2093 | ||
2094 | With respect to orientation, the +Z side of the partial disk is | |
c7b31271 | 2095 | considered to be outside (see `gluQuadricOrientation'). This means that |
3c9b6116 | 2096 | if the orientation is set to `GLU_OUTSIDE', then any normals generated |
c7b31271 | 2097 | point along the +Z axis. Otherwise, they point along the \\-Z axis. |
3c9b6116 AW |
2098 | |
2099 | If texturing is turned on (with `gluQuadricTexture'), texture | |
2100 | coordinates are generated linearly such that where R=OUTER , the value | |
2101 | at (R, 0, 0) is (1.0, 0.5), at (0, R, 0) it is (0.5, 1.0), at (\\-R, 0, | |
2102 | 0) it is (0.0, 0.5), and at (0, \\-R, 0) it is (0.5, 0.0).") | |
8925f36f | 2103 | |
25072f02 | 2104 | (define-glu-procedures |
bb894c9d AW |
2105 | ((gluPerspective |
2106 | (fovy GLdouble) | |
2107 | (aspect GLdouble) | |
2108 | (zNear GLdouble) | |
2109 | (zFar GLdouble) | |
2110 | -> | |
2111 | void)) | |
3c9b6116 AW |
2112 | "Set up a perspective projection matrix. |
2113 | ||
2114 | FOVY | |
2115 | Specifies the field of view angle, in degrees, in the Y direction. | |
2116 | ||
2117 | ASPECT | |
2118 | Specifies the aspect ratio that determines the field of view in the | |
c7b31271 | 2119 | X direction. The aspect ratio is the ratio of X (width) to Y |
3c9b6116 AW |
2120 | (height). |
2121 | ||
2122 | ZNEAR | |
2123 | Specifies the distance from the viewer to the near clipping plane | |
2124 | (always positive). | |
2125 | ||
2126 | ZFAR | |
2127 | Specifies the distance from the viewer to the far clipping plane | |
2128 | (always positive). | |
2129 | ||
2130 | `gluPerspective' specifies a viewing frustum into the world coordinate | |
c7b31271 DH |
2131 | system. In general, the aspect ratio in `gluPerspective' should match |
2132 | the aspect ratio of the associated viewport. For example, ASPECT=2.0 | |
2133 | means the viewer's angle of view is twice as wide in X as it is in Y. If | |
3c9b6116 AW |
2134 | the viewport is twice as wide as it is tall, it displays the image |
2135 | without distortion. | |
2136 | ||
2137 | The matrix generated by `gluPerspective' is multipled by the current | |
2138 | matrix, just as if `glMultMatrix' were called with the generated matrix. | |
2139 | To load the perspective matrix onto the current matrix stack instead, | |
2140 | precede the call to `gluPerspective' with a call to `glLoadIdentity'. | |
2141 | ||
2142 | Given F defined as follows: | |
2143 | ||
2144 | F=COTANGENT\u2061(FOVY/2,) The generated matrix is | |
2145 | ||
2146 | ((F/ASPECT 0 0 0), (0 F 0 0), (0 0 ZFAR+ZNEAR,/ZNEAR-ZFAR, | |
2147 | 2×ZFAR×ZNEAR,/ZNEAR-ZFAR,), (0 0 -1 0),)") | |
8925f36f | 2148 | |
25072f02 | 2149 | (define-glu-procedures |
bb894c9d AW |
2150 | ((gluPickMatrix |
2151 | (x GLdouble) | |
2152 | (y GLdouble) | |
2153 | (delX GLdouble) | |
2154 | (delY GLdouble) | |
00239761 | 2155 | (viewport GLint-*) |
bb894c9d AW |
2156 | -> |
2157 | void)) | |
3c9b6116 AW |
2158 | "Define a picking region. |
2159 | ||
2160 | X | |
2161 | Y | |
2162 | ||
2163 | Specify the center of a picking region in window coordinates. | |
2164 | ||
2165 | DELX | |
2166 | DELY | |
2167 | ||
2168 | Specify the width and height, respectively, of the picking region | |
2169 | in window coordinates. | |
2170 | ||
2171 | VIEWPORT | |
2172 | Specifies the current viewport (as from a `glGetIntegerv' call). | |
2173 | ||
2174 | `gluPickMatrix' creates a projection matrix that can be used to restrict | |
c7b31271 DH |
2175 | drawing to a small region of the viewport. This is typically useful to |
2176 | determine what objects are being drawn near the cursor. Use | |
3c9b6116 AW |
2177 | `gluPickMatrix' to restrict drawing to a small region around the cursor. |
2178 | Then, enter selection mode (with `glRenderMode') and rerender the scene. | |
2179 | All primitives that would have been drawn near the cursor are identified | |
2180 | and stored in the selection buffer. | |
2181 | ||
2182 | The matrix created by `gluPickMatrix' is multiplied by the current | |
c7b31271 | 2183 | matrix just as if `glMultMatrix' is called with the generated matrix. To |
3c9b6116 AW |
2184 | effectively use the generated pick matrix for picking, first call |
2185 | `glLoadIdentity' to load an identity matrix onto the perspective matrix | |
c7b31271 | 2186 | stack. Then call `gluPickMatrix', and, finally, call a command (such as |
3c9b6116 AW |
2187 | `gluPerspective') to multiply the perspective matrix by the pick matrix. |
2188 | ||
2189 | When using `gluPickMatrix' to pick NURBS, be careful to turn off the | |
c7b31271 | 2190 | NURBS property `GLU_AUTO_LOAD_MATRIX'. If `GLU_AUTO_LOAD_MATRIX' is not |
3c9b6116 AW |
2191 | turned off, then any NURBS surface rendered is subdivided differently |
2192 | with the pick matrix than the way it was subdivided without the pick | |
2193 | matrix.") | |
8925f36f | 2194 | |
25072f02 | 2195 | (define-glu-procedures |
bb894c9d AW |
2196 | ((gluProject |
2197 | (objX GLdouble) | |
2198 | (objY GLdouble) | |
2199 | (objZ GLdouble) | |
00239761 AW |
2200 | (model const-GLdouble-*) |
2201 | (proj const-GLdouble-*) | |
2202 | (view const-GLint-*) | |
2203 | (winX GLdouble*) | |
2204 | (winY GLdouble*) | |
2205 | (winZ GLdouble*) | |
bb894c9d AW |
2206 | -> |
2207 | GLint)) | |
3c9b6116 AW |
2208 | "Map object coordinates to window coordinates. |
2209 | ||
2210 | OBJX | |
2211 | OBJY | |
2212 | ||
2213 | OBJZ | |
2214 | ||
2215 | Specify the object coordinates. | |
2216 | ||
2217 | MODEL | |
2218 | Specifies the current modelview matrix (as from a `glGetDoublev' | |
2219 | call). | |
2220 | ||
2221 | PROJ | |
2222 | Specifies the current projection matrix (as from a `glGetDoublev' | |
2223 | call). | |
2224 | ||
2225 | VIEW | |
2226 | Specifies the current viewport (as from a `glGetIntegerv' call). | |
2227 | ||
2228 | WINX | |
2229 | WINY | |
2230 | ||
2231 | WINZ | |
2232 | ||
2233 | Return the computed window coordinates. | |
2234 | ||
2235 | `gluProject' transforms the specified object coordinates into window | |
c7b31271 DH |
2236 | coordinates using MODEL, PROJ, and VIEW. The result is stored in WINX, |
2237 | WINY, and WINZ. A return value of `GLU_TRUE' indicates success, a | |
2238 | return value of `GLU_FALSE' indicates failure. | |
3c9b6116 AW |
2239 | |
2240 | To compute the coordinates, let V=(OBJX,OBJYOBJZ1.0) represented as a | |
c7b31271 | 2241 | matrix with 4 rows and 1 column. Then `gluProject' computes V^″ as |
3c9b6116 AW |
2242 | follows: |
2243 | ||
2244 | V^″=P×M×V | |
2245 | ||
2246 | where P is the current projection matrix PROJ and M is the current | |
2247 | modelview matrix MODEL (both represented as 4×4 matrices in column-major | |
2248 | order). | |
2249 | ||
2250 | The window coordinates are then computed as follows: | |
2251 | ||
2252 | WINX=VIEW\u2061(0,)+VIEW\u2061(2,)×(V^″\u2061(0,)+1,)/2 | |
2253 | WINY=VIEW\u2061(1,)+VIEW\u2061(3,)×(V^″\u2061(1,)+1,)/2 WINZ=(V^″\u2061(2,)+1,)/2") | |
8925f36f | 2254 | |
25072f02 | 2255 | (define-glu-procedures |
bb894c9d | 2256 | ((gluPwlCurve |
00239761 | 2257 | (nurb GLUnurbs*) |
bb894c9d | 2258 | (count GLint) |
00239761 | 2259 | (data GLfloat*) |
bb894c9d AW |
2260 | (stride GLint) |
2261 | (type GLenum) | |
2262 | -> | |
2263 | void)) | |
3c9b6116 AW |
2264 | "Describe a piecewise linear NURBS trimming curve. |
2265 | ||
2266 | NURB | |
2267 | Specifies the NURBS object (created with `gluNewNurbsRenderer'). | |
2268 | ||
2269 | COUNT | |
2270 | Specifies the number of points on the curve. | |
2271 | ||
2272 | DATA | |
2273 | Specifies an array containing the curve points. | |
2274 | ||
2275 | STRIDE | |
2276 | Specifies the offset (a number of single-precision floating-point | |
2277 | values) between points on the curve. | |
2278 | ||
2279 | TYPE | |
c7b31271 | 2280 | Specifies the type of curve. Must be either `GLU_MAP1_TRIM_2' or |
3c9b6116 AW |
2281 | `GLU_MAP1_TRIM_3'. |
2282 | ||
2283 | `gluPwlCurve' describes a piecewise linear trimming curve for a NURBS | |
c7b31271 DH |
2284 | surface. A piecewise linear curve consists of a list of coordinates of |
2285 | points in the parameter space for the NURBS surface to be trimmed. These | |
2286 | points are connected with line segments to form a curve. If the curve | |
2287 | is an approximation to a curve that is not piecewise linear, the points | |
3c9b6116 AW |
2288 | should be close enough in parameter space that the resulting path |
2289 | appears curved at the resolution used in the application. | |
2290 | ||
2291 | If TYPE is `GLU_MAP1_TRIM_2', then it describes a curve in | |
c7b31271 | 2292 | two-dimensional (U and V) parameter space. If it is `GLU_MAP1_TRIM_3', |
3c9b6116 | 2293 | then it describes a curve in two-dimensional homogeneous (U, V, and W) |
c7b31271 | 2294 | parameter space. See the `gluBeginTrim' reference page for more |
3c9b6116 | 2295 | information about trimming curves.") |
8925f36f | 2296 | |
25072f02 | 2297 | (define-glu-procedures |
bb894c9d | 2298 | ((gluQuadricCallback |
00239761 | 2299 | (quad GLUquadric*) |
bb894c9d AW |
2300 | (which GLenum) |
2301 | (CallBackFunc _GLUfuncptr) | |
2302 | -> | |
2303 | void)) | |
3c9b6116 AW |
2304 | "Define a callback for a quadrics object. |
2305 | ||
2306 | QUAD | |
2307 | Specifies the quadrics object (created with `gluNewQuadric'). | |
2308 | ||
2309 | WHICH | |
c7b31271 | 2310 | Specifies the callback being defined. The only valid value is |
3c9b6116 AW |
2311 | `GLU_ERROR'. |
2312 | ||
2313 | CALLBACKFUNC | |
2314 | Specifies the function to be called. | |
2315 | ||
2316 | `gluQuadricCallback' is used to define a new callback to be used by a | |
c7b31271 DH |
2317 | quadrics object. If the specified callback is already defined, then it |
2318 | is replaced. If CALLBACKFUNC is NULL, then any existing callback is | |
3c9b6116 AW |
2319 | erased. |
2320 | ||
2321 | The one legal callback is `GLU_ERROR': | |
2322 | ||
2323 | `GLU_ERROR' | |
c7b31271 | 2324 | The function is called when an error is encountered. Its single |
3c9b6116 | 2325 | argument is of type GLenum, and it indicates the specific error |
c7b31271 | 2326 | that occurred. Character strings describing these errors can be |
3c9b6116 | 2327 | retrieved with the `gluErrorString' call.") |
8925f36f | 2328 | |
25072f02 | 2329 | (define-glu-procedures |
bb894c9d | 2330 | ((gluQuadricDrawStyle |
00239761 | 2331 | (quad GLUquadric*) |
bb894c9d AW |
2332 | (draw GLenum) |
2333 | -> | |
2334 | void)) | |
3c9b6116 AW |
2335 | "Specify the draw style desired for quadrics. |
2336 | ||
2337 | QUAD | |
2338 | Specifies the quadrics object (created with `gluNewQuadric'). | |
2339 | ||
2340 | DRAW | |
c7b31271 | 2341 | Specifies the desired draw style. Valid values are `GLU_FILL', |
3c9b6116 AW |
2342 | `GLU_LINE', `GLU_SILHOUETTE', and `GLU_POINT'. |
2343 | ||
2344 | `gluQuadricDrawStyle' specifies the draw style for quadrics rendered | |
c7b31271 | 2345 | with QUAD. The legal values are as follows: |
3c9b6116 AW |
2346 | |
2347 | `GLU_FILL' | |
c7b31271 | 2348 | Quadrics are rendered with polygon primitives. The polygons are |
3c9b6116 AW |
2349 | drawn in a counterclockwise fashion with respect to their normals |
2350 | (as defined with `gluQuadricOrientation'). | |
2351 | ||
2352 | `GLU_LINE' | |
2353 | Quadrics are rendered as a set of lines. | |
2354 | ||
2355 | `GLU_SILHOUETTE' | |
2356 | Quadrics are rendered as a set of lines, except that edges | |
2357 | separating coplanar faces will not be drawn. | |
2358 | ||
2359 | `GLU_POINT' | |
2360 | Quadrics are rendered as a set of points.") | |
8925f36f | 2361 | |
25072f02 | 2362 | (define-glu-procedures |
bb894c9d | 2363 | ((gluQuadricNormals |
00239761 | 2364 | (quad GLUquadric*) |
bb894c9d AW |
2365 | (normal GLenum) |
2366 | -> | |
2367 | void)) | |
3c9b6116 AW |
2368 | "Specify what kind of normals are desired for quadrics. |
2369 | ||
2370 | QUAD | |
2371 | Specifies the quadrics object (created with `gluNewQuadric'). | |
2372 | ||
2373 | NORMAL | |
c7b31271 DH |
2374 | Specifies the desired type of normals. Valid values are |
2375 | `GLU_NONE', `GLU_FLAT', and `GLU_SMOOTH'. | |
3c9b6116 AW |
2376 | |
2377 | `gluQuadricNormals' specifies what kind of normals are desired for | |
c7b31271 | 2378 | quadrics rendered with QUAD. The legal values are as follows: |
3c9b6116 AW |
2379 | |
2380 | `GLU_NONE' | |
2381 | No normals are generated. | |
2382 | ||
2383 | `GLU_FLAT' | |
2384 | One normal is generated for every facet of a quadric. | |
2385 | ||
2386 | `GLU_SMOOTH' | |
c7b31271 | 2387 | One normal is generated for every vertex of a quadric. This is the |
3c9b6116 | 2388 | initial value.") |
8925f36f | 2389 | |
25072f02 | 2390 | (define-glu-procedures |
bb894c9d | 2391 | ((gluQuadricOrientation |
00239761 | 2392 | (quad GLUquadric*) |
bb894c9d AW |
2393 | (orientation GLenum) |
2394 | -> | |
2395 | void)) | |
3c9b6116 AW |
2396 | "Specify inside/outside orientation for quadrics. |
2397 | ||
2398 | QUAD | |
2399 | Specifies the quadrics object (created with `gluNewQuadric'). | |
2400 | ||
2401 | ORIENTATION | |
c7b31271 | 2402 | Specifies the desired orientation. Valid values are `GLU_OUTSIDE' |
3c9b6116 AW |
2403 | and `GLU_INSIDE'. |
2404 | ||
2405 | `gluQuadricOrientation' specifies what kind of orientation is desired | |
c7b31271 | 2406 | for quadrics rendered with QUAD. The ORIENTATION values are as follows: |
3c9b6116 AW |
2407 | |
2408 | `GLU_OUTSIDE' | |
2409 | Quadrics are drawn with normals pointing outward (the initial | |
2410 | value). | |
2411 | ||
2412 | `GLU_INSIDE' | |
2413 | Quadrics are drawn with normals pointing inward. | |
2414 | ||
2415 | Note that the interpretation of OUTWARD and INWARD depends on the | |
2416 | quadric being drawn.") | |
8925f36f | 2417 | |
25072f02 | 2418 | (define-glu-procedures |
bb894c9d | 2419 | ((gluQuadricTexture |
00239761 | 2420 | (quad GLUquadric*) |
bb894c9d AW |
2421 | (texture GLboolean) |
2422 | -> | |
2423 | void)) | |
3c9b6116 AW |
2424 | "Specify if texturing is desired for quadrics. |
2425 | ||
2426 | QUAD | |
2427 | Specifies the quadrics object (created with `gluNewQuadric'). | |
2428 | ||
2429 | TEXTURE | |
2430 | Specifies a flag indicating if texture coordinates should be | |
2431 | generated. | |
2432 | ||
2433 | `gluQuadricTexture' specifies if texture coordinates should be generated | |
c7b31271 | 2434 | for quadrics rendered with QUAD. If the value of TEXTURE is `GLU_TRUE', |
3c9b6116 | 2435 | then texture coordinates are generated, and if TEXTURE is `GLU_FALSE', |
c7b31271 | 2436 | they are not. The initial value is `GLU_FALSE'. |
3c9b6116 AW |
2437 | |
2438 | The manner in which texture coordinates are generated depends upon the | |
2439 | specific quadric rendered.") | |
8925f36f | 2440 | |
25072f02 | 2441 | (define-glu-procedures |
bb894c9d AW |
2442 | ((gluScaleImage |
2443 | (format GLenum) | |
2444 | (wIn GLsizei) | |
2445 | (hIn GLsizei) | |
2446 | (typeIn GLenum) | |
00239761 | 2447 | (dataIn const-void-*) |
bb894c9d AW |
2448 | (wOut GLsizei) |
2449 | (hOut GLsizei) | |
2450 | (typeOut GLenum) | |
00239761 | 2451 | (dataOut GLvoid*) |
bb894c9d AW |
2452 | -> |
2453 | GLint)) | |
3c9b6116 AW |
2454 | "Scale an image to an arbitrary size. |
2455 | ||
2456 | FORMAT | |
c7b31271 | 2457 | Specifies the format of the pixel data. The following symbolic |
3c9b6116 AW |
2458 | values are valid: `GLU_COLOR_INDEX', `GLU_STENCIL_INDEX', |
2459 | `GLU_DEPTH_COMPONENT', `GLU_RED', `GLU_GREEN', `GLU_BLUE', | |
2460 | `GLU_ALPHA', `GLU_RGB', `GLU_RGBA', `GLU_BGR', `GLU_BGRA', | |
2461 | `GLU_LUMINANCE', and `GLU_LUMINANCE_ALPHA'. | |
2462 | ||
2463 | WIN | |
2464 | HIN | |
2465 | ||
2466 | Specify in pixels the width and height, respectively, of the source | |
2467 | image. | |
2468 | ||
2469 | TYPEIN | |
c7b31271 | 2470 | Specifies the data type for DATAIN. Must be one of |
3c9b6116 AW |
2471 | `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP', |
2472 | `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT', | |
2473 | `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2', | |
2474 | `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5', | |
2475 | `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4', | |
2476 | `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1', | |
2477 | `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8', | |
2478 | `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or | |
2479 | `GLU_UNSIGNED_INT_2_10_10_10_REV'. | |
2480 | ||
2481 | DATAIN | |
2482 | Specifies a pointer to the source image. | |
2483 | ||
2484 | WOUT | |
2485 | HOUT | |
2486 | ||
2487 | Specify the width and height, respectively, in pixels of the | |
2488 | destination image. | |
2489 | ||
2490 | TYPEOUT | |
c7b31271 | 2491 | Specifies the data type for DATAOUT. Must be one of |
3c9b6116 AW |
2492 | `GLU_UNSIGNED_BYTE', `GLU_BYTE', `GLU_BITMAP', |
2493 | `GLU_UNSIGNED_SHORT', `GLU_SHORT', `GLU_UNSIGNED_INT', `GLU_INT', | |
2494 | `GLU_FLOAT', `GLU_UNSIGNED_BYTE_3_3_2', | |
2495 | `GLU_UNSIGNED_BYTE_2_3_3_REV', `GLU_UNSIGNED_SHORT_5_6_5', | |
2496 | `GLU_UNSIGNED_SHORT_5_6_5_REV', `GLU_UNSIGNED_SHORT_4_4_4_4', | |
2497 | `GLU_UNSIGNED_SHORT_4_4_4_4_REV', `GLU_UNSIGNED_SHORT_5_5_5_1', | |
2498 | `GLU_UNSIGNED_SHORT_1_5_5_5_REV', `GLU_UNSIGNED_INT_8_8_8_8', | |
2499 | `GLU_UNSIGNED_INT_8_8_8_8_REV', `GLU_UNSIGNED_INT_10_10_10_2', or | |
2500 | `GLU_UNSIGNED_INT_2_10_10_10_REV'. | |
2501 | ||
2502 | DATAOUT | |
2503 | Specifies a pointer to the destination image. | |
2504 | ||
2505 | `gluScaleImage' scales a pixel image using the appropriate pixel store | |
2506 | modes to unpack data from the source image and pack data into the | |
2507 | destination image. | |
2508 | ||
2509 | When shrinking an image, `gluScaleImage' uses a box filter to sample the | |
c7b31271 | 2510 | source image and create pixels for the destination image. When |
3c9b6116 AW |
2511 | magnifying an image, the pixels from the source image are linearly |
2512 | interpolated to create the destination image. | |
2513 | ||
2514 | A return value of zero indicates success, otherwise a GLU error code is | |
2515 | returned (see `gluErrorString'). | |
2516 | ||
2517 | See the `glReadPixels' reference page for a description of the | |
2518 | acceptable values for the FORMAT, TYPEIN, and TYPEOUT parameters. | |
2519 | ||
2520 | `GLU_INVALID_VALUE' is returned if WIN, HIN, WOUT, or HOUT is negative. | |
2521 | ||
2522 | `GLU_INVALID_ENUM' is returned if FORMAT, TYPEIN, or TYPEOUT is not | |
2523 | legal. | |
2524 | ||
2525 | `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is | |
2526 | `GLU_UNSIGNED_BYTE_3_3_2' or `GLU_UNSIGNED_BYTE_2_3_3_REV' and FORMAT is | |
2527 | not `GLU_RGB'. | |
2528 | ||
2529 | `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is | |
2530 | `GLU_UNSIGNED_SHORT_5_6_5' or `GLU_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
2531 | is not `GLU_RGB'. | |
2532 | ||
2533 | `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is | |
2534 | `GLU_UNSIGNED_SHORT_4_4_4_4' or `GLU_UNSIGNED_SHORT_4_4_4_4_REV' and | |
2535 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
2536 | ||
2537 | `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is | |
2538 | `GLU_UNSIGNED_SHORT_5_5_5_1' or `GLU_UNSIGNED_SHORT_1_5_5_5_REV' and | |
2539 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'. | |
2540 | ||
2541 | `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is | |
2542 | `GLU_UNSIGNED_INT_8_8_8_8' or `GLU_UNSIGNED_INT_8_8_8_8_REV' and FORMAT | |
2543 | is neither `GLU_RGBA' nor `GLU_BGRA'. | |
2544 | ||
2545 | `GLU_INVALID_OPERATION' is returned if TYPEIN or TYPEOUT is | |
2546 | `GLU_UNSIGNED_INT_10_10_10_2' or `GLU_UNSIGNED_INT_2_10_10_10_REV' and | |
2547 | FORMAT is neither `GLU_RGBA' nor `GLU_BGRA'.") | |
8925f36f | 2548 | |
25072f02 | 2549 | (define-glu-procedures |
bb894c9d | 2550 | ((gluSphere |
00239761 | 2551 | (quad GLUquadric*) |
bb894c9d AW |
2552 | (radius GLdouble) |
2553 | (slices GLint) | |
2554 | (stacks GLint) | |
2555 | -> | |
2556 | void)) | |
3c9b6116 AW |
2557 | "Draw a sphere. |
2558 | ||
2559 | QUAD | |
2560 | Specifies the quadrics object (created with `gluNewQuadric'). | |
2561 | ||
2562 | RADIUS | |
2563 | Specifies the radius of the sphere. | |
2564 | ||
2565 | SLICES | |
2566 | Specifies the number of subdivisions around the Z axis (similar to | |
2567 | lines of longitude). | |
2568 | ||
2569 | STACKS | |
2570 | Specifies the number of subdivisions along the Z axis (similar to | |
2571 | lines of latitude). | |
2572 | ||
2573 | `gluSphere' draws a sphere of the given radius centered around the | |
c7b31271 DH |
2574 | origin. The sphere is subdivided around the Z axis into slices and |
2575 | along the Z axis into stacks (similar to lines of longitude and | |
2576 | latitude). | |
3c9b6116 AW |
2577 | |
2578 | If the orientation is set to `GLU_OUTSIDE' (with | |
2579 | `gluQuadricOrientation'), then any normals generated point away from the | |
c7b31271 | 2580 | center of the sphere. Otherwise, they point toward the center of the |
3c9b6116 AW |
2581 | sphere. |
2582 | ||
2583 | If texturing is turned on (with `gluQuadricTexture'), then texture | |
2584 | coordinates are generated so that T ranges from 0.0 at Z=-RADIUS to 1.0 | |
2585 | at Z=RADIUS (T increases linearly along longitudinal lines), and S | |
2586 | ranges from 0.0 at the +Y axis, to 0.25 at the +X axis, to 0.5 at the | |
2587 | \\-Y axis, to 0.75 at the \\-X axis, and back to 1.0 at the +Y axis.") | |
8925f36f | 2588 | |
25072f02 | 2589 | (define-glu-procedures |
00239761 AW |
2590 | ((gluTessBeginContour |
2591 | (tess GLUtesselator*) | |
2592 | -> | |
2593 | void) | |
2594 | (gluTessEndContour (tess GLUtesselator*) -> void)) | |
3c9b6116 AW |
2595 | "Delimit a contour description. |
2596 | ||
2597 | TESS | |
2598 | Specifies the tessellation object (created with `gluNewTess'). | |
2599 | ||
2600 | `gluTessBeginContour' and `gluTessEndContour' delimit the definition of | |
c7b31271 DH |
2601 | a polygon contour. Within each |
2602 | `gluTessBeginContour'/`gluTessEndContour' pair, there can be zero or | |
2603 | more calls to `gluTessVertex'. The vertices specify a closed contour | |
2604 | (the last vertex of each contour is automatically linked to the first). | |
2605 | See the `gluTessVertex' reference page for more details. | |
2606 | `gluTessBeginContour' can only be called between `gluTessBeginPolygon' | |
2607 | and `gluTessEndPolygon'.") | |
8925f36f | 2608 | |
25072f02 | 2609 | (define-glu-procedures |
00239761 AW |
2610 | ((gluTessBeginPolygon |
2611 | (tess GLUtesselator*) | |
2612 | (data GLvoid*) | |
2613 | -> | |
2614 | void)) | |
3c9b6116 AW |
2615 | "Delimit a polygon description. |
2616 | ||
2617 | TESS | |
2618 | Specifies the tessellation object (created with `gluNewTess'). | |
2619 | ||
2620 | DATA | |
2621 | Specifies a pointer to user polygon data. | |
2622 | ||
2623 | `gluTessBeginPolygon' and `gluTessEndPolygon' delimit the definition of | |
c7b31271 | 2624 | a convex, concave or self-intersecting polygon. Within each |
3c9b6116 | 2625 | `gluTessBeginPolygon'/`gluTessEndPolygon' pair, there must be one or |
c7b31271 DH |
2626 | more calls to `gluTessBeginContour'/`gluTessEndContour'. Within each |
2627 | contour, there are zero or more calls to `gluTessVertex'. The vertices | |
3c9b6116 | 2628 | specify a closed contour (the last vertex of each contour is |
c7b31271 | 2629 | automatically linked to the first). See the `gluTessVertex', |
3c9b6116 AW |
2630 | `gluTessBeginContour', and `gluTessEndContour' reference pages for more |
2631 | details. | |
2632 | ||
c7b31271 | 2633 | DATA is a pointer to a user-defined data structure. If the appropriate |
3c9b6116 | 2634 | callback(s) are specified (see `gluTessCallback'), then this pointer is |
c7b31271 | 2635 | returned to the callback function(s). Thus, it is a convenient way to |
3c9b6116 AW |
2636 | store per-polygon information. |
2637 | ||
2638 | Once `gluTessEndPolygon' is called, the polygon is tessellated, and the | |
c7b31271 | 2639 | resulting triangles are described through callbacks. See |
3c9b6116 | 2640 | `gluTessCallback' for descriptions of the callback functions.") |
8925f36f | 2641 | |
25072f02 | 2642 | (define-glu-procedures |
bb894c9d | 2643 | ((gluTessCallback |
00239761 | 2644 | (tess GLUtesselator*) |
bb894c9d AW |
2645 | (which GLenum) |
2646 | (CallBackFunc _GLUfuncptr) | |
2647 | -> | |
2648 | void)) | |
3c9b6116 AW |
2649 | "Define a callback for a tessellation object. |
2650 | ||
2651 | TESS | |
2652 | Specifies the tessellation object (created with `gluNewTess'). | |
2653 | ||
2654 | WHICH | |
c7b31271 | 2655 | Specifies the callback being defined. The following values are |
3c9b6116 AW |
2656 | valid: `GLU_TESS_BEGIN', `GLU_TESS_BEGIN_DATA', |
2657 | `GLU_TESS_EDGE_FLAG', `GLU_TESS_EDGE_FLAG_DATA', `GLU_TESS_VERTEX', | |
2658 | `GLU_TESS_VERTEX_DATA', `GLU_TESS_END', `GLU_TESS_END_DATA', | |
2659 | `GLU_TESS_COMBINE', `GLU_TESS_COMBINE_DATA', `GLU_TESS_ERROR', and | |
2660 | `GLU_TESS_ERROR_DATA'. | |
2661 | ||
2662 | CALLBACKFUNC | |
2663 | Specifies the function to be called. | |
2664 | ||
2665 | `gluTessCallback' is used to indicate a callback to be used by a | |
c7b31271 DH |
2666 | tessellation object. If the specified callback is already defined, then |
2667 | it is replaced. If CALLBACKFUNC is NULL, then the existing callback | |
3c9b6116 AW |
2668 | becomes undefined. |
2669 | ||
2670 | These callbacks are used by the tessellation object to describe how a | |
c7b31271 | 2671 | polygon specified by the user is broken into triangles. Note that there |
3c9b6116 | 2672 | are two versions of each callback: one with user-specified polygon data |
c7b31271 | 2673 | and one without. If both versions of a particular callback are |
3c9b6116 | 2674 | specified, then the callback with user-specified polygon data will be |
c7b31271 DH |
2675 | used. Note that the POLYGON_DATA parameter used by some of the |
2676 | functions is a copy of the pointer that was specified when | |
2677 | `gluTessBeginPolygon' was called. The legal callbacks are as follows: | |
3c9b6116 AW |
2678 | |
2679 | `GLU_TESS_BEGIN' | |
2680 | The begin callback is invoked like `glBegin' to indicate the start | |
c7b31271 DH |
2681 | of a (triangle) primitive. The function takes a single argument of |
2682 | type GLenum. If the `GLU_TESS_BOUNDARY_ONLY' property is set to | |
3c9b6116 | 2683 | `GLU_FALSE', then the argument is set to either `GLU_TRIANGLE_FAN', |
c7b31271 | 2684 | `GLU_TRIANGLE_STRIP', or `GLU_TRIANGLES'. If the |
3c9b6116 | 2685 | `GLU_TESS_BOUNDARY_ONLY' property is set to `GLU_TRUE', then the |
c7b31271 DH |
2686 | argument will be set to `GLU_LINE_LOOP'. The function prototype |
2687 | for this callback is: | |
3c9b6116 AW |
2688 | |
2689 | `GLU_TESS_BEGIN_DATA' | |
2690 | The same as the `GLU_TESS_BEGIN' callback except that it takes an | |
c7b31271 DH |
2691 | additional pointer argument. This pointer is identical to the |
2692 | opaque pointer provided when `gluTessBeginPolygon' was called. The | |
3c9b6116 AW |
2693 | function prototype for this callback is: |
2694 | ||
2695 | `GLU_TESS_EDGE_FLAG' | |
c7b31271 | 2696 | The edge flag callback is similar to `glEdgeFlag'. The function |
3c9b6116 | 2697 | takes a single boolean flag that indicates which edges lie on the |
c7b31271 | 2698 | polygon boundary. If the flag is `GLU_TRUE', then each vertex that |
3c9b6116 | 2699 | follows begins an edge that lies on the polygon boundary, that is, |
c7b31271 | 2700 | an edge that separates an interior region from an exterior one. If |
3c9b6116 | 2701 | the flag is `GLU_FALSE', then each vertex that follows begins an |
c7b31271 | 2702 | edge that lies in the polygon interior. The edge flag callback (if |
3c9b6116 AW |
2703 | defined) is invoked before the first vertex callback. |
2704 | ||
2705 | Since triangle fans and triangle strips do not support edge flags, | |
2706 | the begin callback is not called with `GLU_TRIANGLE_FAN' or | |
2707 | `GLU_TRIANGLE_STRIP' if a non-NULL edge flag callback is provided. | |
2708 | (If the callback is initialized to NULL, there is no impact on | |
c7b31271 DH |
2709 | performance). Instead, the fans and strips are converted to |
2710 | independent triangles. The function prototype for this callback | |
2711 | is: | |
3c9b6116 AW |
2712 | |
2713 | `GLU_TESS_EDGE_FLAG_DATA' | |
2714 | The same as the `GLU_TESS_EDGE_FLAG' callback except that it takes | |
c7b31271 DH |
2715 | an additional pointer argument. This pointer is identical to the |
2716 | opaque pointer provided when `gluTessBeginPolygon' was called. The | |
3c9b6116 AW |
2717 | function prototype for this callback is: |
2718 | ||
2719 | `GLU_TESS_VERTEX' | |
2720 | The vertex callback is invoked between the begin and end callbacks. | |
2721 | It is similar to `glVertex', and it defines the vertices of the | |
c7b31271 DH |
2722 | triangles created by the tessellation process. The function takes |
2723 | a pointer as its only argument. This pointer is identical to the | |
3c9b6116 | 2724 | opaque pointer provided by the user when the vertex was described |
c7b31271 DH |
2725 | (see `gluTessVertex'). The function prototype for this callback |
2726 | is: | |
3c9b6116 AW |
2727 | |
2728 | `GLU_TESS_VERTEX_DATA' | |
2729 | The same as the `GLU_TESS_VERTEX' callback except that it takes an | |
c7b31271 DH |
2730 | additional pointer argument. This pointer is identical to the |
2731 | opaque pointer provided when `gluTessBeginPolygon' was called. The | |
3c9b6116 AW |
2732 | function prototype for this callback is: |
2733 | ||
2734 | `GLU_TESS_END' | |
c7b31271 DH |
2735 | The end callback serves the same purpose as `glEnd'. It indicates |
2736 | the end of a primitive and it takes no arguments. The function | |
3c9b6116 AW |
2737 | prototype for this callback is: |
2738 | ||
2739 | `GLU_TESS_END_DATA' | |
2740 | The same as the `GLU_TESS_END' callback except that it takes an | |
c7b31271 DH |
2741 | additional pointer argument. This pointer is identical to the |
2742 | opaque pointer provided when `gluTessBeginPolygon' was called. The | |
3c9b6116 AW |
2743 | function prototype for this callback is: |
2744 | ||
2745 | `GLU_TESS_COMBINE' | |
2746 | The combine callback is called to create a new vertex when the | |
2747 | tessellation detects an intersection or wishes to merge features. | |
2748 | The function takes four arguments: an array of three elements each | |
2749 | of type GLdouble, an array of four pointers, an array of four | |
c7b31271 | 2750 | elements each of type GLfloat, and a pointer to a pointer. The |
3c9b6116 AW |
2751 | prototype is: |
2752 | ||
2753 | The vertex is defined as a linear combination of up to four | |
c7b31271 | 2754 | existing vertices, stored in VERTEX_DATA. The coefficients of the |
3c9b6116 | 2755 | linear combination are given by WEIGHT; these weights always add up |
c7b31271 DH |
2756 | to 1. All vertex pointers are valid even when some of the weights |
2757 | are 0. COORDS gives the location of the new vertex. | |
3c9b6116 AW |
2758 | |
2759 | The user must allocate another vertex, interpolate parameters using | |
2760 | VERTEX_DATA and WEIGHT, and return the new vertex pointer in | |
c7b31271 | 2761 | OUTDATA. This handle is supplied during rendering callbacks. The |
3c9b6116 AW |
2762 | user is responsible for freeing the memory some time after |
2763 | `gluTessEndPolygon' is called. | |
2764 | ||
2765 | For example, if the polygon lies in an arbitrary plane in 3-space, | |
2766 | and a color is associated with each vertex, the `GLU_TESS_COMBINE' | |
2767 | callback might look like this: | |
2768 | ||
2769 | If the tessellation detects an intersection, then the | |
2770 | `GLU_TESS_COMBINE' or `GLU_TESS_COMBINE_DATA' callback (see below) | |
2771 | must be defined, and it must write a non-NULL pointer into DATAOUT. | |
2772 | Otherwise the `GLU_TESS_NEED_COMBINE_CALLBACK' error occurs, and no | |
2773 | output is generated. | |
2774 | ||
2775 | `GLU_TESS_COMBINE_DATA' | |
2776 | The same as the `GLU_TESS_COMBINE' callback except that it takes an | |
c7b31271 DH |
2777 | additional pointer argument. This pointer is identical to the |
2778 | opaque pointer provided when `gluTessBeginPolygon' was called. The | |
3c9b6116 AW |
2779 | function prototype for this callback is: |
2780 | ||
2781 | `GLU_TESS_ERROR' | |
c7b31271 | 2782 | The error callback is called when an error is encountered. The one |
3c9b6116 AW |
2783 | argument is of type GLenum; it indicates the specific error that |
2784 | occurred and will be set to one of | |
2785 | `GLU_TESS_MISSING_BEGIN_POLYGON', `GLU_TESS_MISSING_END_POLYGON', | |
2786 | `GLU_TESS_MISSING_BEGIN_CONTOUR', `GLU_TESS_MISSING_END_CONTOUR', | |
2787 | `GLU_TESS_COORD_TOO_LARGE', `GLU_TESS_NEED_COMBINE_CALLBACK', or | |
c7b31271 DH |
2788 | `GLU_OUT_OF_MEMORY'. Character strings describing these errors can |
2789 | be retrieved with the `gluErrorString' call. The function | |
2790 | prototype for this callback is: | |
3c9b6116 AW |
2791 | |
2792 | The GLU library will recover from the first four errors by | |
c7b31271 DH |
2793 | inserting the missing call(s). `GLU_TESS_COORD_TOO_LARGE' |
2794 | indicates that some vertex coordinate exceeded the predefined | |
2795 | constant `GLU_TESS_MAX_COORD' in absolute value, and that the value | |
2796 | has been clamped. (Coordinate values must be small enough so that | |
2797 | two can be multiplied together without overflow.) | |
3c9b6116 AW |
2798 | `GLU_TESS_NEED_COMBINE_CALLBACK' indicates that the tessellation |
2799 | detected an intersection between two edges in the input data, and | |
2800 | the `GLU_TESS_COMBINE' or `GLU_TESS_COMBINE_DATA' callback was not | |
c7b31271 | 2801 | provided. No output is generated. `GLU_OUT_OF_MEMORY' indicates |
3c9b6116 AW |
2802 | that there is not enough memory so no output is generated. |
2803 | ||
2804 | `GLU_TESS_ERROR_DATA' | |
2805 | The same as the `GLU_TESS_ERROR' callback except that it takes an | |
c7b31271 DH |
2806 | additional pointer argument. This pointer is identical to the |
2807 | opaque pointer provided when `gluTessBeginPolygon' was called. The | |
3c9b6116 AW |
2808 | function prototype for this callback is: |
2809 | ||
2810 | ||
2811 | void begin( GLenum type ); | |
2812 | ||
2813 | ||
2814 | void beginData( GLenum type, void *polygon_data ); | |
2815 | ||
2816 | ||
2817 | void edgeFlag( GLboolean flag ); | |
2818 | ||
2819 | ||
2820 | void edgeFlagData( GLboolean flag, void *polygon_data ); | |
2821 | ||
2822 | ||
2823 | void vertex( void *vertex_data ); | |
2824 | ||
2825 | ||
2826 | void vertexData( void *vertex_data, void *polygon_data ); | |
2827 | ||
2828 | ||
2829 | void end( void ); | |
2830 | ||
2831 | ||
2832 | void endData( void *polygon_data ); | |
2833 | ||
2834 | ||
2835 | void combine( GLdouble coords[3], void *vertex_data[4], | |
2836 | GLfloat weight[4], void **outData ); | |
2837 | ||
2838 | ||
2839 | void myCombine( GLdouble coords[3], VERTEX *d[4], | |
2840 | GLfloat w[4], VERTEX **dataOut ) | |
2841 | { | |
2842 | VERTEX *new = new_vertex(); | |
2843 | ||
2844 | new->x = coords[0]; | |
2845 | new->y = coords[1]; | |
2846 | new->z = coords[2]; | |
2847 | new->r = w[0]*d[0]->r + w[1]*d[1]->r + w[2]*d[2]->r + w[3]*d[3]->r; | |
2848 | new->g = w[0]*d[0]->g + w[1]*d[1]->g + w[2]*d[2]->g + w[3]*d[3]->g; | |
2849 | new->b = w[0]*d[0]->b + w[1]*d[1]->b + w[2]*d[2]->b + w[3]*d[3]->b; | |
2850 | new->a = w[0]*d[0]->a + w[1]*d[1]->a + w[2]*d[2]->a + w[3]*d[3]->a; | |
2851 | *dataOut = new; | |
2852 | } | |
2853 | ||
2854 | ||
2855 | void combineData( GLdouble coords[3], void *vertex_data[4], | |
2856 | GLfloat weight[4], void **outData, | |
2857 | void *polygon_data ); | |
2858 | ||
2859 | ||
2860 | void error( GLenum errno ); | |
2861 | ||
2862 | ||
2863 | void errorData( GLenum errno, void *polygon_data );") | |
8925f36f | 2864 | |
25072f02 | 2865 | (define-glu-procedures |
00239761 | 2866 | ((gluTessEndPolygon (tess GLUtesselator*) -> void)) |
3c9b6116 AW |
2867 | "Delimit a polygon description. |
2868 | ||
2869 | TESS | |
2870 | Specifies the tessellation object (created with `gluNewTess'). | |
2871 | ||
2872 | `gluTessBeginPolygon' and `gluTessEndPolygon' delimit the definition of | |
c7b31271 | 2873 | a convex, concave, or self-intersecting polygon. Within each |
3c9b6116 | 2874 | `gluTessBeginPolygon'/`gluTessEndPolygon' pair, there must be one or |
c7b31271 DH |
2875 | more calls to `gluTessBeginContour'/`gluTessEndContour'. Within each |
2876 | contour, there are zero or more calls to `gluTessVertex'. The vertices | |
3c9b6116 | 2877 | specify a closed contour (the last vertex of each contour is |
c7b31271 | 2878 | automatically linked to the first). See the `gluTessVertex', |
3c9b6116 AW |
2879 | `gluTessBeginContour', and `gluTessEndContour' reference pages for more |
2880 | details. | |
2881 | ||
2882 | Once `gluTessEndPolygon' is called, the polygon is tessellated, and the | |
c7b31271 | 2883 | resulting triangles are described through callbacks. See |
3c9b6116 | 2884 | `gluTessCallback' for descriptions of the callback functions.") |
8925f36f | 2885 | |
25072f02 | 2886 | (define-glu-procedures |
bb894c9d | 2887 | ((gluTessNormal |
00239761 | 2888 | (tess GLUtesselator*) |
bb894c9d AW |
2889 | (valueX GLdouble) |
2890 | (valueY GLdouble) | |
2891 | (valueZ GLdouble) | |
2892 | -> | |
2893 | void)) | |
3c9b6116 AW |
2894 | "Specify a normal for a polygon. |
2895 | ||
2896 | TESS | |
2897 | Specifies the tessellation object (created with `gluNewTess'). | |
2898 | ||
2899 | VALUEX | |
2900 | Specifies the first component of the normal. | |
2901 | ||
2902 | VALUEY | |
2903 | Specifies the second component of the normal. | |
2904 | ||
2905 | VALUEZ | |
2906 | Specifies the third component of the normal. | |
2907 | ||
2908 | `gluTessNormal' describes a normal for a polygon that the program is | |
c7b31271 DH |
2909 | defining. All input data will be projected onto a plane perpendicular |
2910 | to one of the three coordinate axes before tessellation and all output | |
3c9b6116 AW |
2911 | triangles will be oriented CCW with respect to the normal (CW |
2912 | orientation can be obtained by reversing the sign of the supplied | |
c7b31271 | 2913 | normal). For example, if you know that all polygons lie in the x-y |
3c9b6116 AW |
2914 | plane, call `gluTessNormal'(tess, 0.0, 0.0, 1.0) before rendering any |
2915 | polygons. | |
2916 | ||
2917 | If the supplied normal is (0.0, 0.0, 0.0) (the initial value), the | |
c7b31271 | 2918 | normal is determined as follows. The direction of the normal, up to its |
3c9b6116 | 2919 | sign, is found by fitting a plane to the vertices, without regard to how |
c7b31271 | 2920 | the vertices are connected. It is expected that the input data lies |
3c9b6116 | 2921 | approximately in the plane; otherwise, projection perpendicular to one |
c7b31271 | 2922 | of the three coordinate axes may substantially change the geometry. The |
3c9b6116 AW |
2923 | sign of the normal is chosen so that the sum of the signed areas of all |
2924 | input contours is nonnegative (where a CCW contour has positive area). | |
2925 | ||
2926 | The supplied normal persists until it is changed by another call to | |
2927 | `gluTessNormal'.") | |
8925f36f | 2928 | |
25072f02 | 2929 | (define-glu-procedures |
bb894c9d | 2930 | ((gluTessProperty |
00239761 | 2931 | (tess GLUtesselator*) |
bb894c9d AW |
2932 | (which GLenum) |
2933 | (data GLdouble) | |
2934 | -> | |
2935 | void)) | |
3c9b6116 AW |
2936 | "Set a tessellation object property. |
2937 | ||
2938 | TESS | |
2939 | Specifies the tessellation object (created with `gluNewTess'). | |
2940 | ||
2941 | WHICH | |
c7b31271 | 2942 | Specifies the property to be set. Valid values are |
3c9b6116 AW |
2943 | `GLU_TESS_WINDING_RULE', `GLU_TESS_BOUNDARY_ONLY', and |
2944 | `GLU_TESS_TOLERANCE'. | |
2945 | ||
2946 | DATA | |
2947 | Specifies the value of the indicated property. | |
2948 | ||
2949 | `gluTessProperty' is used to control properties stored in a tessellation | |
c7b31271 DH |
2950 | object. These properties affect the way that the polygons are |
2951 | interpreted and rendered. The legal values for WHICH are as follows: | |
3c9b6116 AW |
2952 | |
2953 | `GLU_TESS_WINDING_RULE' | |
c7b31271 | 2954 | Determines which parts of the polygon are on the ``interior''. DATA |
3c9b6116 AW |
2955 | may be set to one of `GLU_TESS_WINDING_ODD', |
2956 | `GLU_TESS_WINDING_NONZERO', `GLU_TESS_WINDING_POSITIVE', | |
2957 | `GLU_TESS_WINDING_NEGATIVE', or `GLU_TESS_WINDING_ABS_GEQ_TWO'. | |
2958 | ||
2959 | To understand how the winding rule works, consider that the input | |
c7b31271 | 2960 | contours partition the plane into regions. The winding rule |
3c9b6116 AW |
2961 | determines which of these regions are inside the polygon. |
2962 | ||
2963 | For a single contour C, the winding number of a point x is simply | |
2964 | the signed number of revolutions we make around x as we travel once | |
c7b31271 DH |
2965 | around C (where CCW is positive). When there are several contours, |
2966 | the individual winding numbers are summed. This procedure | |
3c9b6116 AW |
2967 | associates a signed integer value with each point x in the plane. |
2968 | Note that the winding number is the same for all points in a single | |
2969 | region. | |
2970 | ||
2971 | The winding rule classifies a region as ``inside'' if its winding | |
2972 | number belongs to the chosen category (odd, nonzero, positive, | |
c7b31271 DH |
2973 | negative, or absolute value of at least two). The previous GLU |
2974 | tessellator (prior to GLU 1.2) used the ``odd'' rule. The | |
2975 | ``nonzero'' rule is another common way to define the interior. The | |
3c9b6116 AW |
2976 | other three rules are useful for polygon CSG operations. |
2977 | ||
2978 | `GLU_TESS_BOUNDARY_ONLY' | |
2979 | Is a boolean value (``value'' should be set to GL_TRUE or | |
c7b31271 DH |
2980 | GL_FALSE). When set to GL_TRUE, a set of closed contours |
2981 | separating the polygon interior and exterior are returned instead | |
2982 | of a tessellation. Exterior contours are oriented CCW with respect | |
2983 | to the normal; interior contours are oriented CW. The | |
2984 | `GLU_TESS_BEGIN' and `GLU_TESS_BEGIN_DATA' callbacks use the type | |
2985 | GL_LINE_LOOP for each contour. | |
3c9b6116 AW |
2986 | |
2987 | `GLU_TESS_TOLERANCE' | |
2988 | Specifies a tolerance for merging features to reduce the size of | |
c7b31271 DH |
2989 | the output. For example, two vertices that are very close to each |
2990 | other might be replaced by a single vertex. The tolerance is | |
3c9b6116 AW |
2991 | multiplied by the largest coordinate magnitude of any input vertex; |
2992 | this specifies the maximum distance that any feature can move as | |
c7b31271 | 2993 | the result of a single merge operation. If a single feature takes |
3c9b6116 AW |
2994 | part in several merge operations, the total distance moved could be |
2995 | larger. | |
2996 | ||
2997 | Feature merging is completely optional; the tolerance is only a | |
c7b31271 DH |
2998 | hint. The implementation is free to merge in some cases and not in |
2999 | others, or to never merge features at all. The initial tolerance | |
3000 | is 0. | |
3c9b6116 AW |
3001 | |
3002 | The current implementation merges vertices only if they are exactly | |
c7b31271 | 3003 | coincident, regardless of the current tolerance. A vertex is |
3c9b6116 | 3004 | spliced into an edge only if the implementation is unable to |
c7b31271 | 3005 | distinguish which side of the edge the vertex lies on. Two edges |
3c9b6116 | 3006 | are merged only when both endpoints are identical.") |
8925f36f | 3007 | |
25072f02 | 3008 | (define-glu-procedures |
bb894c9d | 3009 | ((gluTessVertex |
00239761 AW |
3010 | (tess GLUtesselator*) |
3011 | (location GLdouble-*) | |
3012 | (data GLvoid*) | |
bb894c9d AW |
3013 | -> |
3014 | void)) | |
3c9b6116 AW |
3015 | "Specify a vertex on a polygon. |
3016 | ||
3017 | TESS | |
3018 | Specifies the tessellation object (created with `gluNewTess'). | |
3019 | ||
3020 | LOCATION | |
3021 | Specifies the location of the vertex. | |
3022 | ||
3023 | DATA | |
3024 | Specifies an opaque pointer passed back to the program with the | |
3025 | vertex callback (as specified by `gluTessCallback'). | |
3026 | ||
3027 | `gluTessVertex' describes a vertex on a polygon that the program | |
c7b31271 DH |
3028 | defines. Successive `gluTessVertex' calls describe a closed contour. |
3029 | For example, to describe a quadrilateral, `gluTessVertex' should be | |
3030 | called four times. `gluTessVertex' can only be called between | |
3c9b6116 AW |
3031 | `gluTessBeginContour' and `gluTessEndContour'. |
3032 | ||
3033 | DATA normally points to a structure containing the vertex location, as | |
c7b31271 | 3034 | well as other per-vertex attributes such as color and normal. This |
3c9b6116 AW |
3035 | pointer is passed back to the user through the `GLU_TESS_VERTEX' or |
3036 | `GLU_TESS_VERTEX_DATA' callback after tessellation (see the | |
3037 | `gluTessCallback' reference page).") | |
8925f36f | 3038 | |
25072f02 | 3039 | (define-glu-procedures |
bb894c9d AW |
3040 | ((gluUnProject4 |
3041 | (winX GLdouble) | |
3042 | (winY GLdouble) | |
3043 | (winZ GLdouble) | |
3044 | (clipW GLdouble) | |
00239761 AW |
3045 | (model const-GLdouble-*) |
3046 | (proj const-GLdouble-*) | |
3047 | (view const-GLint-*) | |
bb894c9d AW |
3048 | (nearVal GLdouble) |
3049 | (farVal GLdouble) | |
00239761 AW |
3050 | (objX GLdouble*) |
3051 | (objY GLdouble*) | |
3052 | (objZ GLdouble*) | |
3053 | (objW GLdouble*) | |
bb894c9d AW |
3054 | -> |
3055 | GLint)) | |
3c9b6116 AW |
3056 | "Map window and clip coordinates to object coordinates. |
3057 | ||
3058 | WINX | |
3059 | WINY | |
3060 | ||
3061 | WINZ | |
3062 | ||
3063 | Specify the window coordinates to be mapped. | |
3064 | ||
3065 | CLIPW | |
3066 | Specify the clip w coordinate to be mapped. | |
3067 | ||
3068 | MODEL | |
3069 | Specifies the modelview matrix (as from a `glGetDoublev' call). | |
3070 | ||
3071 | PROJ | |
3072 | Specifies the projection matrix (as from a `glGetDoublev' call). | |
3073 | ||
3074 | VIEW | |
3075 | Specifies the viewport (as from a `glGetIntegerv' call). | |
3076 | ||
3077 | NEARVAL | |
3078 | FARVAL | |
3079 | ||
3080 | Specifies the near and far planes (as from a `glGetDoublev' call). | |
3081 | ||
3082 | OBJX | |
3083 | OBJY | |
3084 | ||
3085 | OBJZ | |
3086 | ||
3087 | OBJW | |
3088 | ||
3089 | Returns the computed object coordinates. | |
3090 | ||
3091 | `gluUnProject4' maps the specified window coordinatesi: WINX, WINY, and | |
3092 | WINZ and its clip w coordinate CLIPW into object coordinates | |
c7b31271 DH |
3093 | (OBJX,OBJYOBJZOBJW) using MODEL, PROJ, and VIEW. CLIPW can be other |
3094 | than 1 as for vertices in `glFeedbackBuffer' when data type | |
3095 | `GLU_4D_COLOR_TEXTURE' is returned. This also handles the case where | |
3096 | the NEARVAL and FARVAL planes are different from the default, 0 and 1, | |
3097 | respectively. A return value of `GLU_TRUE' indicates success; a return | |
3c9b6116 AW |
3098 | value of `GLU_FALSE' indicates failure. |
3099 | ||
3100 | To compute the coordinates (OBJX,OBJYOBJZOBJW) , `gluUnProject4' | |
3101 | multiplies the normalized device coordinates by the inverse of MODEL * | |
3102 | PROJ as follows: | |
3103 | ||
3104 | ((OBJX), (OBJY), (OBJZ), | |
3105 | (OBJW),)=INV\u2061(P\u2062M,)\u2062((2\u2061(WINX-VIEW\u2061[0,],),/VIEW\u2061[2,],-1), | |
3106 | (2\u2061(WINY-VIEW\u2061[1,],),/VIEW\u2061[3,],-1), | |
3107 | (2\u2061(WINZ-NEARVAL,),/(FARVAL-NEARVAL,),-1), (CLIPW),) | |
3108 | ||
3109 | INV denotes matrix inversion. | |
3110 | ||
3111 | `gluUnProject4' is equivalent to `gluUnProject' when CLIPW is 1, NEARVAL | |
3112 | is 0, and FARVAL is 1.") | |
8925f36f | 3113 | |
25072f02 | 3114 | (define-glu-procedures |
bb894c9d AW |
3115 | ((gluUnProject |
3116 | (winX GLdouble) | |
3117 | (winY GLdouble) | |
3118 | (winZ GLdouble) | |
00239761 AW |
3119 | (model const-GLdouble-*) |
3120 | (proj const-GLdouble-*) | |
3121 | (view const-GLint-*) | |
3122 | (objX GLdouble*) | |
3123 | (objY GLdouble*) | |
3124 | (objZ GLdouble*) | |
bb894c9d AW |
3125 | -> |
3126 | GLint)) | |
3c9b6116 AW |
3127 | "Map window coordinates to object coordinates. |
3128 | ||
3129 | WINX | |
3130 | WINY | |
3131 | ||
3132 | WINZ | |
3133 | ||
3134 | Specify the window coordinates to be mapped. | |
3135 | ||
3136 | MODEL | |
3137 | Specifies the modelview matrix (as from a `glGetDoublev' call). | |
3138 | ||
3139 | PROJ | |
3140 | Specifies the projection matrix (as from a `glGetDoublev' call). | |
3141 | ||
3142 | VIEW | |
3143 | Specifies the viewport (as from a `glGetIntegerv' call). | |
3144 | ||
3145 | OBJX | |
3146 | OBJY | |
3147 | ||
3148 | OBJZ | |
3149 | ||
3150 | Returns the computed object coordinates. | |
3151 | ||
3152 | `gluUnProject' maps the specified window coordinates into object | |
c7b31271 DH |
3153 | coordinates using MODEL, PROJ, and VIEW. The result is stored in OBJX, |
3154 | OBJY, and OBJZ. A return value of `GLU_TRUE' indicates success; a | |
3155 | return value of `GLU_FALSE' indicates failure. | |
3c9b6116 AW |
3156 | |
3157 | To compute the coordinates (OBJX,OBJYOBJZ) , `gluUnProject' multiplies | |
3158 | the normalized device coordinates by the inverse of MODEL * PROJ as | |
3159 | follows: | |
3160 | ||
3161 | ((OBJX), (OBJY), (OBJZ), | |
3162 | (W),)=INV\u2061(P\u2062M,)\u2062((2\u2061(WINX-VIEW\u2061[0,],),/VIEW\u2061[2,],-1), | |
3163 | (2\u2061(WINY-VIEW\u2061[1,],),/VIEW\u2061[3,],-1), (2\u2061(WINZ,)-1), (1),) INV denotes | |
c7b31271 | 3164 | matrix inversion. W is an unused variable, included for consistent |
3c9b6116 | 3165 | matrix notation.") |
8925f36f | 3166 |