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 | ;;; | |
8925f36f AW |
20 | ;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed |
21 | ;;; under the SGI Free Software B License. For details, see | |
22 | ;;; http://oss.sgi.com/projects/FreeB/ (http://oss.sgi.com/projects/FreeB/). | |
23 | ;;; | |
8925f36f AW |
24 | ;;; Copyright (C) 2003-2005 3Dlabs Inc. Ltd. This material may be |
25 | ;;; distributed subject to the terms and conditions set forth in the Open | |
26 | ;;; Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/ | |
27 | ;;; (http://opencontent.org/openpub/). | |
28 | ;;; | |
8925f36f AW |
29 | ;;; Copyright (C) 2005 Addison-Wesley. This material may be distributed |
30 | ;;; subject to the terms and conditions set forth in the Open Publication | |
31 | ;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/ | |
32 | ;;; (http://opencontent.org/openpub/). | |
33 | ;;; | |
8925f36f AW |
34 | ;;; Copyright (C) 2006 Khronos Group. This material may be distributed |
35 | ;;; subject to the terms and conditions set forth in the Open Publication | |
36 | ;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/ | |
37 | ;;; (http://opencontent.org/openpub/). | |
38 | ;;; | |
39 | ;;; Automatically generated; you probably don't want to edit this. To | |
40 | ;;; update, run "make update" in the top-level build tree. | |
41 | ;;; | |
42 | ||
43 | (define-module | |
44 | (figl low-level gl) | |
45 | #:use-module | |
46 | (figl low-level support) | |
47 | #:export | |
48 | (glAccum | |
49 | glActiveTexture | |
50 | glAlphaFunc | |
51 | glAreTexturesResident | |
52 | glArrayElement | |
53 | glAttachShader | |
54 | glBeginQuery | |
bb894c9d | 55 | glEndQuery |
8925f36f | 56 | glBegin |
bb894c9d | 57 | glEnd |
8925f36f AW |
58 | glBindAttribLocation |
59 | glBindBuffer | |
60 | glBindTexture | |
61 | glBitmap | |
62 | glBlendColor | |
63 | glBlendEquationSeparate | |
64 | glBlendEquation | |
65 | glBlendFuncSeparate | |
66 | glBlendFunc | |
67 | glBufferData | |
68 | glBufferSubData | |
69 | glCallLists | |
70 | glCallList | |
71 | glClearAccum | |
72 | glClearColor | |
73 | glClearDepth | |
74 | glClearIndex | |
75 | glClearStencil | |
76 | glClear | |
77 | glClientActiveTexture | |
78 | glClipPlane | |
79 | glColorMask | |
80 | glColorMaterial | |
81 | glColorPointer | |
82 | glColorSubTable | |
8925f36f | 83 | glColorTable |
bb894c9d AW |
84 | glColor3i |
85 | glColor3d | |
86 | glColor3ui | |
87 | glColor4i | |
88 | glColor4d | |
89 | glColor4ui | |
8925f36f AW |
90 | glCompileShader |
91 | glCompressedTexImage1D | |
92 | glCompressedTexImage2D | |
93 | glCompressedTexImage3D | |
94 | glCompressedTexSubImage1D | |
95 | glCompressedTexSubImage2D | |
96 | glCompressedTexSubImage3D | |
97 | glConvolutionFilter1D | |
98 | glConvolutionFilter2D | |
bb894c9d AW |
99 | glConvolutionParameterf |
100 | glConvolutionParameteri | |
8925f36f AW |
101 | glCopyColorSubTable |
102 | glCopyColorTable | |
103 | glCopyConvolutionFilter1D | |
104 | glCopyConvolutionFilter2D | |
105 | glCopyPixels | |
106 | glCopyTexImage1D | |
107 | glCopyTexImage2D | |
108 | glCopyTexSubImage1D | |
109 | glCopyTexSubImage2D | |
110 | glCopyTexSubImage3D | |
111 | glCreateProgram | |
112 | glCreateShader | |
113 | glCullFace | |
114 | glDeleteBuffers | |
115 | glDeleteLists | |
116 | glDeleteProgram | |
117 | glDeleteQueries | |
118 | glDeleteShader | |
119 | glDeleteTextures | |
120 | glDepthFunc | |
121 | glDepthMask | |
122 | glDepthRange | |
123 | glDetachShader | |
124 | glDrawArrays | |
125 | glDrawBuffers | |
126 | glDrawBuffer | |
127 | glDrawElements | |
128 | glDrawPixels | |
129 | glDrawRangeElements | |
130 | glEdgeFlagPointer | |
131 | glEdgeFlag | |
132 | glEnableClientState | |
bb894c9d | 133 | glDisableClientState |
8925f36f | 134 | glEnableVertexAttribArray |
bb894c9d | 135 | glDisableVertexAttribArray |
8925f36f | 136 | glEnable |
bb894c9d AW |
137 | glDisable |
138 | glEvalCoord1d | |
139 | glEvalCoord2d | |
140 | glEvalMesh1 | |
141 | glEvalMesh2 | |
142 | glEvalPoint1 | |
143 | glEvalPoint2 | |
8925f36f AW |
144 | glFeedbackBuffer |
145 | glFinish | |
146 | glFlush | |
147 | glFogCoordPointer | |
bb894c9d AW |
148 | glFogCoordd |
149 | glFogf | |
150 | glFogi | |
8925f36f AW |
151 | glFrontFace |
152 | glFrustum | |
153 | glGenBuffers | |
154 | glGenLists | |
155 | glGenQueries | |
156 | glGenTextures | |
157 | glGetActiveAttrib | |
158 | glGetActiveUniform | |
159 | glGetAttachedShaders | |
160 | glGetAttribLocation | |
8925f36f AW |
161 | glGetBufferSubData |
162 | glGetClipPlane | |
8925f36f AW |
163 | glGetColorTable |
164 | glGetCompressedTexImage | |
165 | glGetConvolutionFilter | |
8925f36f | 166 | glGetError |
8925f36f | 167 | glGetHistogram |
8925f36f | 168 | glGetMinmax |
8925f36f AW |
169 | glGetPolygonStipple |
170 | glGetProgramInfoLog | |
8925f36f AW |
171 | glGetSeparableFilter |
172 | glGetShaderInfoLog | |
173 | glGetShaderSource | |
8925f36f | 174 | glGetString |
8925f36f | 175 | glGetTexImage |
8925f36f | 176 | glGetUniformLocation |
8925f36f AW |
177 | glHint |
178 | glHistogram | |
179 | glIndexMask | |
180 | glIndexPointer | |
bb894c9d AW |
181 | glIndexi |
182 | glIndexd | |
183 | glIndexub | |
8925f36f AW |
184 | glInitNames |
185 | glInterleavedArrays | |
186 | glIsBuffer | |
187 | glIsEnabled | |
188 | glIsList | |
189 | glIsProgram | |
190 | glIsQuery | |
191 | glIsShader | |
192 | glIsTexture | |
bb894c9d AW |
193 | glLightModelf |
194 | glLightModeli | |
195 | glLightf | |
196 | glLighti | |
8925f36f AW |
197 | glLineStipple |
198 | glLineWidth | |
199 | glLinkProgram | |
200 | glListBase | |
201 | glLoadIdentity | |
bb894c9d | 202 | glLoadMatrixd |
8925f36f | 203 | glLoadName |
bb894c9d | 204 | glLoadTransposeMatrixd |
8925f36f | 205 | glLogicOp |
bb894c9d AW |
206 | glMap1d |
207 | glMap2d | |
8925f36f | 208 | glMapBuffer |
bb894c9d AW |
209 | glUnmapBuffer |
210 | glMapGrid1d | |
211 | glMapGrid2d | |
212 | glMaterialf | |
213 | glMateriali | |
8925f36f AW |
214 | glMatrixMode |
215 | glMinmax | |
216 | glMultiDrawArrays | |
217 | glMultiDrawElements | |
bb894c9d AW |
218 | glMultiTexCoord1i |
219 | glMultiTexCoord1d | |
220 | glMultiTexCoord2i | |
221 | glMultiTexCoord2d | |
222 | glMultiTexCoord3i | |
223 | glMultiTexCoord3d | |
224 | glMultiTexCoord4i | |
225 | glMultiTexCoord4d | |
226 | glMultMatrixd | |
227 | glMultTransposeMatrixd | |
8925f36f | 228 | glNewList |
bb894c9d | 229 | glEndList |
8925f36f | 230 | glNormalPointer |
bb894c9d AW |
231 | glNormal3d |
232 | glNormal3i | |
8925f36f AW |
233 | glOrtho |
234 | glPassThrough | |
bb894c9d AW |
235 | glPixelStoref |
236 | glPixelStorei | |
237 | glPixelTransferf | |
238 | glPixelTransferi | |
8925f36f | 239 | glPixelZoom |
bb894c9d AW |
240 | glPointParameterf |
241 | glPointParameteri | |
8925f36f AW |
242 | glPointSize |
243 | glPolygonMode | |
244 | glPolygonOffset | |
245 | glPolygonStipple | |
246 | glPrioritizeTextures | |
247 | glPushAttrib | |
bb894c9d | 248 | glPopAttrib |
8925f36f | 249 | glPushClientAttrib |
bb894c9d | 250 | glPopClientAttrib |
8925f36f | 251 | glPushMatrix |
bb894c9d | 252 | glPopMatrix |
8925f36f | 253 | glPushName |
bb894c9d AW |
254 | glPopName |
255 | glRasterPos2i | |
256 | glRasterPos2d | |
257 | glRasterPos3i | |
258 | glRasterPos3d | |
259 | glRasterPos4i | |
260 | glRasterPos4d | |
8925f36f AW |
261 | glReadBuffer |
262 | glReadPixels | |
bb894c9d AW |
263 | glRectd |
264 | glRecti | |
8925f36f AW |
265 | glRenderMode |
266 | glResetHistogram | |
267 | glResetMinmax | |
bb894c9d | 268 | glRotated |
8925f36f | 269 | glSampleCoverage |
bb894c9d | 270 | glScaled |
8925f36f AW |
271 | glScissor |
272 | glSecondaryColorPointer | |
bb894c9d AW |
273 | glSecondaryColor3i |
274 | glSecondaryColor3d | |
275 | glSecondaryColor3ui | |
8925f36f AW |
276 | glSelectBuffer |
277 | glSeparableFilter2D | |
278 | glShadeModel | |
279 | glShaderSource | |
280 | glStencilFuncSeparate | |
281 | glStencilFunc | |
282 | glStencilMaskSeparate | |
283 | glStencilMask | |
284 | glStencilOpSeparate | |
285 | glStencilOp | |
286 | glTexCoordPointer | |
bb894c9d AW |
287 | glTexCoord1i |
288 | glTexCoord1d | |
289 | glTexCoord2i | |
290 | glTexCoord2d | |
291 | glTexCoord3i | |
292 | glTexCoord3d | |
293 | glTexCoord4i | |
294 | glTexCoord4d | |
295 | glTexEnvf | |
296 | glTexEnvi | |
297 | glTexGeni | |
298 | glTexGend | |
8925f36f AW |
299 | glTexImage1D |
300 | glTexImage2D | |
301 | glTexImage3D | |
bb894c9d AW |
302 | glTexParameterf |
303 | glTexParameteri | |
8925f36f AW |
304 | glTexSubImage1D |
305 | glTexSubImage2D | |
306 | glTexSubImage3D | |
bb894c9d | 307 | glTranslated |
8925f36f | 308 | glUniform1f |
bb894c9d AW |
309 | glUniform2f |
310 | glUniform3f | |
311 | glUniform4f | |
312 | glUniform1i | |
313 | glUniform2i | |
314 | glUniform3i | |
315 | glUniform4i | |
8925f36f AW |
316 | glUseProgram |
317 | glValidateProgram | |
318 | glVertexAttribPointer | |
bb894c9d AW |
319 | glVertexAttrib1s |
320 | glVertexAttrib1d | |
321 | glVertexAttrib2s | |
322 | glVertexAttrib2d | |
323 | glVertexAttrib3s | |
324 | glVertexAttrib3d | |
325 | glVertexAttrib4s | |
326 | glVertexAttrib4d | |
327 | glVertexAttrib4Nub | |
8925f36f | 328 | glVertexPointer |
bb894c9d AW |
329 | glVertex2i |
330 | glVertex2d | |
331 | glVertex3i | |
332 | glVertex3d | |
333 | glVertex4i | |
334 | glVertex4d | |
8925f36f | 335 | glViewport |
bb894c9d AW |
336 | glWindowPos2i |
337 | glWindowPos2d | |
338 | glWindowPos3i | |
339 | glWindowPos3d)) | |
8925f36f AW |
340 | |
341 | (define-gl-procedure | |
bb894c9d | 342 | ((glAccum (op GLenum) (value GLfloat) -> void)) |
3c9b6116 AW |
343 | "Operate on the accumulation buffer. |
344 | ||
345 | OP | |
346 | Specifies the accumulation buffer operation. Symbolic constants | |
347 | `GL_ACCUM', `GL_LOAD', `GL_ADD', `GL_MULT', and `GL_RETURN' are | |
348 | accepted. | |
349 | ||
350 | VALUE | |
351 | Specifies a floating-point value used in the accumulation buffer | |
352 | operation. OP determines how VALUE is used. | |
353 | ||
354 | The accumulation buffer is an extended-range color buffer. Images are | |
355 | not rendered into it. Rather, images rendered into one of the color | |
356 | buffers are added to the contents of the accumulation buffer after | |
357 | rendering. Effects such as antialiasing (of points, lines, and | |
358 | polygons), motion blur, and depth of field can be created by | |
359 | accumulating images generated with different transformation matrices. | |
360 | ||
361 | Each pixel in the accumulation buffer consists of red, green, blue, and | |
362 | alpha values. The number of bits per component in the accumulation | |
363 | buffer depends on the implementation. You can examine this number by | |
364 | calling `glGetIntegerv' four times, with arguments `GL_ACCUM_RED_BITS', | |
365 | `GL_ACCUM_GREEN_BITS', `GL_ACCUM_BLUE_BITS', and `GL_ACCUM_ALPHA_BITS'. | |
366 | Regardless of the number of bits per component, the range of values | |
367 | stored by each component is [-1,1] . The accumulation buffer pixels are | |
368 | mapped one-to-one with frame buffer pixels. | |
369 | ||
370 | `glAccum' operates on the accumulation buffer. The first argument, OP, | |
371 | is a symbolic constant that selects an accumulation buffer operation. | |
372 | The second argument, VALUE, is a floating-point value to be used in that | |
373 | operation. Five operations are specified: `GL_ACCUM', `GL_LOAD', | |
374 | `GL_ADD', `GL_MULT', and `GL_RETURN'. | |
375 | ||
376 | All accumulation buffer operations are limited to the area of the | |
377 | current scissor box and applied identically to the red, green, blue, and | |
378 | alpha components of each pixel. If a `glAccum' operation results in a | |
379 | value outside the range [-1,1] , the contents of an accumulation buffer | |
380 | pixel component are undefined. | |
381 | ||
382 | The operations are as follows: | |
383 | ||
384 | `GL_ACCUM' | |
385 | Obtains R, G, B, and A values from the buffer currently selected | |
386 | for reading (see `glReadBuffer'). Each component value is divided | |
387 | by 2^N-1 , where N is the number of bits allocated to each color | |
388 | component in the currently selected buffer. The result is a | |
389 | floating-point value in the range [0,1] , which is multiplied by | |
390 | VALUE and added to the corresponding pixel component in the | |
391 | accumulation buffer, thereby updating the accumulation buffer. | |
392 | ||
393 | `GL_LOAD' | |
394 | Similar to `GL_ACCUM', except that the current value in the | |
395 | accumulation buffer is not used in the calculation of the new | |
396 | value. That is, the R, G, B, and A values from the currently | |
397 | selected buffer are divided by 2^N-1 , multiplied by VALUE, and | |
398 | then stored in the corresponding accumulation buffer cell, | |
399 | overwriting the current value. | |
400 | ||
401 | `GL_ADD' | |
402 | Adds VALUE to each R, G, B, and A in the accumulation buffer. | |
403 | ||
404 | `GL_MULT' | |
405 | Multiplies each R, G, B, and A in the accumulation buffer by VALUE | |
406 | and returns the scaled component to its corresponding accumulation | |
407 | buffer location. | |
408 | ||
409 | `GL_RETURN' | |
410 | Transfers accumulation buffer values to the color buffer or buffers | |
411 | currently selected for writing. Each R, G, B, and A component is | |
412 | multiplied by VALUE, then multiplied by 2^N-1 , clamped to the | |
413 | range [0,2^N-1] , and stored in the corresponding display buffer | |
414 | cell. The only fragment operations that are applied to this | |
415 | transfer are pixel ownership, scissor, dithering, and color | |
416 | writemasks. | |
417 | ||
418 | To clear the accumulation buffer, call `glClearAccum' with R, G, B, and | |
419 | A values to set it to, then call `glClear' with the accumulation buffer | |
420 | enabled. | |
421 | ||
422 | `GL_INVALID_ENUM' is generated if OP is not an accepted value. | |
423 | ||
424 | `GL_INVALID_OPERATION' is generated if there is no accumulation buffer. | |
425 | ||
426 | `GL_INVALID_OPERATION' is generated if `glAccum' is executed between the | |
427 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
428 | |
429 | (define-gl-procedure | |
bb894c9d | 430 | ((glActiveTexture (texture GLenum) -> void)) |
3c9b6116 AW |
431 | "Select active texture unit. |
432 | ||
433 | TEXTURE | |
434 | Specifies which texture unit to make active. The number of texture | |
435 | units is implementation dependent, but must be at least two. | |
436 | TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to | |
437 | the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and | |
438 | (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1). The initial value is | |
439 | `GL_TEXTURE0'. | |
440 | ||
441 | `glActiveTexture' selects which texture unit subsequent texture state | |
442 | calls will affect. The number of texture units an implementation | |
443 | supports is implementation dependent, but must be at least 2. | |
444 | ||
445 | Vertex arrays are client-side GL resources, which are selected by the | |
446 | `glClientActiveTexture' routine. | |
447 | ||
448 | `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I , | |
449 | where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and | |
450 | (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).") | |
8925f36f AW |
451 | |
452 | (define-gl-procedure | |
bb894c9d AW |
453 | ((glAlphaFunc |
454 | (func GLenum) | |
455 | (ref GLclampf) | |
456 | -> | |
457 | void)) | |
3c9b6116 AW |
458 | "Specify the alpha test function. |
459 | ||
460 | FUNC | |
461 | Specifies the alpha comparison function. Symbolic constants | |
462 | `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER', | |
463 | `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The | |
464 | initial value is `GL_ALWAYS'. | |
465 | ||
466 | REF | |
467 | Specifies the reference value that incoming alpha values are | |
468 | compared to. This value is clamped to the range [0,1] , where 0 | |
469 | represents the lowest possible alpha value and 1 the highest | |
470 | possible value. The initial reference value is 0. | |
471 | ||
472 | The alpha test discards fragments depending on the outcome of a | |
473 | comparison between an incoming fragment's alpha value and a constant | |
474 | reference value. `glAlphaFunc' specifies the reference value and the | |
475 | comparison function. The comparison is performed only if alpha testing | |
476 | is enabled. By default, it is not enabled. (See `glEnable' and | |
477 | `glDisable' of `GL_ALPHA_TEST'.) | |
478 | ||
479 | FUNC and REF specify the conditions under which the pixel is drawn. The | |
480 | incoming alpha value is compared to REF using the function specified by | |
481 | FUNC. If the value passes the comparison, the incoming fragment is drawn | |
482 | if it also passes subsequent stencil and depth buffer tests. If the | |
483 | value fails the comparison, no change is made to the frame buffer at | |
484 | that pixel location. The comparison functions are as follows: | |
485 | ||
486 | `GL_NEVER' | |
487 | Never passes. | |
488 | ||
489 | `GL_LESS' | |
490 | Passes if the incoming alpha value is less than the reference | |
491 | value. | |
492 | ||
493 | `GL_EQUAL' | |
494 | Passes if the incoming alpha value is equal to the reference value. | |
495 | ||
496 | `GL_LEQUAL' | |
497 | Passes if the incoming alpha value is less than or equal to the | |
498 | reference value. | |
499 | ||
500 | `GL_GREATER' | |
501 | Passes if the incoming alpha value is greater than the reference | |
502 | value. | |
503 | ||
504 | `GL_NOTEQUAL' | |
505 | Passes if the incoming alpha value is not equal to the reference | |
506 | value. | |
507 | ||
508 | `GL_GEQUAL' | |
509 | Passes if the incoming alpha value is greater than or equal to the | |
510 | reference value. | |
511 | ||
512 | `GL_ALWAYS' | |
513 | Always passes (initial value). | |
514 | ||
515 | `glAlphaFunc' operates on all pixel write operations, including those | |
516 | resulting from the scan conversion of points, lines, polygons, and | |
517 | bitmaps, and from pixel draw and copy operations. `glAlphaFunc' does not | |
518 | affect screen clear operations. | |
519 | ||
520 | `GL_INVALID_ENUM' is generated if FUNC is not an accepted value. | |
521 | ||
522 | `GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between | |
523 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
524 | |
525 | (define-gl-procedure | |
bb894c9d AW |
526 | ((glAreTexturesResident |
527 | (n GLsizei) | |
528 | (textures *) | |
529 | (residences *) | |
530 | -> | |
531 | GLboolean)) | |
3c9b6116 AW |
532 | "Determine if textures are loaded in texture memory. |
533 | ||
534 | N | |
535 | Specifies the number of textures to be queried. | |
536 | ||
537 | TEXTURES | |
538 | Specifies an array containing the names of the textures to be | |
539 | queried. | |
540 | ||
541 | RESIDENCES | |
542 | Specifies an array in which the texture residence status is | |
543 | returned. The residence status of a texture named by an element of | |
544 | TEXTURES is returned in the corresponding element of RESIDENCES. | |
545 | ||
546 | GL establishes a ``working set'' of textures that are resident in | |
547 | texture memory. These textures can be bound to a texture target much | |
548 | more efficiently than textures that are not resident. | |
549 | ||
550 | `glAreTexturesResident' queries the texture residence status of the N | |
551 | textures named by the elements of TEXTURES. If all the named textures | |
552 | are resident, `glAreTexturesResident' returns `GL_TRUE', and the | |
553 | contents of RESIDENCES are undisturbed. If not all the named textures | |
554 | are resident, `glAreTexturesResident' returns `GL_FALSE', and detailed | |
555 | status is returned in the N elements of RESIDENCES. If an element of | |
556 | RESIDENCES is `GL_TRUE', then the texture named by the corresponding | |
557 | element of TEXTURES is resident. | |
558 | ||
559 | The residence status of a single bound texture may also be queried by | |
560 | calling `glGetTexParameter' with the TARGET argument set to the target | |
561 | to which the texture is bound, and the PNAME argument set to | |
562 | `GL_TEXTURE_RESIDENT'. This is the only way that the residence status of | |
563 | a default texture can be queried. | |
564 | ||
565 | `GL_INVALID_VALUE' is generated if N is negative. | |
566 | ||
567 | `GL_INVALID_VALUE' is generated if any element in TEXTURES is 0 or does | |
568 | not name a texture. In that case, the function returns `GL_FALSE' and | |
569 | the contents of RESIDENCES is indeterminate. | |
570 | ||
571 | `GL_INVALID_OPERATION' is generated if `glAreTexturesResident' is | |
572 | executed between the execution of `glBegin' and the corresponding | |
573 | execution of `glEnd'.") | |
8925f36f AW |
574 | |
575 | (define-gl-procedure | |
bb894c9d | 576 | ((glArrayElement (i GLint) -> void)) |
3c9b6116 AW |
577 | "Render a vertex using the specified vertex array element. |
578 | ||
579 | I | |
580 | Specifies an index into the enabled vertex data arrays. | |
581 | ||
582 | `glArrayElement' commands are used within `glBegin'/`glEnd' pairs to | |
583 | specify vertex and attribute data for point, line, and polygon | |
584 | primitives. If `GL_VERTEX_ARRAY' is enabled when `glArrayElement' is | |
585 | called, a single vertex is drawn, using vertex and attribute data taken | |
586 | from location I of the enabled arrays. If `GL_VERTEX_ARRAY' is not | |
587 | enabled, no drawing occurs but the attributes corresponding to the | |
588 | enabled arrays are modified. | |
589 | ||
590 | Use `glArrayElement' to construct primitives by indexing vertex data, | |
591 | rather than by streaming through arrays of data in first-to-last order. | |
592 | Because each call specifies only a single vertex, it is possible to | |
593 | explicitly specify per-primitive attributes such as a single normal for | |
594 | each triangle. | |
595 | ||
596 | Changes made to array data between the execution of `glBegin' and the | |
597 | corresponding execution of `glEnd' may affect calls to `glArrayElement' | |
598 | that are made within the same `glBegin'/`glEnd' period in nonsequential | |
599 | ways. That is, a call to `glArrayElement' that precedes a change to | |
600 | array data may access the changed data, and a call that follows a change | |
601 | to array data may access original data. | |
602 | ||
603 | `GL_INVALID_VALUE' may be generated if I is negative. | |
604 | ||
605 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
606 | bound to an enabled array and the buffer object's data store is | |
607 | currently mapped.") | |
8925f36f AW |
608 | |
609 | (define-gl-procedure | |
bb894c9d AW |
610 | ((glAttachShader |
611 | (program GLuint) | |
612 | (shader GLuint) | |
613 | -> | |
614 | void)) | |
3c9b6116 AW |
615 | "Attaches a shader object to a program object. |
616 | ||
617 | PROGRAM | |
618 | Specifies the program object to which a shader object will be | |
619 | attached. | |
620 | ||
621 | SHADER | |
622 | Specifies the shader object that is to be attached. | |
623 | ||
624 | In order to create an executable, there must be a way to specify the | |
625 | list of things that will be linked together. Program objects provide | |
626 | this mechanism. Shaders that are to be linked together in a program | |
627 | object must first be attached to that program object. `glAttachShader' | |
628 | attaches the shader object specified by SHADER to the program object | |
629 | specified by PROGRAM. This indicates that SHADER will be included in | |
630 | link operations that will be performed on PROGRAM. | |
631 | ||
632 | All operations that can be performed on a shader object are valid | |
633 | whether or not the shader object is attached to a program object. It is | |
634 | permissible to attach a shader object to a program object before source | |
635 | code has been loaded into the shader object or before the shader object | |
636 | has been compiled. It is permissible to attach multiple shader objects | |
637 | of the same type because each may contain a portion of the complete | |
638 | shader. It is also permissible to attach a shader object to more than | |
639 | one program object. If a shader object is deleted while it is attached | |
640 | to a program object, it will be flagged for deletion, and deletion will | |
641 | not occur until `glDetachShader' is called to detach it from all program | |
642 | objects to which it is attached. | |
643 | ||
644 | `GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is not a | |
645 | value generated by OpenGL. | |
646 | ||
647 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
648 | ||
649 | `GL_INVALID_OPERATION' is generated if SHADER is not a shader object. | |
650 | ||
651 | `GL_INVALID_OPERATION' is generated if SHADER is already attached to | |
652 | PROGRAM. | |
653 | ||
654 | `GL_INVALID_OPERATION' is generated if `glAttachShader' is executed | |
655 | between the execution of `glBegin' and the corresponding execution of | |
656 | `glEnd'.") | |
8925f36f AW |
657 | |
658 | (define-gl-procedure | |
bb894c9d AW |
659 | ((glBeginQuery |
660 | (target GLenum) | |
661 | (id GLuint) | |
662 | -> | |
663 | void) | |
664 | (glEndQuery (target GLenum) -> void)) | |
3c9b6116 AW |
665 | "Delimit the boundaries of a query object. |
666 | ||
667 | TARGET | |
668 | Specifies the target type of query object established between | |
669 | `glBeginQuery' and the subsequent `glEndQuery'. The symbolic | |
670 | constant must be `GL_SAMPLES_PASSED'. | |
671 | ||
672 | ID | |
673 | Specifies the name of a query object. | |
674 | ||
675 | `glBeginQuery' and `glEndQuery' delimit the boundaries of a query | |
676 | object. If a query object with name ID does not yet exist it is created. | |
677 | ||
678 | When `glBeginQuery' is executed, the query object's samples-passed | |
679 | counter is reset to 0. Subsequent rendering will increment the counter | |
680 | once for every sample that passes the depth test. When `glEndQuery' is | |
681 | executed, the samples-passed counter is assigned to the query object's | |
682 | result value. This value can be queried by calling `glGetQueryObject' | |
683 | with PNAME`GL_QUERY_RESULT'. | |
684 | ||
685 | Querying the `GL_QUERY_RESULT' implicitly flushes the GL pipeline until | |
686 | the rendering delimited by the query object has completed and the result | |
687 | is available. `GL_QUERY_RESULT_AVAILABLE' can be queried to determine if | |
688 | the result is immediately available or if the rendering is not yet | |
689 | complete. | |
690 | ||
691 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_SAMPLES_PASSED'. | |
692 | ||
693 | `GL_INVALID_OPERATION' is generated if `glBeginQuery' is executed while | |
694 | a query object of the same TARGET is already active. | |
695 | ||
696 | `GL_INVALID_OPERATION' is generated if `glEndQuery' is executed when a | |
697 | query object of the same TARGET is not active. | |
698 | ||
699 | `GL_INVALID_OPERATION' is generated if ID is 0. | |
700 | ||
701 | `GL_INVALID_OPERATION' is generated if ID is the name of an already | |
702 | active query object. | |
703 | ||
704 | `GL_INVALID_OPERATION' is generated if `glBeginQuery' or `glEndQuery' is | |
705 | executed between the execution of `glBegin' and the corresponding | |
706 | execution of `glEnd'.") | |
8925f36f AW |
707 | |
708 | (define-gl-procedure | |
bb894c9d | 709 | ((glBegin (mode GLenum) -> void) (glEnd -> void)) |
3c9b6116 AW |
710 | "Delimit the vertices of a primitive or a group of like primitives. |
711 | ||
712 | MODE | |
713 | Specifies the primitive or primitives that will be created from | |
714 | vertices presented between `glBegin' and the subsequent `glEnd'. | |
715 | Ten symbolic constants are accepted: `GL_POINTS', `GL_LINES', | |
716 | `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_TRIANGLES', | |
717 | `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_QUADS', | |
718 | `GL_QUAD_STRIP', and `GL_POLYGON'. | |
719 | ||
720 | `glBegin' and `glEnd' delimit the vertices that define a primitive or a | |
721 | group of like primitives. `glBegin' accepts a single argument that | |
722 | specifies in which of ten ways the vertices are interpreted. Taking N as | |
723 | an integer count starting at one, and N as the total number of vertices | |
724 | specified, the interpretations are as follows: | |
725 | ||
726 | `GL_POINTS' | |
727 | Treats each vertex as a single point. Vertex N defines point N . N | |
728 | points are drawn. | |
729 | ||
730 | `GL_LINES' | |
731 | Treats each pair of vertices as an independent line segment. | |
732 | Vertices 2\u2062N-1 and 2\u2062N define line N . N/2 lines are drawn. | |
733 | ||
734 | `GL_LINE_STRIP' | |
735 | Draws a connected group of line segments from the first vertex to | |
736 | the last. Vertices N and N+1 define line N . N-1 lines are drawn. | |
737 | ||
738 | `GL_LINE_LOOP' | |
739 | Draws a connected group of line segments from the first vertex to | |
740 | the last, then back to the first. Vertices N and N+1 define line N | |
741 | . The last line, however, is defined by vertices N and 1 . N lines | |
742 | are drawn. | |
743 | ||
744 | `GL_TRIANGLES' | |
745 | Treats each triplet of vertices as an independent triangle. | |
746 | Vertices 3\u2062N-2 , 3\u2062N-1 , and 3\u2062N define triangle N . N/3 triangles | |
747 | are drawn. | |
748 | ||
749 | `GL_TRIANGLE_STRIP' | |
750 | Draws a connected group of triangles. One triangle is defined for | |
751 | each vertex presented after the first two vertices. For odd N , | |
752 | vertices N , N+1 , and N+2 define triangle N . For even N , | |
753 | vertices N+1 , N , and N+2 define triangle N . N-2 triangles are | |
754 | drawn. | |
755 | ||
756 | `GL_TRIANGLE_FAN' | |
757 | Draws a connected group of triangles. One triangle is defined for | |
758 | each vertex presented after the first two vertices. Vertices 1 , | |
759 | N+1 , and N+2 define triangle N . N-2 triangles are drawn. | |
760 | ||
761 | `GL_QUADS' | |
762 | Treats each group of four vertices as an independent quadrilateral. | |
763 | Vertices 4\u2062N-3 , 4\u2062N-2 , 4\u2062N-1 , and 4\u2062N define quadrilateral N . | |
764 | N/4 quadrilaterals are drawn. | |
765 | ||
766 | `GL_QUAD_STRIP' | |
767 | Draws a connected group of quadrilaterals. One quadrilateral is | |
768 | defined for each pair of vertices presented after the first pair. | |
769 | Vertices 2\u2062N-1 , 2\u2062N , 2\u2062N+2 , and 2\u2062N+1 define quadrilateral N . | |
770 | N/2-1 quadrilaterals are drawn. Note that the order in which | |
771 | vertices are used to construct a quadrilateral from strip data is | |
772 | different from that used with independent data. | |
773 | ||
774 | `GL_POLYGON' | |
775 | Draws a single, convex polygon. Vertices 1 through N define this | |
776 | polygon. | |
777 | ||
778 | Only a subset of GL commands can be used between `glBegin' and `glEnd'. | |
779 | The commands are `glVertex', `glColor', `glSecondaryColor', `glIndex', | |
780 | `glNormal', `glFogCoord', `glTexCoord', `glMultiTexCoord', | |
781 | `glVertexAttrib', `glEvalCoord', `glEvalPoint', `glArrayElement', | |
782 | `glMaterial', and `glEdgeFlag'. Also, it is acceptable to use | |
783 | `glCallList' or `glCallLists' to execute display lists that include only | |
784 | the preceding commands. If any other GL command is executed between | |
785 | `glBegin' and `glEnd', the error flag is set and the command is ignored. | |
786 | ||
787 | Regardless of the value chosen for MODE, there is no limit to the number | |
788 | of vertices that can be defined between `glBegin' and `glEnd'. Lines, | |
789 | triangles, quadrilaterals, and polygons that are incompletely specified | |
790 | are not drawn. Incomplete specification results when either too few | |
791 | vertices are provided to specify even a single primitive or when an | |
792 | incorrect multiple of vertices is specified. The incomplete primitive is | |
793 | ignored; the rest are drawn. | |
794 | ||
795 | The minimum specification of vertices for each primitive is as follows: | |
796 | 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral, | |
797 | and 3 for a polygon. Modes that require a certain multiple of vertices | |
798 | are `GL_LINES' (2), `GL_TRIANGLES' (3), `GL_QUADS' (4), and | |
799 | `GL_QUAD_STRIP' (2). | |
800 | ||
801 | `GL_INVALID_ENUM' is generated if MODE is set to an unaccepted value. | |
802 | ||
803 | `GL_INVALID_OPERATION' is generated if `glBegin' is executed between a | |
804 | `glBegin' and the corresponding execution of `glEnd'. | |
805 | ||
806 | `GL_INVALID_OPERATION' is generated if `glEnd' is executed without being | |
807 | preceded by a `glBegin'. | |
808 | ||
809 | `GL_INVALID_OPERATION' is generated if a command other than `glVertex', | |
810 | `glColor', `glSecondaryColor', `glIndex', `glNormal', `glFogCoord', | |
811 | `glTexCoord', `glMultiTexCoord', `glVertexAttrib', `glEvalCoord', | |
812 | `glEvalPoint', `glArrayElement', `glMaterial', `glEdgeFlag', | |
813 | `glCallList', or `glCallLists' is executed between the execution of | |
814 | `glBegin' and the corresponding execution `glEnd'. | |
815 | ||
816 | Execution of `glEnableClientState', `glDisableClientState', | |
817 | `glEdgeFlagPointer', `glFogCoordPointer', `glTexCoordPointer', | |
818 | `glColorPointer', `glSecondaryColorPointer', `glIndexPointer', | |
819 | `glNormalPointer', `glVertexPointer', `glVertexAttribPointer', | |
820 | `glInterleavedArrays', or `glPixelStore' is not allowed after a call to | |
821 | `glBegin' and before the corresponding call to `glEnd', but an error may | |
822 | or may not be generated.") | |
8925f36f AW |
823 | |
824 | (define-gl-procedure | |
bb894c9d AW |
825 | ((glBindAttribLocation |
826 | (program GLuint) | |
827 | (index GLuint) | |
828 | (name *) | |
829 | -> | |
830 | void)) | |
3c9b6116 AW |
831 | "Associates a generic vertex attribute index with a named attribute |
832 | variable. | |
833 | ||
834 | PROGRAM | |
835 | Specifies the handle of the program object in which the association | |
836 | is to be made. | |
837 | ||
838 | INDEX | |
839 | Specifies the index of the generic vertex attribute to be bound. | |
840 | ||
841 | NAME | |
842 | Specifies a null terminated string containing the name of the | |
843 | vertex shader attribute variable to which INDEX is to be bound. | |
844 | ||
845 | `glBindAttribLocation' is used to associate a user-defined attribute | |
846 | variable in the program object specified by PROGRAM with a generic | |
847 | vertex attribute index. The name of the user-defined attribute variable | |
848 | is passed as a null terminated string in NAME. The generic vertex | |
849 | attribute index to be bound to this variable is specified by INDEX. When | |
850 | PROGRAM is made part of current state, values provided via the generic | |
851 | vertex attribute INDEX will modify the value of the user-defined | |
852 | attribute variable specified by NAME. | |
853 | ||
854 | If NAME refers to a matrix attribute variable, INDEX refers to the first | |
855 | column of the matrix. Other matrix columns are then automatically bound | |
856 | to locations INDEX+1 for a matrix of type mat2; INDEX+1 and INDEX+2 for | |
857 | a matrix of type mat3; and INDEX+1, INDEX+2, and INDEX+3 for a matrix of | |
858 | type mat4. | |
859 | ||
860 | This command makes it possible for vertex shaders to use descriptive | |
861 | names for attribute variables rather than generic variables that are | |
862 | numbered from 0 to `GL_MAX_VERTEX_ATTRIBS' -1. The values sent to each | |
863 | generic attribute index are part of current state, just like standard | |
864 | vertex attributes such as color, normal, and vertex position. If a | |
865 | different program object is made current by calling `glUseProgram', the | |
866 | generic vertex attributes are tracked in such a way that the same values | |
867 | will be observed by attributes in the new program object that are also | |
868 | bound to INDEX. | |
869 | ||
870 | Attribute variable name-to-generic attribute index bindings for a | |
871 | program object can be explicitly assigned at any time by calling | |
872 | `glBindAttribLocation'. Attribute bindings do not go into effect until | |
873 | `glLinkProgram' is called. After a program object has been linked | |
874 | successfully, the index values for generic attributes remain fixed (and | |
875 | their values can be queried) until the next link command occurs. | |
876 | ||
877 | Applications are not allowed to bind any of the standard OpenGL vertex | |
878 | attributes using this command, as they are bound automatically when | |
879 | needed. Any attribute binding that occurs after the program object has | |
880 | been linked will not take effect until the next time the program object | |
881 | is linked. | |
882 | ||
883 | `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to | |
884 | `GL_MAX_VERTEX_ATTRIBS'. | |
885 | ||
886 | `GL_INVALID_OPERATION' is generated if NAME starts with the reserved | |
887 | prefix \"gl_\". | |
888 | ||
889 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by | |
890 | OpenGL. | |
891 | ||
892 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
893 | ||
894 | `GL_INVALID_OPERATION' is generated if `glBindAttribLocation' is | |
895 | executed between the execution of `glBegin' and the corresponding | |
896 | execution of `glEnd'.") | |
8925f36f AW |
897 | |
898 | (define-gl-procedure | |
bb894c9d AW |
899 | ((glBindBuffer |
900 | (target GLenum) | |
901 | (buffer GLuint) | |
902 | -> | |
903 | void)) | |
3c9b6116 AW |
904 | "Bind a named buffer object. |
905 | ||
906 | TARGET | |
907 | Specifies the target to which the buffer object is bound. The | |
908 | symbolic constant must be `GL_ARRAY_BUFFER', | |
909 | `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or | |
910 | `GL_PIXEL_UNPACK_BUFFER'. | |
911 | ||
912 | BUFFER | |
913 | Specifies the name of a buffer object. | |
914 | ||
915 | `glBindBuffer' lets you create or use a named buffer object. Calling | |
916 | `glBindBuffer' with TARGET set to `GL_ARRAY_BUFFER', | |
917 | `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER' or | |
918 | `GL_PIXEL_UNPACK_BUFFER' and BUFFER set to the name of the new buffer | |
919 | object binds the buffer object name to the target. When a buffer object | |
920 | is bound to a target, the previous binding for that target is | |
921 | automatically broken. | |
922 | ||
923 | Buffer object names are unsigned integers. The value zero is reserved, | |
924 | but there is no default buffer object for each buffer object target. | |
925 | Instead, BUFFER set to zero effectively unbinds any buffer object | |
926 | previously bound, and restores client memory usage for that buffer | |
927 | object target. Buffer object names and the corresponding buffer object | |
928 | contents are local to the shared display-list space (see | |
929 | `glXCreateContext') of the current GL rendering context; two rendering | |
930 | contexts share buffer object names only if they also share display | |
931 | lists. | |
932 | ||
933 | You may use `glGenBuffers' to generate a set of new buffer object names. | |
934 | ||
935 | The state of a buffer object immediately after it is first bound is an | |
936 | unmapped zero-sized memory buffer with `GL_READ_WRITE' access and | |
937 | `GL_STATIC_DRAW' usage. | |
938 | ||
939 | While a non-zero buffer object name is bound, GL operations on the | |
940 | target to which it is bound affect the bound buffer object, and queries | |
941 | of the target to which it is bound return state from the bound buffer | |
942 | object. While buffer object name zero is bound, as in the initial state, | |
943 | attempts to modify or query state on the target to which it is bound | |
944 | generates an `GL_INVALID_OPERATION' error. | |
945 | ||
946 | When vertex array pointer state is changed, for example by a call to | |
947 | `glNormalPointer', the current buffer object binding | |
948 | (`GL_ARRAY_BUFFER_BINDING') is copied into the corresponding client | |
949 | state for the vertex array type being changed, for example | |
950 | `GL_NORMAL_ARRAY_BUFFER_BINDING'. While a non-zero buffer object is | |
951 | bound to the `GL_ARRAY_BUFFER' target, the vertex array pointer | |
952 | parameter that is traditionally interpreted as a pointer to client-side | |
953 | memory is instead interpreted as an offset within the buffer object | |
954 | measured in basic machine units. | |
955 | ||
956 | While a non-zero buffer object is bound to the `GL_ELEMENT_ARRAY_BUFFER' | |
957 | target, the indices parameter of `glDrawElements', | |
958 | `glDrawRangeElements', or `glMultiDrawElements' that is traditionally | |
959 | interpreted as a pointer to client-side memory is instead interpreted as | |
960 | an offset within the buffer object measured in basic machine units. | |
961 | ||
962 | While a non-zero buffer object is bound to the `GL_PIXEL_PACK_BUFFER' | |
963 | target, the following commands are affected: `glGetCompressedTexImage', | |
964 | `glGetConvolutionFilter', `glGetHistogram', `glGetMinmax', | |
965 | `glGetPixelMap', `glGetPolygonStipple', `glGetSeparableFilter', | |
966 | `glGetTexImage', and `glReadPixels'. The pointer parameter that is | |
967 | traditionally interpreted as a pointer to client-side memory where the | |
968 | pixels are to be packed is instead interpreted as an offset within the | |
969 | buffer object measured in basic machine units. | |
970 | ||
971 | While a non-zero buffer object is bound to the `GL_PIXEL_UNPACK_BUFFER' | |
972 | target, the following commands are affected: `glBitmap', | |
973 | `glColorSubTable', `glColorTable', `glCompressedTexImage1D', | |
974 | `glCompressedTexImage2D', `glCompressedTexImage3D', | |
975 | `glCompressedTexSubImage1D', `glCompressedTexSubImage2D', | |
976 | `glCompressedTexSubImage3D', `glConvolutionFilter1D', | |
977 | `glConvolutionFilter2D', `glDrawPixels', `glPixelMap', | |
978 | `glPolygonStipple', `glSeparableFilter2D', `glTexImage1D', | |
979 | `glTexImage2D', `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', | |
980 | and `glTexSubImage3D'. The pointer parameter that is traditionally | |
981 | interpreted as a pointer to client-side memory from which the pixels are | |
982 | to be unpacked is instead interpreted as an offset within the buffer | |
983 | object measured in basic machine units. | |
984 | ||
985 | A buffer object binding created with `glBindBuffer' remains active until | |
986 | a different buffer object name is bound to the same target, or until the | |
987 | bound buffer object is deleted with `glDeleteBuffers'. | |
988 | ||
989 | Once created, a named buffer object may be re-bound to any target as | |
990 | often as needed. However, the GL implementation may make choices about | |
991 | how to optimize the storage of a buffer object based on its initial | |
992 | binding target. | |
993 | ||
994 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
995 | values. | |
996 | ||
997 | `GL_INVALID_OPERATION' is generated if `glBindBuffer' is executed | |
998 | between the execution of `glBegin' and the corresponding execution of | |
999 | `glEnd'.") | |
8925f36f AW |
1000 | |
1001 | (define-gl-procedure | |
bb894c9d AW |
1002 | ((glBindTexture |
1003 | (target GLenum) | |
1004 | (texture GLuint) | |
1005 | -> | |
1006 | void)) | |
3c9b6116 AW |
1007 | "Bind a named texture to a texturing target. |
1008 | ||
1009 | TARGET | |
1010 | Specifies the target to which the texture is bound. Must be either | |
1011 | `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or | |
1012 | `GL_TEXTURE_CUBE_MAP'. | |
1013 | ||
1014 | TEXTURE | |
1015 | Specifies the name of a texture. | |
1016 | ||
1017 | `glBindTexture' lets you create or use a named texture. Calling | |
1018 | `glBindTexture' with TARGET set to `GL_TEXTURE_1D', `GL_TEXTURE_2D', | |
1019 | `GL_TEXTURE_3D' or `GL_TEXTURE_CUBE_MAP' and TEXTURE set to the name of | |
1020 | the new texture binds the texture name to the target. When a texture is | |
1021 | bound to a target, the previous binding for that target is automatically | |
1022 | broken. | |
1023 | ||
8925f36f | 1024 | Texture names are unsigned integers. The value zero is reserved to |
3c9b6116 AW |
1025 | represent the default texture for each texture target. Texture names and |
1026 | the corresponding texture contents are local to the shared display-list | |
1027 | space (see `glXCreateContext') of the current GL rendering context; two | |
1028 | rendering contexts share texture names only if they also share display | |
1029 | lists. | |
1030 | ||
1031 | You may use `glGenTextures' to generate a set of new texture names. | |
1032 | ||
1033 | When a texture is first bound, it assumes the specified target: A | |
1034 | texture first bound to `GL_TEXTURE_1D' becomes one-dimensional texture, | |
1035 | a texture first bound to `GL_TEXTURE_2D' becomes two-dimensional | |
1036 | texture, a texture first bound to `GL_TEXTURE_3D' becomes | |
1037 | three-dimensional texture, and a texture first bound to | |
1038 | `GL_TEXTURE_CUBE_MAP' becomes a cube-mapped texture. The state of a | |
1039 | one-dimensional texture immediately after it is first bound is | |
1040 | equivalent to the state of the default `GL_TEXTURE_1D' at GL | |
1041 | initialization, and similarly for two- and three-dimensional textures | |
1042 | and cube-mapped textures. | |
1043 | ||
8925f36f | 1044 | While a texture is bound, GL operations on the target to which it is |
3c9b6116 AW |
1045 | bound affect the bound texture, and queries of the target to which it is |
1046 | bound return state from the bound texture. If texture mapping is active | |
1047 | on the target to which a texture is bound, the bound texture is used. In | |
1048 | effect, the texture targets become aliases for the textures currently | |
1049 | bound to them, and the texture name zero refers to the default textures | |
1050 | that were bound to them at initialization. | |
1051 | ||
1052 | A texture binding created with `glBindTexture' remains active until a | |
1053 | different texture is bound to the same target, or until the bound | |
1054 | texture is deleted with `glDeleteTextures'. | |
1055 | ||
1056 | Once created, a named texture may be re-bound to its same original | |
1057 | target as often as needed. It is usually much faster to use | |
1058 | `glBindTexture' to bind an existing named texture to one of the texture | |
1059 | targets than it is to reload the texture image using `glTexImage1D', | |
1060 | `glTexImage2D', or `glTexImage3D'. For additional control over | |
1061 | performance, use `glPrioritizeTextures'. | |
1062 | ||
1063 | `glBindTexture' is included in display lists. | |
1064 | ||
1065 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
1066 | values. | |
1067 | ||
1068 | `GL_INVALID_OPERATION' is generated if TEXTURE was previously created | |
1069 | with a target that doesn't match that of TARGET. | |
1070 | ||
1071 | `GL_INVALID_OPERATION' is generated if `glBindTexture' is executed | |
1072 | between the execution of `glBegin' and the corresponding execution of | |
1073 | `glEnd'.") | |
8925f36f AW |
1074 | |
1075 | (define-gl-procedure | |
bb894c9d AW |
1076 | ((glBitmap |
1077 | (width GLsizei) | |
1078 | (height GLsizei) | |
1079 | (xorig GLfloat) | |
1080 | (yorig GLfloat) | |
1081 | (xmove GLfloat) | |
1082 | (ymove GLfloat) | |
1083 | (bitmap *) | |
1084 | -> | |
1085 | void)) | |
3c9b6116 AW |
1086 | "Draw a bitmap. |
1087 | ||
1088 | WIDTH | |
1089 | HEIGHT | |
1090 | ||
1091 | Specify the pixel width and height of the bitmap image. | |
1092 | ||
1093 | XORIG | |
1094 | YORIG | |
1095 | ||
1096 | Specify the location of the origin in the bitmap image. The origin | |
1097 | is measured from the lower left corner of the bitmap, with right | |
1098 | and up being the positive axes. | |
1099 | ||
1100 | XMOVE | |
1101 | YMOVE | |
1102 | ||
1103 | Specify the X and Y offsets to be added to the current raster | |
1104 | position after the bitmap is drawn. | |
1105 | ||
1106 | BITMAP | |
1107 | Specifies the address of the bitmap image. | |
1108 | ||
1109 | A bitmap is a binary image. When drawn, the bitmap is positioned | |
1110 | relative to the current raster position, and frame buffer pixels | |
1111 | corresponding to 1's in the bitmap are written using the current raster | |
1112 | color or index. Frame buffer pixels corresponding to 0's in the bitmap | |
1113 | are not modified. | |
1114 | ||
1115 | `glBitmap' takes seven arguments. The first pair specifies the width and | |
1116 | height of the bitmap image. The second pair specifies the location of | |
1117 | the bitmap origin relative to the lower left corner of the bitmap image. | |
1118 | The third pair of arguments specifies X and Y offsets to be added to the | |
1119 | current raster position after the bitmap has been drawn. The final | |
1120 | argument is a pointer to the bitmap image itself. | |
1121 | ||
1122 | If a non-zero named buffer object is bound to the | |
1123 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a bitmap | |
1124 | image is specified, BITMAP is treated as a byte offset into the buffer | |
1125 | object's data store. | |
1126 | ||
1127 | The bitmap image is interpreted like image data for the `glDrawPixels' | |
1128 | command, with WIDTH and HEIGHT corresponding to the width and height | |
1129 | arguments of that command, and with TYPE set to `GL_BITMAP' and FORMAT | |
1130 | set to `GL_COLOR_INDEX'. Modes specified using `glPixelStore' affect the | |
1131 | interpretation of bitmap image data; modes specified using | |
1132 | `glPixelTransfer' do not. | |
1133 | ||
1134 | If the current raster position is invalid, `glBitmap' is ignored. | |
1135 | Otherwise, the lower left corner of the bitmap image is positioned at | |
1136 | the window coordinates | |
1137 | ||
1138 | X_W=⌊X_R-X_O,⌋ | |
1139 | ||
1140 | Y_W=⌊Y_R-Y_O,⌋ | |
1141 | ||
1142 | where (X_R,Y_R) is the raster position and (X_O,Y_O) is the bitmap | |
1143 | origin. Fragments are then generated for each pixel corresponding to a 1 | |
1144 | (one) in the bitmap image. These fragments are generated using the | |
1145 | current raster Z coordinate, color or color index, and current raster | |
1146 | texture coordinates. They are then treated just as if they had been | |
1147 | generated by a point, line, or polygon, including texture mapping, | |
1148 | fogging, and all per-fragment operations such as alpha and depth | |
1149 | testing. | |
1150 | ||
1151 | After the bitmap has been drawn, the X and Y coordinates of the current | |
1152 | raster position are offset by XMOVE and YMOVE. No change is made to the | |
1153 | Z coordinate of the current raster position, or to the current raster | |
1154 | color, texture coordinates, or index. | |
1155 | ||
1156 | `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is negative. | |
1157 | ||
1158 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
1159 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
1160 | data store is currently mapped. | |
1161 | ||
1162 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
1163 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
1164 | unpacked from the buffer object such that the memory reads required | |
1165 | would exceed the data store size. | |
1166 | ||
1167 | `GL_INVALID_OPERATION' is generated if `glBitmap' is executed between | |
1168 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
1169 | |
1170 | (define-gl-procedure | |
bb894c9d AW |
1171 | ((glBlendColor |
1172 | (red GLclampf) | |
1173 | (green GLclampf) | |
1174 | (blue GLclampf) | |
1175 | (alpha GLclampf) | |
1176 | -> | |
1177 | void)) | |
3c9b6116 AW |
1178 | "Set the blend color. |
1179 | ||
1180 | RED | |
1181 | GREEN | |
1182 | ||
1183 | BLUE | |
1184 | ||
1185 | ALPHA | |
1186 | ||
1187 | specify the components of `GL_BLEND_COLOR' | |
1188 | ||
1189 | The `GL_BLEND_COLOR' may be used to calculate the source and destination | |
1190 | blending factors. The color components are clamped to the range [0,1] | |
1191 | before being stored. See `glBlendFunc' for a complete description of the | |
1192 | blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0, | |
1193 | 0). | |
1194 | ||
1195 | `GL_INVALID_OPERATION' is generated if `glBlendColor' is executed | |
1196 | between the execution of `glBegin' and the corresponding execution of | |
1197 | `glEnd'.") | |
8925f36f AW |
1198 | |
1199 | (define-gl-procedure | |
bb894c9d AW |
1200 | ((glBlendEquationSeparate |
1201 | (modeRGB GLenum) | |
1202 | (modeAlpha GLenum) | |
1203 | -> | |
1204 | void)) | |
3c9b6116 AW |
1205 | "Set the RGB blend equation and the alpha blend equation separately. |
1206 | ||
1207 | MODERGB | |
1208 | specifies the RGB blend equation, how the red, green, and blue | |
1209 | components of the source and destination colors are combined. It | |
1210 | must be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', | |
1211 | `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN', `GL_MAX'. | |
1212 | ||
1213 | MODEALPHA | |
1214 | specifies the alpha blend equation, how the alpha component of the | |
1215 | source and destination colors are combined. It must be | |
1216 | `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', | |
1217 | `GL_MIN', `GL_MAX'. | |
1218 | ||
1219 | The blend equations determines how a new pixel (the ''source'' color) is | |
1220 | combined with a pixel already in the framebuffer (the ''destination'' | |
1221 | color). This function specifies one blend equation for the RGB-color | |
1222 | components and one blend equation for the alpha component. | |
1223 | ||
8925f36f | 1224 | The blend equations use the source and destination blend factors |
3c9b6116 AW |
1225 | specified by either `glBlendFunc' or `glBlendFuncSeparate'. See |
1226 | `glBlendFunc' or `glBlendFuncSeparate' for a description of the various | |
1227 | blend factors. | |
1228 | ||
1229 | In the equations that follow, source and destination color components | |
1230 | are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively. | |
1231 | The result color is referred to as (R_R,G_RB_RA_R) . The source and | |
1232 | destination blend factors are denoted (S_R,S_GS_BS_A) and | |
1233 | (D_R,D_GD_BD_A) , respectively. For these equations all color components | |
1234 | are understood to have values in the range [0,1] . | |
1235 | ||
1236 | *Mode* | |
1237 | *RGB Components*, *Alpha Component* | |
1238 | ||
1239 | `GL_FUNC_ADD' | |
1240 | RR=R_S\u2062S_R+R_D\u2062D_R GR=G_S\u2062S_G+G_D\u2062D_G BR=B_S\u2062S_B+B_D\u2062D_B , | |
1241 | AR=A_S\u2062S_A+A_D\u2062D_A | |
1242 | ||
1243 | `GL_FUNC_SUBTRACT' | |
1244 | RR=R_S\u2062S_R-R_D\u2062D_R GR=G_S\u2062S_G-G_D\u2062D_G BR=B_S\u2062S_B-B_D\u2062D_B , | |
1245 | AR=A_S\u2062S_A-A_D\u2062D_A | |
1246 | ||
1247 | `GL_FUNC_REVERSE_SUBTRACT' | |
1248 | RR=R_D\u2062D_R-R_S\u2062S_R GR=G_D\u2062D_G-G_S\u2062S_G BR=B_D\u2062D_B-B_S\u2062S_B , | |
1249 | AR=A_D\u2062D_A-A_S\u2062S_A | |
1250 | ||
1251 | `GL_MIN' | |
1252 | RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) , | |
1253 | AR=MIN\u2061(A_S,A_D) | |
1254 | ||
1255 | `GL_MAX' | |
1256 | RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) , | |
1257 | AR=MAX\u2061(A_S,A_D) | |
1258 | ||
1259 | The results of these equations are clamped to the range [0,1] . | |
1260 | ||
1261 | The `GL_MIN' and `GL_MAX' equations are useful for applications that | |
1262 | analyze image data (image thresholding against a constant color, for | |
1263 | example). The `GL_FUNC_ADD' equation is useful for antialiasing and | |
1264 | transparency, among other things. | |
1265 | ||
1266 | Initially, both the RGB blend equation and the alpha blend equation are | |
1267 | set to `GL_FUNC_ADD'. | |
1268 | ||
1269 | ||
1270 | ||
1271 | `GL_INVALID_ENUM' is generated if either MODERGB or MODEALPHA is not one | |
1272 | of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', | |
1273 | `GL_MAX', or `GL_MIN'. | |
1274 | ||
1275 | `GL_INVALID_OPERATION' is generated if `glBlendEquationSeparate' is | |
1276 | executed between the execution of `glBegin' and the corresponding | |
1277 | execution of `glEnd'.") | |
8925f36f AW |
1278 | |
1279 | (define-gl-procedure | |
bb894c9d | 1280 | ((glBlendEquation (mode GLenum) -> void)) |
3c9b6116 AW |
1281 | "Specify the equation used for both the RGB blend equation and the Alpha |
1282 | blend equation. | |
1283 | ||
1284 | MODE | |
1285 | specifies how source and destination colors are combined. It must | |
1286 | be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', | |
1287 | `GL_MIN', `GL_MAX'. | |
1288 | ||
1289 | The blend equations determine how a new pixel (the ''source'' color) is | |
1290 | combined with a pixel already in the framebuffer (the ''destination'' | |
1291 | color). This function sets both the RGB blend equation and the alpha | |
1292 | blend equation to a single equation. | |
1293 | ||
1294 | These equations use the source and destination blend factors specified | |
1295 | by either `glBlendFunc' or `glBlendFuncSeparate'. See `glBlendFunc' or | |
1296 | `glBlendFuncSeparate' for a description of the various blend factors. | |
1297 | ||
1298 | In the equations that follow, source and destination color components | |
1299 | are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively. | |
1300 | The result color is referred to as (R_R,G_RB_RA_R) . The source and | |
1301 | destination blend factors are denoted (S_R,S_GS_BS_A) and | |
1302 | (D_R,D_GD_BD_A) , respectively. For these equations all color components | |
1303 | are understood to have values in the range [0,1] . | |
1304 | ||
1305 | *Mode* | |
1306 | *RGB Components*, *Alpha Component* | |
1307 | ||
1308 | `GL_FUNC_ADD' | |
1309 | RR=R_S\u2062S_R+R_D\u2062D_R GR=G_S\u2062S_G+G_D\u2062D_G BR=B_S\u2062S_B+B_D\u2062D_B , | |
1310 | AR=A_S\u2062S_A+A_D\u2062D_A | |
1311 | ||
1312 | `GL_FUNC_SUBTRACT' | |
1313 | RR=R_S\u2062S_R-R_D\u2062D_R GR=G_S\u2062S_G-G_D\u2062D_G BR=B_S\u2062S_B-B_D\u2062D_B , | |
1314 | AR=A_S\u2062S_A-A_D\u2062D_A | |
1315 | ||
1316 | `GL_FUNC_REVERSE_SUBTRACT' | |
1317 | RR=R_D\u2062D_R-R_S\u2062S_R GR=G_D\u2062D_G-G_S\u2062S_G BR=B_D\u2062D_B-B_S\u2062S_B , | |
1318 | AR=A_D\u2062D_A-A_S\u2062S_A | |
1319 | ||
1320 | `GL_MIN' | |
1321 | RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) , | |
1322 | AR=MIN\u2061(A_S,A_D) | |
1323 | ||
1324 | `GL_MAX' | |
1325 | RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) , | |
1326 | AR=MAX\u2061(A_S,A_D) | |
1327 | ||
1328 | The results of these equations are clamped to the range [0,1] . | |
1329 | ||
1330 | The `GL_MIN' and `GL_MAX' equations are useful for applications that | |
1331 | analyze image data (image thresholding against a constant color, for | |
1332 | example). The `GL_FUNC_ADD' equation is useful for antialiasing and | |
1333 | transparency, among other things. | |
1334 | ||
1335 | Initially, both the RGB blend equation and the alpha blend equation are | |
1336 | set to `GL_FUNC_ADD'. | |
1337 | ||
1338 | ||
1339 | ||
1340 | `GL_INVALID_ENUM' is generated if MODE is not one of `GL_FUNC_ADD', | |
1341 | `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', `GL_MAX', or `GL_MIN'. | |
1342 | ||
1343 | `GL_INVALID_OPERATION' is generated if `glBlendEquation' is executed | |
1344 | between the execution of `glBegin' and the corresponding execution of | |
1345 | `glEnd'.") | |
8925f36f AW |
1346 | |
1347 | (define-gl-procedure | |
bb894c9d AW |
1348 | ((glBlendFuncSeparate |
1349 | (srcRGB GLenum) | |
1350 | (dstRGB GLenum) | |
1351 | (srcAlpha GLenum) | |
1352 | (dstAlpha GLenum) | |
1353 | -> | |
1354 | void)) | |
3c9b6116 AW |
1355 | "Specify pixel arithmetic for RGB and alpha components separately. |
1356 | ||
1357 | SRCRGB | |
1358 | Specifies how the red, green, and blue blending factors are | |
1359 | computed. The following symbolic constants are accepted: `GL_ZERO', | |
1360 | `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', | |
1361 | `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', | |
1362 | `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR', | |
1363 | `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', | |
1364 | `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The | |
1365 | initial value is `GL_ONE'. | |
1366 | ||
1367 | DSTRGB | |
1368 | Specifies how the red, green, and blue destination blending factors | |
1369 | are computed. The following symbolic constants are accepted: | |
1370 | `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', | |
1371 | `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', | |
1372 | `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA'. | |
1373 | `GL_CONSTANT_COLOR', `GL_ONE_MINUS_CONSTANT_COLOR', | |
1374 | `GL_CONSTANT_ALPHA', and `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial | |
1375 | value is `GL_ZERO'. | |
1376 | ||
1377 | SRCALPHA | |
1378 | Specified how the alpha source blending factor is computed. The | |
1379 | same symbolic constants are accepted as for SRCRGB. The initial | |
1380 | value is `GL_ONE'. | |
1381 | ||
1382 | DSTALPHA | |
1383 | Specified how the alpha destination blending factor is computed. | |
1384 | The same symbolic constants are accepted as for DSTRGB. The initial | |
1385 | value is `GL_ZERO'. | |
1386 | ||
1387 | In RGBA mode, pixels can be drawn using a function that blends the | |
1388 | incoming (source) RGBA values with the RGBA values that are already in | |
1389 | the frame buffer (the destination values). Blending is initially | |
1390 | disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to | |
1391 | enable and disable blending. | |
1392 | ||
1393 | `glBlendFuncSeparate' defines the operation of blending when it is | |
1394 | enabled. SRCRGB specifies which method is used to scale the source | |
1395 | RGB-color components. DSTRGB specifies which method is used to scale the | |
1396 | destination RGB-color components. Likewise, SRCALPHA specifies which | |
1397 | method is used to scale the source alpha color component, and DSTALPHA | |
1398 | specifies which method is used to scale the destination alpha component. | |
1399 | The possible methods are described in the following table. Each method | |
1400 | defines four scale factors, one each for red, green, blue, and alpha. | |
1401 | ||
1402 | In the table and in subsequent equations, source and destination color | |
1403 | components are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The | |
1404 | color specified by `glBlendColor' is referred to as (R_C,G_CB_CA_C) . | |
1405 | They are understood to have integer values between 0 and (K_R,K_GK_BK_A) | |
1406 | , where | |
1407 | ||
1408 | K_C=2^M_C,-1 | |
1409 | ||
1410 | and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha | |
1411 | bitplanes. | |
1412 | ||
1413 | Source and destination scale factors are referred to as (S_R,S_GS_BS_A) | |
1414 | and (D_R,D_GD_BD_A) . All scale factors have range [0,1] . | |
1415 | ||
1416 | ||
1417 | ||
1418 | *Parameter* | |
1419 | *RGB Factor*, *Alpha Factor* | |
1420 | ||
1421 | `GL_ZERO' | |
1422 | (0,00) , 0 | |
1423 | ||
1424 | `GL_ONE' | |
1425 | (1,11) , 1 | |
1426 | ||
1427 | `GL_SRC_COLOR' | |
1428 | (R_S/K_R,G_S/K_GB_S/K_B) , A_S/K_A | |
1429 | ||
1430 | `GL_ONE_MINUS_SRC_COLOR' | |
1431 | (1,111)-(R_S/K_R,G_S/K_GB_S/K_B) , 1-A_S/K_A | |
1432 | ||
1433 | `GL_DST_COLOR' | |
1434 | (R_D/K_R,G_D/K_GB_D/K_B) , A_D/K_A | |
1435 | ||
1436 | `GL_ONE_MINUS_DST_COLOR' | |
1437 | (1,11)-(R_D/K_R,G_D/K_GB_D/K_B) , 1-A_D/K_A | |
1438 | ||
1439 | `GL_SRC_ALPHA' | |
1440 | (A_S/K_A,A_S/K_AA_S/K_A) , A_S/K_A | |
1441 | ||
1442 | `GL_ONE_MINUS_SRC_ALPHA' | |
1443 | (1,11)-(A_S/K_A,A_S/K_AA_S/K_A) , 1-A_S/K_A | |
1444 | ||
1445 | `GL_DST_ALPHA' | |
1446 | (A_D/K_A,A_D/K_AA_D/K_A) , A_D/K_A | |
1447 | ||
1448 | `GL_ONE_MINUS_DST_ALPHA' | |
1449 | (1,11)-(A_D/K_A,A_D/K_AA_D/K_A) , 1-A_D/K_A | |
1450 | ||
1451 | `GL_CONSTANT_COLOR' | |
1452 | (R_C,G_CB_C) , A_C | |
1453 | ||
1454 | `GL_ONE_MINUS_CONSTANT_COLOR' | |
1455 | (1,11)-(R_C,G_CB_C) , 1-A_C | |
1456 | ||
1457 | `GL_CONSTANT_ALPHA' | |
1458 | (A_C,A_CA_C) , A_C | |
1459 | ||
1460 | `GL_ONE_MINUS_CONSTANT_ALPHA' | |
1461 | (1,11)-(A_C,A_CA_C) , 1-A_C | |
1462 | ||
1463 | `GL_SRC_ALPHA_SATURATE' | |
1464 | (I,II) , 1 | |
1465 | ||
1466 | In the table, | |
1467 | ||
1468 | I=MIN\u2061(A_S,1-A_D,) | |
1469 | ||
1470 | To determine the blended RGBA values of a pixel when drawing in RGBA | |
1471 | mode, the system uses the following equations: | |
1472 | ||
1473 | R_D=MIN\u2061(K_R,R_S\u2062S_R+R_D\u2062D_R) G_D=MIN\u2061(K_G,G_S\u2062S_G+G_D\u2062D_G) | |
1474 | B_D=MIN\u2061(K_B,B_S\u2062S_B+B_D\u2062D_B) A_D=MIN\u2061(K_A,A_S\u2062S_A+A_D\u2062D_A) | |
1475 | ||
1476 | Despite the apparent precision of the above equations, blending | |
1477 | arithmetic is not exactly specified, because blending operates with | |
1478 | imprecise integer color values. However, a blend factor that should be | |
1479 | equal to 1 is guaranteed not to modify its multiplicand, and a blend | |
1480 | factor equal to 0 reduces its multiplicand to 0. For example, when | |
1481 | SRCRGB is `GL_SRC_ALPHA', DSTRGB is `GL_ONE_MINUS_SRC_ALPHA', and A_S is | |
1482 | equal to K_A , the equations reduce to simple replacement: | |
1483 | ||
1484 | R_D=R_S G_D=G_S B_D=B_S A_D=A_S | |
1485 | ||
1486 | ||
1487 | ||
1488 | `GL_INVALID_ENUM' is generated if either SRCRGB or DSTRGB is not an | |
1489 | accepted value. | |
1490 | ||
1491 | `GL_INVALID_OPERATION' is generated if `glBlendFuncSeparate' is executed | |
1492 | between the execution of `glBegin' and the corresponding execution of | |
1493 | `glEnd'.") | |
8925f36f AW |
1494 | |
1495 | (define-gl-procedure | |
bb894c9d AW |
1496 | ((glBlendFunc |
1497 | (sfactor GLenum) | |
1498 | (dfactor GLenum) | |
1499 | -> | |
1500 | void)) | |
3c9b6116 | 1501 | "Specify pixel arithmetic. |
8925f36f | 1502 | |
3c9b6116 AW |
1503 | SFACTOR |
1504 | Specifies how the red, green, blue, and alpha source blending | |
1505 | factors are computed. The following symbolic constants are | |
1506 | accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', | |
1507 | `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', | |
1508 | `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', | |
1509 | `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR', | |
1510 | `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', | |
1511 | `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The | |
1512 | initial value is `GL_ONE'. | |
8925f36f | 1513 | |
3c9b6116 AW |
1514 | DFACTOR |
1515 | Specifies how the red, green, blue, and alpha destination blending | |
1516 | factors are computed. The following symbolic constants are | |
1517 | accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', | |
1518 | `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', | |
1519 | `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', | |
1520 | `GL_ONE_MINUS_DST_ALPHA'. `GL_CONSTANT_COLOR', | |
1521 | `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', and | |
1522 | `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial value is `GL_ZERO'. | |
8925f36f | 1523 | |
3c9b6116 AW |
1524 | In RGBA mode, pixels can be drawn using a function that blends the |
1525 | incoming (source) RGBA values with the RGBA values that are already in | |
1526 | the frame buffer (the destination values). Blending is initially | |
1527 | disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to | |
1528 | enable and disable blending. | |
1529 | ||
1530 | `glBlendFunc' defines the operation of blending when it is enabled. | |
1531 | SFACTOR specifies which method is used to scale the source color | |
1532 | components. DFACTOR specifies which method is used to scale the | |
1533 | destination color components. The possible methods are described in the | |
1534 | following table. Each method defines four scale factors, one each for | |
1535 | red, green, blue, and alpha. In the table and in subsequent equations, | |
1536 | source and destination color components are referred to as | |
1537 | (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The color specified by | |
1538 | `glBlendColor' is referred to as (R_C,G_CB_CA_C) . They are understood | |
1539 | to have integer values between 0 and (K_R,K_GK_BK_A) , where | |
1540 | ||
1541 | K_C=2^M_C,-1 | |
1542 | ||
1543 | and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha | |
1544 | bitplanes. | |
1545 | ||
1546 | Source and destination scale factors are referred to as (S_R,S_GS_BS_A) | |
1547 | and (D_R,D_GD_BD_A) . The scale factors described in the table, denoted | |
1548 | (F_R,F_GF_BF_A) , represent either source or destination factors. All | |
1549 | scale factors have range [0,1] . | |
1550 | ||
1551 | ||
1552 | ||
1553 | *Parameter* | |
1554 | * (F_R,F_GF_BF_A) * | |
1555 | ||
1556 | `GL_ZERO' | |
1557 | (0,000) | |
1558 | ||
1559 | `GL_ONE' | |
1560 | (1,111) | |
1561 | ||
1562 | `GL_SRC_COLOR' | |
1563 | (R_S/K_R,G_S/K_GB_S/K_BA_S/K_A) | |
1564 | ||
1565 | `GL_ONE_MINUS_SRC_COLOR' | |
1566 | (1,111)-(R_S/K_R,G_S/K_GB_S/K_BA_S/K_A) | |
1567 | ||
1568 | `GL_DST_COLOR' | |
1569 | (R_D/K_R,G_D/K_GB_D/K_BA_D/K_A) | |
1570 | ||
1571 | `GL_ONE_MINUS_DST_COLOR' | |
1572 | (1,111)-(R_D/K_R,G_D/K_GB_D/K_BA_D/K_A) | |
1573 | ||
1574 | `GL_SRC_ALPHA' | |
1575 | (A_S/K_A,A_S/K_AA_S/K_AA_S/K_A) | |
1576 | ||
1577 | `GL_ONE_MINUS_SRC_ALPHA' | |
1578 | (1,111)-(A_S/K_A,A_S/K_AA_S/K_AA_S/K_A) | |
1579 | ||
1580 | `GL_DST_ALPHA' | |
1581 | (A_D/K_A,A_D/K_AA_D/K_AA_D/K_A) | |
1582 | ||
1583 | `GL_ONE_MINUS_DST_ALPHA' | |
1584 | (1,111)-(A_D/K_A,A_D/K_AA_D/K_AA_D/K_A) | |
1585 | ||
1586 | `GL_CONSTANT_COLOR' | |
1587 | (R_C,G_CB_CA_C) | |
1588 | ||
1589 | `GL_ONE_MINUS_CONSTANT_COLOR' | |
1590 | (1,111)-(R_C,G_CB_CA_C) | |
1591 | ||
1592 | `GL_CONSTANT_ALPHA' | |
1593 | (A_C,A_CA_CA_C) | |
1594 | ||
1595 | `GL_ONE_MINUS_CONSTANT_ALPHA' | |
1596 | (1,111)-(A_C,A_CA_CA_C) | |
1597 | ||
1598 | `GL_SRC_ALPHA_SATURATE' | |
1599 | (I,II1) | |
1600 | ||
1601 | In the table, | |
1602 | ||
1603 | I=MIN\u2061(A_S,K_A-A_D)/K_A | |
1604 | ||
1605 | To determine the blended RGBA values of a pixel when drawing in RGBA | |
1606 | mode, the system uses the following equations: | |
1607 | ||
1608 | R_D=MIN\u2061(K_R,R_S\u2062S_R+R_D\u2062D_R) G_D=MIN\u2061(K_G,G_S\u2062S_G+G_D\u2062D_G) | |
1609 | B_D=MIN\u2061(K_B,B_S\u2062S_B+B_D\u2062D_B) A_D=MIN\u2061(K_A,A_S\u2062S_A+A_D\u2062D_A) | |
1610 | ||
1611 | Despite the apparent precision of the above equations, blending | |
1612 | arithmetic is not exactly specified, because blending operates with | |
1613 | imprecise integer color values. However, a blend factor that should be | |
1614 | equal to 1 is guaranteed not to modify its multiplicand, and a blend | |
1615 | factor equal to 0 reduces its multiplicand to 0. For example, when | |
1616 | SFACTOR is `GL_SRC_ALPHA', DFACTOR is `GL_ONE_MINUS_SRC_ALPHA', and A_S | |
1617 | is equal to K_A , the equations reduce to simple replacement: | |
1618 | ||
1619 | R_D=R_S G_D=G_S B_D=B_S A_D=A_S | |
1620 | ||
1621 | ||
1622 | ||
1623 | `GL_INVALID_ENUM' is generated if either SFACTOR or DFACTOR is not an | |
1624 | accepted value. | |
1625 | ||
1626 | `GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between | |
1627 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
1628 | ||
1629 | (define-gl-procedure | |
bb894c9d AW |
1630 | ((glBufferData |
1631 | (target GLenum) | |
1632 | (size GLsizeiptr) | |
1633 | (data *) | |
1634 | (usage GLenum) | |
1635 | -> | |
1636 | void)) | |
3c9b6116 AW |
1637 | "Creates and initializes a buffer object's data store. |
1638 | ||
1639 | TARGET | |
1640 | Specifies the target buffer object. The symbolic constant must be | |
1641 | `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER', | |
1642 | `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'. | |
1643 | ||
1644 | SIZE | |
1645 | Specifies the size in bytes of the buffer object's new data store. | |
1646 | ||
1647 | DATA | |
1648 | Specifies a pointer to data that will be copied into the data store | |
1649 | for initialization, or `NULL' if no data is to be copied. | |
1650 | ||
1651 | USAGE | |
1652 | Specifies the expected usage pattern of the data store. The | |
1653 | symbolic constant must be `GL_STREAM_DRAW', `GL_STREAM_READ', | |
1654 | `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ', | |
1655 | `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or | |
1656 | `GL_DYNAMIC_COPY'. | |
1657 | ||
1658 | `glBufferData' creates a new data store for the buffer object currently | |
1659 | bound to TARGET. Any pre-existing data store is deleted. The new data | |
1660 | store is created with the specified SIZE in bytes and USAGE. If DATA is | |
1661 | not `NULL', the data store is initialized with data from this pointer. | |
1662 | In its initial state, the new data store is not mapped, it has a `NULL' | |
1663 | mapped pointer, and its mapped access is `GL_READ_WRITE'. | |
1664 | ||
1665 | USAGE is a hint to the GL implementation as to how a buffer object's | |
1666 | data store will be accessed. This enables the GL implementation to make | |
1667 | more intelligent decisions that may significantly impact buffer object | |
1668 | performance. It does not, however, constrain the actual usage of the | |
1669 | data store. USAGE can be broken down into two parts: first, the | |
1670 | frequency of access (modification and usage), and second, the nature of | |
1671 | that access. The frequency of access may be one of these: | |
1672 | ||
1673 | STREAM | |
1674 | The data store contents will be modified once and used at most a | |
1675 | few times. | |
1676 | ||
1677 | STATIC | |
1678 | The data store contents will be modified once and used many times. | |
1679 | ||
1680 | DYNAMIC | |
1681 | The data store contents will be modified repeatedly and used many | |
1682 | times. | |
1683 | ||
1684 | The nature of access may be one of these: | |
1685 | ||
1686 | DRAW | |
1687 | The data store contents are modified by the application, and used | |
1688 | as the source for GL drawing and image specification commands. | |
1689 | ||
1690 | READ | |
1691 | The data store contents are modified by reading data from the GL, | |
1692 | and used to return that data when queried by the application. | |
1693 | ||
1694 | COPY | |
1695 | The data store contents are modified by reading data from the GL, | |
1696 | and used as the source for GL drawing and image specification | |
1697 | commands. | |
1698 | ||
1699 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER', | |
1700 | `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or | |
1701 | `GL_PIXEL_UNPACK_BUFFER'. | |
1702 | ||
1703 | `GL_INVALID_ENUM' is generated if USAGE is not `GL_STREAM_DRAW', | |
1704 | `GL_STREAM_READ', `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ', | |
1705 | `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or | |
1706 | `GL_DYNAMIC_COPY'. | |
1707 | ||
1708 | `GL_INVALID_VALUE' is generated if SIZE is negative. | |
1709 | ||
1710 | `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0 | |
1711 | is bound to TARGET. | |
1712 | ||
1713 | `GL_OUT_OF_MEMORY' is generated if the GL is unable to create a data | |
1714 | store with the specified SIZE. | |
1715 | ||
1716 | `GL_INVALID_OPERATION' is generated if `glBufferData' is executed | |
1717 | between the execution of `glBegin' and the corresponding execution of | |
1718 | `glEnd'.") | |
1719 | ||
1720 | (define-gl-procedure | |
bb894c9d AW |
1721 | ((glBufferSubData |
1722 | (target GLenum) | |
1723 | (offset GLintptr) | |
1724 | (size GLsizeiptr) | |
1725 | (data *) | |
1726 | -> | |
1727 | void)) | |
3c9b6116 AW |
1728 | "Updates a subset of a buffer object's data store. |
1729 | ||
1730 | TARGET | |
1731 | Specifies the target buffer object. The symbolic constant must be | |
1732 | `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER', | |
1733 | `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'. | |
1734 | ||
1735 | OFFSET | |
1736 | Specifies the offset into the buffer object's data store where data | |
1737 | replacement will begin, measured in bytes. | |
1738 | ||
1739 | SIZE | |
1740 | Specifies the size in bytes of the data store region being | |
1741 | replaced. | |
1742 | ||
1743 | DATA | |
1744 | Specifies a pointer to the new data that will be copied into the | |
1745 | data store. | |
1746 | ||
1747 | `glBufferSubData' redefines some or all of the data store for the buffer | |
1748 | object currently bound to TARGET. Data starting at byte offset OFFSET | |
1749 | and extending for SIZE bytes is copied to the data store from the memory | |
1750 | pointed to by DATA. An error is thrown if OFFSET and SIZE together | |
1751 | define a range beyond the bounds of the buffer object's data store. | |
1752 | ||
1753 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER', | |
1754 | `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or | |
1755 | `GL_PIXEL_UNPACK_BUFFER'. | |
1756 | ||
1757 | `GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if | |
1758 | together they define a region of memory that extends beyond the buffer | |
1759 | object's allocated data store. | |
1760 | ||
1761 | `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0 | |
1762 | is bound to TARGET. | |
1763 | ||
1764 | `GL_INVALID_OPERATION' is generated if the buffer object being updated | |
1765 | is mapped. | |
1766 | ||
1767 | `GL_INVALID_OPERATION' is generated if `glBufferSubData' is executed | |
1768 | between the execution of `glBegin' and the corresponding execution of | |
1769 | `glEnd'.") | |
1770 | ||
1771 | (define-gl-procedure | |
bb894c9d AW |
1772 | ((glCallLists |
1773 | (n GLsizei) | |
1774 | (type GLenum) | |
1775 | (lists *) | |
1776 | -> | |
1777 | void)) | |
3c9b6116 AW |
1778 | "Execute a list of display lists. |
1779 | ||
1780 | N | |
1781 | Specifies the number of display lists to be executed. | |
1782 | ||
1783 | TYPE | |
1784 | Specifies the type of values in LISTS. Symbolic constants | |
1785 | `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', | |
1786 | `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', | |
1787 | `GL_3_BYTES', and `GL_4_BYTES' are accepted. | |
1788 | ||
1789 | LISTS | |
1790 | Specifies the address of an array of name offsets in the display | |
1791 | list. The pointer type is void because the offsets can be bytes, | |
1792 | shorts, ints, or floats, depending on the value of TYPE. | |
1793 | ||
1794 | `glCallLists' causes each display list in the list of names passed as | |
1795 | LISTS to be executed. As a result, the commands saved in each display | |
1796 | list are executed in order, just as if they were called without using a | |
1797 | display list. Names of display lists that have not been defined are | |
1798 | ignored. | |
1799 | ||
1800 | `glCallLists' provides an efficient means for executing more than one | |
1801 | display list. TYPE allows lists with various name formats to be | |
1802 | accepted. The formats are as follows: | |
1803 | ||
1804 | `GL_BYTE' | |
1805 | LISTS is treated as an array of signed bytes, each in the range | |
1806 | -128 through 127. | |
1807 | ||
1808 | `GL_UNSIGNED_BYTE' | |
1809 | LISTS is treated as an array of unsigned bytes, each in the range 0 | |
1810 | through 255. | |
1811 | ||
1812 | `GL_SHORT' | |
1813 | LISTS is treated as an array of signed two-byte integers, each in | |
1814 | the range -32768 through 32767. | |
1815 | ||
1816 | `GL_UNSIGNED_SHORT' | |
1817 | LISTS is treated as an array of unsigned two-byte integers, each in | |
1818 | the range 0 through 65535. | |
1819 | ||
1820 | `GL_INT' | |
1821 | LISTS is treated as an array of signed four-byte integers. | |
1822 | ||
1823 | `GL_UNSIGNED_INT' | |
1824 | LISTS is treated as an array of unsigned four-byte integers. | |
1825 | ||
1826 | `GL_FLOAT' | |
1827 | LISTS is treated as an array of four-byte floating-point values. | |
1828 | ||
1829 | `GL_2_BYTES' | |
1830 | LISTS is treated as an array of unsigned bytes. Each pair of bytes | |
1831 | specifies a single display-list name. The value of the pair is | |
1832 | computed as 256 times the unsigned value of the first byte plus the | |
1833 | unsigned value of the second byte. | |
1834 | ||
1835 | `GL_3_BYTES' | |
1836 | LISTS is treated as an array of unsigned bytes. Each triplet of | |
1837 | bytes specifies a single display-list name. The value of the | |
1838 | triplet is computed as 65536 times the unsigned value of the first | |
1839 | byte, plus 256 times the unsigned value of the second byte, plus | |
1840 | the unsigned value of the third byte. | |
1841 | ||
1842 | `GL_4_BYTES' | |
1843 | LISTS is treated as an array of unsigned bytes. Each quadruplet of | |
1844 | bytes specifies a single display-list name. The value of the | |
1845 | quadruplet is computed as 16777216 times the unsigned value of the | |
1846 | first byte, plus 65536 times the unsigned value of the second byte, | |
1847 | plus 256 times the unsigned value of the third byte, plus the | |
1848 | unsigned value of the fourth byte. | |
1849 | ||
1850 | The list of display-list names is not null-terminated. Rather, N | |
1851 | specifies how many names are to be taken from LISTS. | |
1852 | ||
1853 | An additional level of indirection is made available with the | |
1854 | `glListBase' command, which specifies an unsigned offset that is added | |
1855 | to each display-list name specified in LISTS before that display list is | |
1856 | executed. | |
1857 | ||
1858 | `glCallLists' can appear inside a display list. To avoid the possibility | |
1859 | of infinite recursion resulting from display lists calling one another, | |
1860 | a limit is placed on the nesting level of display lists during | |
1861 | display-list execution. This limit must be at least 64, and it depends | |
1862 | on the implementation. | |
1863 | ||
1864 | GL state is not saved and restored across a call to `glCallLists'. Thus, | |
1865 | changes made to GL state during the execution of the display lists | |
1866 | remain after execution is completed. Use `glPushAttrib', `glPopAttrib', | |
1867 | `glPushMatrix', and `glPopMatrix' to preserve GL state across | |
1868 | `glCallLists' calls. | |
1869 | ||
1870 | `GL_INVALID_VALUE' is generated if N is negative. | |
1871 | ||
1872 | `GL_INVALID_ENUM' is generated if TYPE is not one of `GL_BYTE', | |
1873 | `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT', | |
1874 | `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.") | |
8925f36f AW |
1875 | |
1876 | (define-gl-procedure | |
bb894c9d | 1877 | ((glCallList (list GLuint) -> void)) |
3c9b6116 AW |
1878 | "Execute a display list. |
1879 | ||
1880 | LIST | |
1881 | Specifies the integer name of the display list to be executed. | |
1882 | ||
1883 | `glCallList' causes the named display list to be executed. The commands | |
1884 | saved in the display list are executed in order, just as if they were | |
1885 | called without using a display list. If LIST has not been defined as a | |
1886 | display list, `glCallList' is ignored. | |
1887 | ||
1888 | `glCallList' can appear inside a display list. To avoid the possibility | |
1889 | of infinite recursion resulting from display lists calling one another, | |
1890 | a limit is placed on the nesting level of display lists during | |
1891 | display-list execution. This limit is at least 64, and it depends on the | |
1892 | implementation. | |
1893 | ||
1894 | GL state is not saved and restored across a call to `glCallList'. Thus, | |
1895 | changes made to GL state during the execution of a display list remain | |
1896 | after execution of the display list is completed. Use `glPushAttrib', | |
1897 | `glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state | |
1898 | across `glCallList' calls.") | |
8925f36f AW |
1899 | |
1900 | (define-gl-procedure | |
bb894c9d AW |
1901 | ((glClearAccum |
1902 | (red GLfloat) | |
1903 | (green GLfloat) | |
1904 | (blue GLfloat) | |
1905 | (alpha GLfloat) | |
1906 | -> | |
1907 | void)) | |
3c9b6116 AW |
1908 | "Specify clear values for the accumulation buffer. |
1909 | ||
1910 | RED | |
1911 | GREEN | |
1912 | ||
1913 | BLUE | |
1914 | ||
1915 | ALPHA | |
1916 | ||
1917 | Specify the red, green, blue, and alpha values used when the | |
1918 | accumulation buffer is cleared. The initial values are all 0. | |
1919 | ||
1920 | `glClearAccum' specifies the red, green, blue, and alpha values used by | |
1921 | `glClear' to clear the accumulation buffer. | |
1922 | ||
1923 | Values specified by `glClearAccum' are clamped to the range [-1,1] . | |
1924 | ||
1925 | `GL_INVALID_OPERATION' is generated if `glClearAccum' is executed | |
1926 | between the execution of `glBegin' and the corresponding execution of | |
1927 | `glEnd'.") | |
8925f36f AW |
1928 | |
1929 | (define-gl-procedure | |
bb894c9d AW |
1930 | ((glClearColor |
1931 | (red GLclampf) | |
1932 | (green GLclampf) | |
1933 | (blue GLclampf) | |
1934 | (alpha GLclampf) | |
1935 | -> | |
1936 | void)) | |
3c9b6116 AW |
1937 | "Specify clear values for the color buffers. |
1938 | ||
1939 | RED | |
1940 | GREEN | |
1941 | ||
1942 | BLUE | |
1943 | ||
1944 | ALPHA | |
1945 | ||
1946 | Specify the red, green, blue, and alpha values used when the color | |
1947 | buffers are cleared. The initial values are all 0. | |
1948 | ||
1949 | `glClearColor' specifies the red, green, blue, and alpha values used by | |
1950 | `glClear' to clear the color buffers. Values specified by `glClearColor' | |
1951 | are clamped to the range [0,1] . | |
1952 | ||
1953 | `GL_INVALID_OPERATION' is generated if `glClearColor' is executed | |
1954 | between the execution of `glBegin' and the corresponding execution of | |
1955 | `glEnd'.") | |
8925f36f AW |
1956 | |
1957 | (define-gl-procedure | |
bb894c9d | 1958 | ((glClearDepth (depth GLclampd) -> void)) |
3c9b6116 AW |
1959 | "Specify the clear value for the depth buffer. |
1960 | ||
1961 | DEPTH | |
1962 | Specifies the depth value used when the depth buffer is cleared. | |
1963 | The initial value is 1. | |
1964 | ||
1965 | `glClearDepth' specifies the depth value used by `glClear' to clear the | |
1966 | depth buffer. Values specified by `glClearDepth' are clamped to the | |
1967 | range [0,1] . | |
1968 | ||
1969 | `GL_INVALID_OPERATION' is generated if `glClearDepth' is executed | |
1970 | between the execution of `glBegin' and the corresponding execution of | |
1971 | `glEnd'.") | |
8925f36f AW |
1972 | |
1973 | (define-gl-procedure | |
bb894c9d | 1974 | ((glClearIndex (c GLfloat) -> void)) |
3c9b6116 AW |
1975 | "Specify the clear value for the color index buffers. |
1976 | ||
1977 | C | |
1978 | Specifies the index used when the color index buffers are cleared. | |
1979 | The initial value is 0. | |
1980 | ||
1981 | `glClearIndex' specifies the index used by `glClear' to clear the color | |
1982 | index buffers. C is not clamped. Rather, C is converted to a fixed-point | |
1983 | value with unspecified precision to the right of the binary point. The | |
1984 | integer part of this value is then masked with 2^M-1 , where M is the | |
1985 | number of bits in a color index stored in the frame buffer. | |
1986 | ||
1987 | `GL_INVALID_OPERATION' is generated if `glClearIndex' is executed | |
1988 | between the execution of `glBegin' and the corresponding execution of | |
1989 | `glEnd'.") | |
8925f36f AW |
1990 | |
1991 | (define-gl-procedure | |
bb894c9d | 1992 | ((glClearStencil (s GLint) -> void)) |
3c9b6116 AW |
1993 | "Specify the clear value for the stencil buffer. |
1994 | ||
1995 | S | |
1996 | Specifies the index used when the stencil buffer is cleared. The | |
1997 | initial value is 0. | |
1998 | ||
1999 | `glClearStencil' specifies the index used by `glClear' to clear the | |
2000 | stencil buffer. S is masked with 2^M-1 , where M is the number of bits | |
2001 | in the stencil buffer. | |
2002 | ||
2003 | `GL_INVALID_OPERATION' is generated if `glClearStencil' is executed | |
2004 | between the execution of `glBegin' and the corresponding execution of | |
2005 | `glEnd'.") | |
8925f36f AW |
2006 | |
2007 | (define-gl-procedure | |
bb894c9d | 2008 | ((glClear (mask GLbitfield) -> void)) |
3c9b6116 AW |
2009 | "Clear buffers to preset values. |
2010 | ||
2011 | MASK | |
2012 | Bitwise OR of masks that indicate the buffers to be cleared. The | |
2013 | four masks are `GL_COLOR_BUFFER_BIT', `GL_DEPTH_BUFFER_BIT', | |
2014 | `GL_ACCUM_BUFFER_BIT', and `GL_STENCIL_BUFFER_BIT'. | |
2015 | ||
2016 | `glClear' sets the bitplane area of the window to values previously | |
2017 | selected by `glClearColor', `glClearIndex', `glClearDepth', | |
2018 | `glClearStencil', and `glClearAccum'. Multiple color buffers can be | |
2019 | cleared simultaneously by selecting more than one buffer at a time using | |
2020 | `glDrawBuffer'. | |
2021 | ||
2022 | The pixel ownership test, the scissor test, dithering, and the buffer | |
2023 | writemasks affect the operation of `glClear'. The scissor box bounds the | |
2024 | cleared region. Alpha function, blend function, logical operation, | |
2025 | stenciling, texture mapping, and depth-buffering are ignored by | |
2026 | `glClear'. | |
2027 | ||
2028 | `glClear' takes a single argument that is the bitwise OR of several | |
2029 | values indicating which buffer is to be cleared. | |
2030 | ||
2031 | The values are as follows: | |
2032 | ||
2033 | `GL_COLOR_BUFFER_BIT' | |
2034 | Indicates the buffers currently enabled for color writing. | |
2035 | ||
2036 | `GL_DEPTH_BUFFER_BIT' | |
2037 | Indicates the depth buffer. | |
2038 | ||
2039 | `GL_ACCUM_BUFFER_BIT' | |
2040 | Indicates the accumulation buffer. | |
2041 | ||
2042 | `GL_STENCIL_BUFFER_BIT' | |
2043 | Indicates the stencil buffer. | |
2044 | ||
8925f36f | 2045 | The value to which each buffer is cleared depends on the setting of the |
3c9b6116 AW |
2046 | clear value for that buffer. |
2047 | ||
2048 | `GL_INVALID_VALUE' is generated if any bit other than the four defined | |
2049 | bits is set in MASK. | |
2050 | ||
2051 | `GL_INVALID_OPERATION' is generated if `glClear' is executed between the | |
2052 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
2053 | |
2054 | (define-gl-procedure | |
bb894c9d | 2055 | ((glClientActiveTexture (texture GLenum) -> void)) |
3c9b6116 AW |
2056 | "Select active texture unit. |
2057 | ||
2058 | TEXTURE | |
2059 | Specifies which texture unit to make active. The number of texture | |
2060 | units is implementation dependent, but must be at least two. | |
2061 | TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to | |
2062 | the value of `GL_MAX_TEXTURE_COORDS' - 1, which is an | |
2063 | implementation-dependent value. The initial value is `GL_TEXTURE0'. | |
2064 | ||
2065 | `glClientActiveTexture' selects the vertex array client state parameters | |
2066 | to be modified by `glTexCoordPointer', and enabled or disabled with | |
2067 | `glEnableClientState' or `glDisableClientState', respectively, when | |
2068 | called with a parameter of `GL_TEXTURE_COORD_ARRAY'. | |
2069 | ||
2070 | `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I , | |
2071 | where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.") | |
8925f36f AW |
2072 | |
2073 | (define-gl-procedure | |
bb894c9d | 2074 | ((glClipPlane (plane GLenum) (equation *) -> void)) |
3c9b6116 AW |
2075 | "Specify a plane against which all geometry is clipped. |
2076 | ||
2077 | PLANE | |
2078 | Specifies which clipping plane is being positioned. Symbolic names | |
2079 | of the form `GL_CLIP_PLANE'I, where I is an integer between 0 and | |
2080 | `GL_MAX_CLIP_PLANES' -1 , are accepted. | |
2081 | ||
2082 | EQUATION | |
2083 | Specifies the address of an array of four double-precision | |
2084 | floating-point values. These values are interpreted as a plane | |
2085 | equation. | |
2086 | ||
8925f36f | 2087 | Geometry is always clipped against the boundaries of a six-plane frustum |
3c9b6116 AW |
2088 | in X, Y, and Z. `glClipPlane' allows the specification of additional |
2089 | planes, not necessarily perpendicular to the X, Y, or Z axis, against | |
2090 | which all geometry is clipped. To determine the maximum number of | |
2091 | additional clipping planes, call `glGetIntegerv' with argument | |
2092 | `GL_MAX_CLIP_PLANES'. All implementations support at least six such | |
2093 | clipping planes. Because the resulting clipping region is the | |
2094 | intersection of the defined half-spaces, it is always convex. | |
2095 | ||
2096 | `glClipPlane' specifies a half-space using a four-component plane | |
2097 | equation. When `glClipPlane' is called, EQUATION is transformed by the | |
2098 | inverse of the modelview matrix and stored in the resulting eye | |
2099 | coordinates. Subsequent changes to the modelview matrix have no effect | |
2100 | on the stored plane-equation components. If the dot product of the eye | |
2101 | coordinates of a vertex with the stored plane equation components is | |
2102 | positive or zero, the vertex is IN with respect to that clipping plane. | |
2103 | Otherwise, it is OUT. | |
2104 | ||
2105 | To enable and disable clipping planes, call `glEnable' and `glDisable' | |
2106 | with the argument `GL_CLIP_PLANE'I, where I is the plane number. | |
2107 | ||
2108 | All clipping planes are initially defined as (0, 0, 0, 0) in eye | |
2109 | coordinates and are disabled. | |
2110 | ||
2111 | `GL_INVALID_ENUM' is generated if PLANE is not an accepted value. | |
2112 | ||
2113 | `GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between | |
2114 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
2115 | |
2116 | (define-gl-procedure | |
bb894c9d AW |
2117 | ((glColorMask |
2118 | (red GLboolean) | |
2119 | (green GLboolean) | |
2120 | (blue GLboolean) | |
2121 | (alpha GLboolean) | |
2122 | -> | |
2123 | void)) | |
3c9b6116 AW |
2124 | "Enable and disable writing of frame buffer color components. |
2125 | ||
2126 | RED | |
2127 | GREEN | |
2128 | ||
2129 | BLUE | |
2130 | ||
2131 | ALPHA | |
2132 | ||
2133 | Specify whether red, green, blue, and alpha can or cannot be | |
2134 | written into the frame buffer. The initial values are all | |
2135 | `GL_TRUE', indicating that the color components can be written. | |
2136 | ||
2137 | `glColorMask' specifies whether the individual color components in the | |
2138 | frame buffer can or cannot be written. If RED is `GL_FALSE', for | |
2139 | example, no change is made to the red component of any pixel in any of | |
2140 | the color buffers, regardless of the drawing operation attempted. | |
2141 | ||
2142 | Changes to individual bits of components cannot be controlled. Rather, | |
2143 | changes are either enabled or disabled for entire color components. | |
2144 | ||
2145 | `GL_INVALID_OPERATION' is generated if `glColorMask' is executed between | |
2146 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
2147 | |
2148 | (define-gl-procedure | |
bb894c9d AW |
2149 | ((glColorMaterial |
2150 | (face GLenum) | |
2151 | (mode GLenum) | |
2152 | -> | |
2153 | void)) | |
3c9b6116 AW |
2154 | "Cause a material color to track the current color. |
2155 | ||
2156 | FACE | |
2157 | Specifies whether front, back, or both front and back material | |
2158 | parameters should track the current color. Accepted values are | |
2159 | `GL_FRONT', `GL_BACK', and `GL_FRONT_AND_BACK'. The initial value | |
2160 | is `GL_FRONT_AND_BACK'. | |
2161 | ||
2162 | MODE | |
2163 | Specifies which of several material parameters track the current | |
2164 | color. Accepted values are `GL_EMISSION', `GL_AMBIENT', | |
2165 | `GL_DIFFUSE', `GL_SPECULAR', and `GL_AMBIENT_AND_DIFFUSE'. The | |
2166 | initial value is `GL_AMBIENT_AND_DIFFUSE'. | |
2167 | ||
2168 | `glColorMaterial' specifies which material parameters track the current | |
2169 | color. When `GL_COLOR_MATERIAL' is enabled, the material parameter or | |
2170 | parameters specified by MODE, of the material or materials specified by | |
2171 | FACE, track the current color at all times. | |
2172 | ||
2173 | To enable and disable `GL_COLOR_MATERIAL', call `glEnable' and | |
2174 | `glDisable' with argument `GL_COLOR_MATERIAL'. `GL_COLOR_MATERIAL' is | |
2175 | initially disabled. | |
2176 | ||
2177 | `GL_INVALID_ENUM' is generated if FACE or MODE is not an accepted value. | |
2178 | ||
2179 | `GL_INVALID_OPERATION' is generated if `glColorMaterial' is executed | |
2180 | between the execution of `glBegin' and the corresponding execution of | |
2181 | `glEnd'.") | |
8925f36f AW |
2182 | |
2183 | (define-gl-procedure | |
bb894c9d AW |
2184 | ((glColorPointer |
2185 | (size GLint) | |
2186 | (type GLenum) | |
2187 | (stride GLsizei) | |
2188 | (pointer *) | |
2189 | -> | |
2190 | void)) | |
3c9b6116 AW |
2191 | "Define an array of colors. |
2192 | ||
2193 | SIZE | |
2194 | Specifies the number of components per color. Must be 3 or 4. The | |
2195 | initial value is 4. | |
2196 | ||
2197 | TYPE | |
2198 | Specifies the data type of each color component in the array. | |
2199 | Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', | |
2200 | `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and | |
2201 | `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'. | |
2202 | ||
2203 | STRIDE | |
2204 | Specifies the byte offset between consecutive colors. If STRIDE is | |
2205 | 0, the colors are understood to be tightly packed in the array. The | |
2206 | initial value is 0. | |
2207 | ||
2208 | POINTER | |
2209 | Specifies a pointer to the first component of the first color | |
2210 | element in the array. The initial value is 0. | |
2211 | ||
2212 | `glColorPointer' specifies the location and data format of an array of | |
2213 | color components to use when rendering. SIZE specifies the number of | |
2214 | components per color, and must be 3 or 4. TYPE specifies the data type | |
2215 | of each color component, and STRIDE specifies the byte stride from one | |
2216 | color to the next, allowing vertices and attributes to be packed into a | |
2217 | single array or stored in separate arrays. (Single-array storage may be | |
2218 | more efficient on some implementations; see `glInterleavedArrays'.) | |
2219 | ||
2220 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' | |
2221 | target (see `glBindBuffer') while a color array is specified, POINTER is | |
2222 | treated as a byte offset into the buffer object's data store. Also, the | |
2223 | buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as color | |
2224 | vertex array client-side state (`GL_COLOR_ARRAY_BUFFER_BINDING'). | |
2225 | ||
2226 | When a color array is specified, SIZE, TYPE, STRIDE, and POINTER are | |
2227 | saved as client-side state, in addition to the current vertex array | |
2228 | buffer object binding. | |
2229 | ||
2230 | To enable and disable the color array, call `glEnableClientState' and | |
2231 | `glDisableClientState' with the argument `GL_COLOR_ARRAY'. If enabled, | |
2232 | the color array is used when `glDrawArrays', `glMultiDrawArrays', | |
2233 | `glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or | |
2234 | `glArrayElement' is called. | |
2235 | ||
2236 | `GL_INVALID_VALUE' is generated if SIZE is not 3 or 4. | |
2237 | ||
2238 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
2239 | ||
2240 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
8925f36f AW |
2241 | |
2242 | (define-gl-procedure | |
bb894c9d AW |
2243 | ((glColorSubTable |
2244 | (target GLenum) | |
2245 | (start GLsizei) | |
2246 | (count GLsizei) | |
2247 | (format GLenum) | |
2248 | (type GLenum) | |
2249 | (data *) | |
2250 | -> | |
2251 | void)) | |
3c9b6116 AW |
2252 | "Respecify a portion of a color table. |
2253 | ||
2254 | TARGET | |
2255 | Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', | |
2256 | or `GL_POST_COLOR_MATRIX_COLOR_TABLE'. | |
2257 | ||
2258 | START | |
2259 | The starting index of the portion of the color table to be | |
2260 | replaced. | |
2261 | ||
2262 | COUNT | |
2263 | The number of table entries to replace. | |
2264 | ||
2265 | FORMAT | |
2266 | The format of the pixel data in DATA. The allowable values are | |
2267 | `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', | |
2268 | `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'. | |
2269 | ||
2270 | TYPE | |
2271 | The type of the pixel data in DATA. The allowable values are | |
2272 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT', | |
2273 | `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', | |
2274 | `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5', | |
2275 | `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4', | |
2276 | `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1', | |
2277 | `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8', | |
2278 | `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and | |
2279 | `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
2280 | ||
2281 | DATA | |
2282 | Pointer to a one-dimensional array of pixel data that is processed | |
2283 | to replace the specified region of the color table. | |
2284 | ||
2285 | `glColorSubTable' is used to respecify a contiguous portion of a color | |
2286 | table previously defined using `glColorTable'. The pixels referenced by | |
2287 | DATA replace the portion of the existing table from indices START to | |
2288 | START+COUNT-1 , inclusive. This region may not include any entries | |
2289 | outside the range of the color table as it was originally specified. It | |
2290 | is not an error to specify a subtexture with width of 0, but such a | |
2291 | specification has no effect. | |
2292 | ||
2293 | If a non-zero named buffer object is bound to the | |
2294 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a portion of | |
2295 | a color table is respecified, DATA is treated as a byte offset into the | |
2296 | buffer object's data store. | |
2297 | ||
2298 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
2299 | values. | |
2300 | ||
2301 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
2302 | values. | |
2303 | ||
2304 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable | |
2305 | values. | |
2306 | ||
2307 | `GL_INVALID_VALUE' is generated if START+COUNT>WIDTH . | |
2308 | ||
2309 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2310 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
2311 | data store is currently mapped. | |
2312 | ||
2313 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2314 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
2315 | unpacked from the buffer object such that the memory reads required | |
2316 | would exceed the data store size. | |
2317 | ||
2318 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2319 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
2320 | divisible into the number of bytes needed to store in memory a datum | |
2321 | indicated by TYPE. | |
2322 | ||
2323 | `GL_INVALID_OPERATION' is generated if `glColorSubTable' is executed | |
2324 | between the execution of `glBegin' and the corresponding execution of | |
2325 | `glEnd'.") | |
8925f36f AW |
2326 | |
2327 | (define-gl-procedure | |
bb894c9d AW |
2328 | ((glColorTable |
2329 | (target GLenum) | |
2330 | (internalformat GLenum) | |
2331 | (width GLsizei) | |
2332 | (format GLenum) | |
2333 | (type GLenum) | |
2334 | (data *) | |
2335 | -> | |
2336 | void)) | |
3c9b6116 | 2337 | "Define a color lookup table. |
8925f36f | 2338 | |
3c9b6116 AW |
2339 | TARGET |
2340 | Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', | |
2341 | `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE', | |
2342 | `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or | |
2343 | `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'. | |
8925f36f | 2344 | |
3c9b6116 AW |
2345 | INTERNALFORMAT |
2346 | The internal format of the color table. The allowable values are | |
2347 | `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', | |
2348 | `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12', | |
2349 | `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
2350 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
2351 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
2352 | `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4', | |
2353 | `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2', | |
2354 | `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', | |
2355 | `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', | |
2356 | `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', and `GL_RGBA16'. | |
8925f36f | 2357 | |
3c9b6116 AW |
2358 | WIDTH |
2359 | The number of entries in the color lookup table specified by DATA. | |
8925f36f | 2360 | |
3c9b6116 AW |
2361 | FORMAT |
2362 | The format of the pixel data in DATA. The allowable values are | |
2363 | `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', | |
2364 | `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'. | |
8925f36f | 2365 | |
3c9b6116 AW |
2366 | TYPE |
2367 | The type of the pixel data in DATA. The allowable values are | |
2368 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT', | |
2369 | `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', | |
2370 | `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5', | |
2371 | `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4', | |
2372 | `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1', | |
2373 | `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8', | |
2374 | `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and | |
2375 | `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
2376 | ||
2377 | DATA | |
2378 | Pointer to a one-dimensional array of pixel data that is processed | |
2379 | to build the color table. | |
2380 | ||
2381 | `glColorTable' may be used in two ways: to test the actual size and | |
2382 | color resolution of a lookup table given a particular set of parameters, | |
2383 | or to load the contents of a color lookup table. Use the targets | |
2384 | `GL_PROXY_*' for the first case and the other targets for the second | |
2385 | case. | |
2386 | ||
2387 | If a non-zero named buffer object is bound to the | |
2388 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a color table | |
2389 | is specified, DATA is treated as a byte offset into the buffer object's | |
2390 | data store. | |
2391 | ||
2392 | If TARGET is `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or | |
2393 | `GL_POST_COLOR_MATRIX_COLOR_TABLE', `glColorTable' builds a color lookup | |
2394 | table from an array of pixels. The pixel array specified by WIDTH, | |
2395 | FORMAT, TYPE, and DATA is extracted from memory and processed just as if | |
2396 | `glDrawPixels' were called, but processing stops after the final | |
2397 | expansion to RGBA is completed. | |
2398 | ||
2399 | The four scale parameters and the four bias parameters that are defined | |
2400 | for the table are then used to scale and bias the R, G, B, and A | |
2401 | components of each pixel. (Use `glColorTableParameter' to set these | |
2402 | scale and bias parameters.) | |
2403 | ||
2404 | Next, the R, G, B, and A values are clamped to the range [0,1] . Each | |
2405 | pixel is then converted to the internal format specified by | |
2406 | INTERNALFORMAT. This conversion simply maps the component values of the | |
2407 | pixel (R, G, B, and A) to the values included in the internal format | |
2408 | (red, green, blue, alpha, luminance, and intensity). The mapping is as | |
2409 | follows: | |
2410 | ||
2411 | ||
2412 | ||
2413 | *Internal Format* | |
2414 | *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity* | |
2415 | ||
2416 | `GL_ALPHA' | |
2417 | , , , A , , | |
2418 | ||
2419 | `GL_LUMINANCE' | |
2420 | , , , , R , | |
2421 | ||
2422 | `GL_LUMINANCE_ALPHA' | |
2423 | , , , A , R , | |
2424 | ||
2425 | `GL_INTENSITY' | |
2426 | , , , , , R | |
2427 | ||
2428 | `GL_RGB' | |
2429 | R , G , B , , , | |
2430 | ||
2431 | `GL_RGBA' | |
2432 | R , G , B , A , , | |
2433 | ||
2434 | Finally, the red, green, blue, alpha, luminance, and/or intensity | |
2435 | components of the resulting pixels are stored in the color table. They | |
2436 | form a one-dimensional table with indices in the range [0,WIDTH-1] . | |
2437 | ||
2438 | If TARGET is `GL_PROXY_*', `glColorTable' recomputes and stores the | |
2439 | values of the proxy color table's state variables | |
2440 | `GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH', | |
2441 | `GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE', | |
2442 | `GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE', | |
2443 | `GL_COLOR_TABLE_LUMINANCE_SIZE', and `GL_COLOR_TABLE_INTENSITY_SIZE'. | |
2444 | There is no effect on the image or state of any actual color table. If | |
2445 | the specified color table is too large to be supported, then all the | |
2446 | proxy state variables listed above are set to zero. Otherwise, the color | |
2447 | table could be supported by `glColorTable' using the corresponding | |
2448 | non-proxy target, and the proxy state variables are set as if that | |
2449 | target were being defined. | |
2450 | ||
2451 | The proxy state variables can be retrieved by calling | |
2452 | `glGetColorTableParameter' with a target of `GL_PROXY_*'. This allows | |
2453 | the application to decide if a particular `glColorTable' command would | |
2454 | succeed, and to determine what the resulting color table attributes | |
2455 | would be. | |
2456 | ||
2457 | If a color table is enabled, and its width is non-zero, then its | |
2458 | contents are used to replace a subset of the components of each RGBA | |
2459 | pixel group, based on the internal format of the table. | |
2460 | ||
2461 | Each pixel group has color components (R, G, B, A) that are in the range | |
2462 | [0.0,1.0] . The color components are rescaled to the size of the color | |
2463 | lookup table to form an index. Then a subset of the components based on | |
2464 | the internal format of the table are replaced by the table entry | |
2465 | selected by that index. If the color components and contents of the | |
2466 | table are represented as follows: | |
2467 | ||
2468 | ||
2469 | ||
2470 | *Representation* | |
2471 | *Meaning* | |
2472 | ||
2473 | `r' | |
2474 | Table index computed from `R' | |
2475 | ||
2476 | `g' | |
2477 | Table index computed from `G' | |
2478 | ||
2479 | `b' | |
2480 | Table index computed from `B' | |
2481 | ||
2482 | `a' | |
2483 | Table index computed from `A' | |
2484 | ||
2485 | `L[i]' | |
2486 | Luminance value at table index `i' | |
2487 | ||
2488 | `I[i]' | |
2489 | Intensity value at table index `i' | |
2490 | ||
2491 | `R[i]' | |
2492 | Red value at table index `i' | |
2493 | ||
2494 | `G[i]' | |
2495 | Green value at table index `i' | |
2496 | ||
2497 | `B[i]' | |
2498 | Blue value at table index `i' | |
2499 | ||
2500 | `A[i]' | |
2501 | Alpha value at table index `i' | |
2502 | ||
2503 | then the result of color table lookup is as follows: | |
2504 | ||
2505 | ||
2506 | ||
2507 | ** | |
2508 | *Resulting Texture Components* | |
2509 | ||
2510 | *Table Internal Format* | |
2511 | *R*, *G*, *B*, *A* | |
2512 | ||
2513 | `GL_ALPHA' | |
2514 | `R', `G', `B', `A[a]' | |
2515 | ||
2516 | `GL_LUMINANCE' | |
2517 | `L[r]', `L[g]', `L[b]', `At' | |
2518 | ||
2519 | `GL_LUMINANCE_ALPHA' | |
2520 | `L[r]', `L[g]', `L[b]', `A[a]' | |
2521 | ||
2522 | `GL_INTENSITY' | |
2523 | `I[r]', `I[g]', `I[b]', `I[a]' | |
2524 | ||
2525 | `GL_RGB' | |
2526 | `R[r]', `G[g]', `B[b]', `A' | |
2527 | ||
2528 | `GL_RGBA' | |
2529 | `R[r]', `G[g]', `B[b]', `A[a]' | |
2530 | ||
2531 | When `GL_COLOR_TABLE' is enabled, the colors resulting from the pixel | |
2532 | map operation (if it is enabled) are mapped by the color lookup table | |
2533 | before being passed to the convolution operation. The colors resulting | |
2534 | from the convolution operation are modified by the post convolution | |
2535 | color lookup table when `GL_POST_CONVOLUTION_COLOR_TABLE' is enabled. | |
2536 | These modified colors are then sent to the color matrix operation. | |
2537 | Finally, if `GL_POST_COLOR_MATRIX_COLOR_TABLE' is enabled, the colors | |
2538 | resulting from the color matrix operation are mapped by the post color | |
2539 | matrix color lookup table before being used by the histogram operation. | |
2540 | ||
2541 | ||
2542 | ||
2543 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
2544 | values. | |
2545 | ||
2546 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the | |
2547 | allowable values. | |
2548 | ||
2549 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
2550 | values. | |
2551 | ||
2552 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable | |
2553 | values. | |
2554 | ||
2555 | `GL_INVALID_VALUE' is generated if WIDTH is less than zero. | |
2556 | ||
2557 | `GL_TABLE_TOO_LARGE' is generated if the requested color table is too | |
2558 | large to be supported by the implementation, and TARGET is not a | |
2559 | `GL_PROXY_*' target. | |
2560 | ||
2561 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2562 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
2563 | data store is currently mapped. | |
2564 | ||
2565 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2566 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
2567 | unpacked from the buffer object such that the memory reads required | |
2568 | would exceed the data store size. | |
2569 | ||
2570 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2571 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
2572 | divisible into the number of bytes needed to store in memory a datum | |
2573 | indicated by TYPE. | |
2574 | ||
2575 | `GL_INVALID_OPERATION' is generated if `glColorTable' is executed | |
2576 | between the execution of `glBegin' and the corresponding execution of | |
2577 | `glEnd'.") | |
2578 | ||
2579 | (define-gl-procedure | |
bb894c9d AW |
2580 | ((glColor3i |
2581 | (red GLint) | |
2582 | (green GLint) | |
2583 | (blue GLint) | |
2584 | -> | |
2585 | void) | |
2586 | (glColor3d | |
2587 | (red GLdouble) | |
2588 | (green GLdouble) | |
2589 | (blue GLdouble) | |
2590 | -> | |
2591 | void) | |
2592 | (glColor3ui | |
2593 | (red GLuint) | |
2594 | (green GLuint) | |
2595 | (blue GLuint) | |
2596 | -> | |
2597 | void) | |
2598 | (glColor4i | |
2599 | (red GLint) | |
2600 | (green GLint) | |
2601 | (blue GLint) | |
2602 | (alpha GLint) | |
2603 | -> | |
2604 | void) | |
2605 | (glColor4d | |
2606 | (red GLdouble) | |
2607 | (green GLdouble) | |
2608 | (blue GLdouble) | |
2609 | (alpha GLdouble) | |
2610 | -> | |
2611 | void) | |
2612 | (glColor4ui | |
2613 | (red GLuint) | |
2614 | (green GLuint) | |
2615 | (blue GLuint) | |
2616 | (alpha GLuint) | |
2617 | -> | |
2618 | void)) | |
3c9b6116 AW |
2619 | "Set the current color. |
2620 | ||
2621 | RED | |
2622 | GREEN | |
2623 | ||
2624 | BLUE | |
2625 | ||
2626 | Specify new red, green, and blue values for the current color. | |
2627 | ||
2628 | ALPHA | |
2629 | Specifies a new alpha value for the current color. Included only in | |
2630 | the four-argument `glColor4' commands. | |
2631 | ||
2632 | The GL stores both a current single-valued color index and a current | |
2633 | four-valued RGBA color. `glColor' sets a new four-valued RGBA color. | |
2634 | `glColor' has two major variants: `glColor3' and `glColor4'. `glColor3' | |
2635 | variants specify new red, green, and blue values explicitly and set the | |
2636 | current alpha value to 1.0 (full intensity) implicitly. `glColor4' | |
2637 | variants specify all four color components explicitly. | |
2638 | ||
2639 | `glColor3b', `glColor4b', `glColor3s', `glColor4s', `glColor3i', and | |
2640 | `glColor4i' take three or four signed byte, short, or long integers as | |
2641 | arguments. When *v* is appended to the name, the color commands can take | |
2642 | a pointer to an array of such values. | |
2643 | ||
2644 | Current color values are stored in floating-point format, with | |
2645 | unspecified mantissa and exponent sizes. Unsigned integer color | |
2646 | components, when specified, are linearly mapped to floating-point values | |
2647 | such that the largest representable value maps to 1.0 (full intensity), | |
2648 | and 0 maps to 0.0 (zero intensity). Signed integer color components, | |
2649 | when specified, are linearly mapped to floating-point values such that | |
2650 | the most positive representable value maps to 1.0, and the most negative | |
2651 | representable value maps to -1.0 . (Note that this mapping does not | |
2652 | convert 0 precisely to 0.0.) Floating-point values are mapped directly. | |
2653 | ||
2654 | Neither floating-point nor signed integer values are clamped to the | |
2655 | range [0,1] before the current color is updated. However, color | |
2656 | components are clamped to this range before they are interpolated or | |
2657 | written into a color buffer.") | |
2658 | ||
2659 | (define-gl-procedure | |
bb894c9d | 2660 | ((glCompileShader (shader GLuint) -> void)) |
3c9b6116 AW |
2661 | "Compiles a shader object. |
2662 | ||
2663 | SHADER | |
2664 | Specifies the shader object to be compiled. | |
2665 | ||
2666 | `glCompileShader' compiles the source code strings that have been stored | |
2667 | in the shader object specified by SHADER. | |
2668 | ||
2669 | The compilation status will be stored as part of the shader object's | |
2670 | state. This value will be set to `GL_TRUE' if the shader was compiled | |
2671 | without errors and is ready for use, and `GL_FALSE' otherwise. It can be | |
2672 | queried by calling `glGetShader' with arguments SHADER and | |
2673 | `GL_COMPILE_STATUS'. | |
2674 | ||
2675 | Compilation of a shader can fail for a number of reasons as specified by | |
2676 | the OpenGL Shading Language Specification. Whether or not the | |
2677 | compilation was successful, information about the compilation can be | |
2678 | obtained from the shader object's information log by calling | |
2679 | `glGetShaderInfoLog'. | |
2680 | ||
2681 | `GL_INVALID_VALUE' is generated if SHADER is not a value generated by | |
2682 | OpenGL. | |
2683 | ||
2684 | `GL_INVALID_OPERATION' is generated if SHADER is not a shader object. | |
2685 | ||
2686 | `GL_INVALID_OPERATION' is generated if `glCompileShader' is executed | |
2687 | between the execution of `glBegin' and the corresponding execution of | |
2688 | `glEnd'.") | |
2689 | ||
2690 | (define-gl-procedure | |
bb894c9d AW |
2691 | ((glCompressedTexImage1D |
2692 | (target GLenum) | |
2693 | (level GLint) | |
2694 | (internalformat GLenum) | |
2695 | (width GLsizei) | |
2696 | (border GLint) | |
2697 | (imageSize GLsizei) | |
2698 | (data *) | |
2699 | -> | |
2700 | void)) | |
3c9b6116 AW |
2701 | "Specify a one-dimensional texture image in a compressed format. |
2702 | ||
2703 | TARGET | |
2704 | Specifies the target texture. Must be `GL_TEXTURE_1D' or | |
2705 | `GL_PROXY_TEXTURE_1D'. | |
2706 | ||
2707 | LEVEL | |
2708 | Specifies the level-of-detail number. Level 0 is the base image | |
2709 | level. Level N is the Nth mipmap reduction image. | |
2710 | ||
2711 | INTERNALFORMAT | |
2712 | Specifies the format of the compressed image data stored at address | |
2713 | DATA. | |
2714 | ||
2715 | WIDTH | |
2716 | Specifies the width of the texture image including the border if | |
2717 | any. If the GL version does not support non-power-of-two sizes, | |
2718 | this value must be 2^N+2\u2061(BORDER,) for some integer N . All | |
2719 | implementations support texture images that are at least 64 texels | |
2720 | wide. The height of the 1D texture image is 1. | |
2721 | ||
2722 | BORDER | |
2723 | Specifies the width of the border. Must be either 0 or 1. | |
2724 | ||
2725 | IMAGESIZE | |
2726 | Specifies the number of unsigned bytes of image data starting at | |
2727 | the address specified by DATA. | |
2728 | ||
2729 | DATA | |
2730 | Specifies a pointer to the compressed image data in memory. | |
2731 | ||
2732 | Texturing maps a portion of a specified texture image onto each | |
2733 | graphical primitive for which texturing is enabled. To enable and | |
2734 | disable one-dimensional texturing, call `glEnable' and `glDisable' with | |
2735 | argument `GL_TEXTURE_1D'. | |
2736 | ||
2737 | `glCompressedTexImage1D' loads a previously defined, and retrieved, | |
2738 | compressed one-dimensional texture image if TARGET is `GL_TEXTURE_1D' | |
2739 | (see `glTexImage1D'). | |
2740 | ||
2741 | If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all | |
2742 | of the texture image state is recalculated, checked for consistency, and | |
2743 | checked against the implementation's capabilities. If the implementation | |
2744 | cannot handle a texture of the requested texture size, it sets all of | |
2745 | the image state to 0, but does not generate an error (see `glGetError'). | |
2746 | To query for an entire mipmap array, use an image array level greater | |
2747 | than or equal to 1. | |
2748 | ||
2749 | INTERNALFORMAT must be extension-specified compressed-texture format. | |
2750 | When a texture is loaded with `glTexImage1D' using a generic compressed | |
2751 | texture format (e.g., `GL_COMPRESSED_RGB') the GL selects from one of | |
2752 | its extensions supporting compressed textures. In order to load the | |
2753 | compressed texture image using `glCompressedTexImage1D', query the | |
2754 | compressed texture image's size and format using | |
2755 | `glGetTexLevelParameter'. | |
2756 | ||
2757 | If a non-zero named buffer object is bound to the | |
2758 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
2759 | image is specified, DATA is treated as a byte offset into the buffer | |
2760 | object's data store. | |
2761 | ||
2762 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic | |
2763 | compressed internal formats: `GL_COMPRESSED_ALPHA', | |
2764 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
2765 | `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'. | |
2766 | ||
2767 | `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the | |
2768 | format, dimensions, and contents of the specified compressed image data. | |
2769 | ||
2770 | `GL_INVALID_OPERATION' is generated if parameter combinations are not | |
2771 | supported by the specific compressed internal format as specified in the | |
2772 | specific texture compression extension. | |
2773 | ||
2774 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2775 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
2776 | data store is currently mapped. | |
2777 | ||
2778 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2779 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
2780 | unpacked from the buffer object such that the memory reads required | |
2781 | would exceed the data store size. | |
2782 | ||
2783 | `GL_INVALID_OPERATION' is generated if `glCompressedTexImage1D' is | |
2784 | executed between the execution of `glBegin' and the corresponding | |
2785 | execution of `glEnd'. | |
2786 | ||
2787 | Undefined results, including abnormal program termination, are generated | |
2788 | if DATA is not encoded in a manner consistent with the extension | |
2789 | specification defining the internal compression format.") | |
2790 | ||
2791 | (define-gl-procedure | |
bb894c9d AW |
2792 | ((glCompressedTexImage2D |
2793 | (target GLenum) | |
2794 | (level GLint) | |
2795 | (internalformat GLenum) | |
2796 | (width GLsizei) | |
2797 | (height GLsizei) | |
2798 | (border GLint) | |
2799 | (imageSize GLsizei) | |
2800 | (data *) | |
2801 | -> | |
2802 | void)) | |
3c9b6116 AW |
2803 | "Specify a two-dimensional texture image in a compressed format. |
2804 | ||
2805 | TARGET | |
2806 | Specifies the target texture. Must be `GL_TEXTURE_2D', | |
2807 | `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X', | |
2808 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', | |
2809 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', | |
2810 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'. | |
2811 | ||
2812 | LEVEL | |
2813 | Specifies the level-of-detail number. Level 0 is the base image | |
2814 | level. Level N is the Nth mipmap reduction image. | |
2815 | ||
2816 | INTERNALFORMAT | |
2817 | Specifies the format of the compressed image data stored at address | |
2818 | DATA. | |
2819 | ||
2820 | WIDTH | |
2821 | Specifies the width of the texture image including the border if | |
2822 | any. If the GL version does not support non-power-of-two sizes, | |
2823 | this value must be 2^N+2\u2061(BORDER,) for some integer N . All | |
2824 | implementations support 2D texture images that are at least 64 | |
2825 | texels wide and cube-mapped texture images that are at least 16 | |
2826 | texels wide. | |
2827 | ||
2828 | HEIGHT | |
2829 | Specifies the height of the texture image including the border if | |
2830 | any. If the GL version does not support non-power-of-two sizes, | |
2831 | this value must be Must be 2^N+2\u2061(BORDER,) for some integer N . All | |
2832 | implementations support 2D texture images that are at least 64 | |
2833 | texels high and cube-mapped texture images that are at least 16 | |
2834 | texels high. | |
2835 | ||
2836 | BORDER | |
2837 | Specifies the width of the border. Must be either 0 or 1. | |
2838 | ||
2839 | IMAGESIZE | |
2840 | Specifies the number of unsigned bytes of image data starting at | |
2841 | the address specified by DATA. | |
2842 | ||
2843 | DATA | |
2844 | Specifies a pointer to the compressed image data in memory. | |
2845 | ||
2846 | Texturing maps a portion of a specified texture image onto each | |
2847 | graphical primitive for which texturing is enabled. To enable and | |
2848 | disable two-dimensional texturing, call `glEnable' and `glDisable' with | |
2849 | argument `GL_TEXTURE_2D'. To enable and disable texturing using | |
2850 | cube-mapped textures, call `glEnable' and `glDisable' with argument | |
2851 | `GL_TEXTURE_CUBE_MAP'. | |
2852 | ||
2853 | `glCompressedTexImage2D' loads a previously defined, and retrieved, | |
2854 | compressed two-dimensional texture image if TARGET is `GL_TEXTURE_2D' | |
2855 | (see `glTexImage2D'). | |
2856 | ||
2857 | If TARGET is `GL_PROXY_TEXTURE_2D', no data is read from DATA, but all | |
2858 | of the texture image state is recalculated, checked for consistency, and | |
2859 | checked against the implementation's capabilities. If the implementation | |
2860 | cannot handle a texture of the requested texture size, it sets all of | |
2861 | the image state to 0, but does not generate an error (see `glGetError'). | |
2862 | To query for an entire mipmap array, use an image array level greater | |
2863 | than or equal to 1. | |
2864 | ||
2865 | INTERNALFORMAT must be an extension-specified compressed-texture format. | |
2866 | When a texture is loaded with `glTexImage2D' using a generic compressed | |
2867 | texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of | |
2868 | its extensions supporting compressed textures. In order to load the | |
2869 | compressed texture image using `glCompressedTexImage2D', query the | |
2870 | compressed texture image's size and format using | |
2871 | `glGetTexLevelParameter'. | |
2872 | ||
2873 | If a non-zero named buffer object is bound to the | |
2874 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
2875 | image is specified, DATA is treated as a byte offset into the buffer | |
2876 | object's data store. | |
2877 | ||
2878 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic | |
2879 | compressed internal formats: `GL_COMPRESSED_ALPHA', | |
2880 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
2881 | `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'. | |
2882 | ||
2883 | `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the | |
2884 | format, dimensions, and contents of the specified compressed image data. | |
2885 | ||
2886 | `GL_INVALID_OPERATION' is generated if parameter combinations are not | |
2887 | supported by the specific compressed internal format as specified in the | |
2888 | specific texture compression extension. | |
2889 | ||
2890 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2891 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
2892 | data store is currently mapped. | |
2893 | ||
2894 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
2895 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
2896 | unpacked from the buffer object such that the memory reads required | |
2897 | would exceed the data store size. | |
2898 | ||
2899 | `GL_INVALID_OPERATION' is generated if `glCompressedTexImage2D' is | |
2900 | executed between the execution of `glBegin' and the corresponding | |
2901 | execution of `glEnd'. | |
2902 | ||
2903 | Undefined results, including abnormal program termination, are generated | |
2904 | if DATA is not encoded in a manner consistent with the extension | |
2905 | specification defining the internal compression format.") | |
2906 | ||
2907 | (define-gl-procedure | |
bb894c9d AW |
2908 | ((glCompressedTexImage3D |
2909 | (target GLenum) | |
2910 | (level GLint) | |
2911 | (internalformat GLenum) | |
2912 | (width GLsizei) | |
2913 | (height GLsizei) | |
2914 | (depth GLsizei) | |
2915 | (border GLint) | |
2916 | (imageSize GLsizei) | |
2917 | (data *) | |
2918 | -> | |
2919 | void)) | |
3c9b6116 AW |
2920 | "Specify a three-dimensional texture image in a compressed format. |
2921 | ||
2922 | TARGET | |
2923 | Specifies the target texture. Must be `GL_TEXTURE_3D' or | |
2924 | `GL_PROXY_TEXTURE_3D'. | |
2925 | ||
2926 | LEVEL | |
2927 | Specifies the level-of-detail number. Level 0 is the base image | |
2928 | level. Level N is the Nth mipmap reduction image. | |
2929 | ||
2930 | INTERNALFORMAT | |
2931 | Specifies the format of the compressed image data stored at address | |
2932 | DATA. | |
2933 | ||
2934 | WIDTH | |
2935 | Specifies the width of the texture image including the border if | |
2936 | any. If the GL version does not support non-power-of-two sizes, | |
2937 | this value must be 2^N+2\u2061(BORDER,) for some integer N . All | |
2938 | implementations support 3D texture images that are at least 16 | |
2939 | texels wide. | |
2940 | ||
2941 | HEIGHT | |
2942 | Specifies the height of the texture image including the border if | |
2943 | any. If the GL version does not support non-power-of-two sizes, | |
2944 | this value must be 2^N+2\u2061(BORDER,) for some integer N . All | |
2945 | implementations support 3D texture images that are at least 16 | |
2946 | texels high. | |
2947 | ||
2948 | DEPTH | |
2949 | Specifies the depth of the texture image including the border if | |
2950 | any. If the GL version does not support non-power-of-two sizes, | |
2951 | this value must be 2^N+2\u2061(BORDER,) for some integer N . All | |
2952 | implementations support 3D texture images that are at least 16 | |
2953 | texels deep. | |
2954 | ||
2955 | BORDER | |
2956 | Specifies the width of the border. Must be either 0 or 1. | |
2957 | ||
2958 | IMAGESIZE | |
2959 | Specifies the number of unsigned bytes of image data starting at | |
2960 | the address specified by DATA. | |
2961 | ||
2962 | DATA | |
2963 | Specifies a pointer to the compressed image data in memory. | |
2964 | ||
2965 | Texturing maps a portion of a specified texture image onto each | |
2966 | graphical primitive for which texturing is enabled. To enable and | |
2967 | disable three-dimensional texturing, call `glEnable' and `glDisable' | |
2968 | with argument `GL_TEXTURE_3D'. | |
2969 | ||
2970 | `glCompressedTexImage3D' loads a previously defined, and retrieved, | |
2971 | compressed three-dimensional texture image if TARGET is `GL_TEXTURE_3D' | |
2972 | (see `glTexImage3D'). | |
2973 | ||
2974 | If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all | |
2975 | of the texture image state is recalculated, checked for consistency, and | |
2976 | checked against the implementation's capabilities. If the implementation | |
2977 | cannot handle a texture of the requested texture size, it sets all of | |
2978 | the image state to 0, but does not generate an error (see `glGetError'). | |
2979 | To query for an entire mipmap array, use an image array level greater | |
2980 | than or equal to 1. | |
2981 | ||
2982 | INTERNALFORMAT must be an extension-specified compressed-texture format. | |
2983 | When a texture is loaded with `glTexImage2D' using a generic compressed | |
2984 | texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of | |
2985 | its extensions supporting compressed textures. In order to load the | |
2986 | compressed texture image using `glCompressedTexImage3D', query the | |
2987 | compressed texture image's size and format using | |
2988 | `glGetTexLevelParameter'. | |
2989 | ||
2990 | If a non-zero named buffer object is bound to the | |
2991 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
2992 | image is specified, DATA is treated as a byte offset into the buffer | |
2993 | object's data store. | |
2994 | ||
2995 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic | |
2996 | compressed internal formats: `GL_COMPRESSED_ALPHA', | |
2997 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
2998 | `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'. | |
2999 | ||
3000 | `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the | |
3001 | format, dimensions, and contents of the specified compressed image data. | |
3002 | ||
3003 | `GL_INVALID_OPERATION' is generated if parameter combinations are not | |
3004 | supported by the specific compressed internal format as specified in the | |
3005 | specific texture compression extension. | |
3006 | ||
3007 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3008 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
3009 | data store is currently mapped. | |
3010 | ||
3011 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3012 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
3013 | unpacked from the buffer object such that the memory reads required | |
3014 | would exceed the data store size. | |
3015 | ||
3016 | `GL_INVALID_OPERATION' is generated if `glCompressedTexImage3D' is | |
3017 | executed between the execution of `glBegin' and the corresponding | |
3018 | execution of `glEnd'. | |
3019 | ||
3020 | Undefined results, including abnormal program termination, are generated | |
3021 | if DATA is not encoded in a manner consistent with the extension | |
3022 | specification defining the internal compression format.") | |
8925f36f AW |
3023 | |
3024 | (define-gl-procedure | |
bb894c9d AW |
3025 | ((glCompressedTexSubImage1D |
3026 | (target GLenum) | |
3027 | (level GLint) | |
3028 | (xoffset GLint) | |
3029 | (width GLsizei) | |
3030 | (format GLenum) | |
3031 | (imageSize GLsizei) | |
3032 | (data *) | |
3033 | -> | |
3034 | void)) | |
3c9b6116 AW |
3035 | "Specify a one-dimensional texture subimage in a compressed format. |
3036 | ||
3037 | TARGET | |
3038 | Specifies the target texture. Must be `GL_TEXTURE_1D'. | |
3039 | ||
3040 | LEVEL | |
3041 | Specifies the level-of-detail number. Level 0 is the base image | |
3042 | level. Level N is the Nth mipmap reduction image. | |
3043 | ||
3044 | XOFFSET | |
3045 | Specifies a texel offset in the x direction within the texture | |
3046 | array. | |
3047 | ||
3048 | WIDTH | |
3049 | Specifies the width of the texture subimage. | |
3050 | ||
3051 | FORMAT | |
3052 | Specifies the format of the compressed image data stored at address | |
3053 | DATA. | |
3054 | ||
3055 | IMAGESIZE | |
3056 | Specifies the number of unsigned bytes of image data starting at | |
3057 | the address specified by DATA. | |
3058 | ||
3059 | DATA | |
3060 | Specifies a pointer to the compressed image data in memory. | |
3061 | ||
3062 | Texturing maps a portion of a specified texture image onto each | |
3063 | graphical primitive for which texturing is enabled. To enable and | |
3064 | disable one-dimensional texturing, call `glEnable' and `glDisable' with | |
3065 | argument `GL_TEXTURE_1D'. | |
3066 | ||
3067 | `glCompressedTexSubImage1D' redefines a contiguous subregion of an | |
3068 | existing one-dimensional texture image. The texels referenced by DATA | |
3069 | replace the portion of the existing texture array with x indices XOFFSET | |
3070 | and XOFFSET+WIDTH-1 , inclusive. This region may not include any texels | |
3071 | outside the range of the texture array as it was originally specified. | |
3072 | It is not an error to specify a subtexture with width of 0, but such a | |
3073 | specification has no effect. | |
3074 | ||
3075 | FORMAT must be an extension-specified compressed-texture format. The | |
3076 | FORMAT of the compressed texture image is selected by the GL | |
3077 | implementation that compressed it (see `glTexImage1D'), and should be | |
3078 | queried at the time the texture was compressed with | |
3079 | `glGetTexLevelParameter'. | |
3080 | ||
3081 | If a non-zero named buffer object is bound to the | |
3082 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
3083 | image is specified, DATA is treated as a byte offset into the buffer | |
3084 | object's data store. | |
3085 | ||
3086 | `GL_INVALID_ENUM' is generated if FORMAT is one of these generic | |
3087 | compressed internal formats: `GL_COMPRESSED_ALPHA', | |
3088 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
3089 | `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', | |
3090 | `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA', | |
3091 | `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or | |
3092 | `GL_COMPRESSED_SRGB_ALPHA'. | |
3093 | ||
3094 | `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the | |
3095 | format, dimensions, and contents of the specified compressed image data. | |
3096 | ||
3097 | `GL_INVALID_OPERATION' is generated if parameter combinations are not | |
3098 | supported by the specific compressed internal format as specified in the | |
3099 | specific texture compression extension. | |
3100 | ||
3101 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3102 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
3103 | data store is currently mapped. | |
3104 | ||
3105 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3106 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
3107 | unpacked from the buffer object such that the memory reads required | |
3108 | would exceed the data store size. | |
3109 | ||
3110 | `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage1D' is | |
3111 | executed between the execution of `glBegin' and the corresponding | |
3112 | execution of `glEnd'. | |
3113 | ||
3114 | Undefined results, including abnormal program termination, are generated | |
3115 | if DATA is not encoded in a manner consistent with the extension | |
3116 | specification defining the internal compression format.") | |
8925f36f AW |
3117 | |
3118 | (define-gl-procedure | |
bb894c9d AW |
3119 | ((glCompressedTexSubImage2D |
3120 | (target GLenum) | |
3121 | (level GLint) | |
3122 | (xoffset GLint) | |
3123 | (yoffset GLint) | |
3124 | (width GLsizei) | |
3125 | (height GLsizei) | |
3126 | (format GLenum) | |
3127 | (imageSize GLsizei) | |
3128 | (data *) | |
3129 | -> | |
3130 | void)) | |
3c9b6116 AW |
3131 | "Specify a two-dimensional texture subimage in a compressed format. |
3132 | ||
3133 | TARGET | |
3134 | Specifies the target texture. Must be `GL_TEXTURE_2D', | |
3135 | `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | |
3136 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | |
3137 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or | |
3138 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'. | |
3139 | ||
3140 | LEVEL | |
3141 | Specifies the level-of-detail number. Level 0 is the base image | |
3142 | level. Level N is the Nth mipmap reduction image. | |
3143 | ||
3144 | XOFFSET | |
3145 | Specifies a texel offset in the x direction within the texture | |
3146 | array. | |
3147 | ||
3148 | YOFFSET | |
3149 | Specifies a texel offset in the y direction within the texture | |
3150 | array. | |
3151 | ||
3152 | WIDTH | |
3153 | Specifies the width of the texture subimage. | |
3154 | ||
3155 | HEIGHT | |
3156 | Specifies the height of the texture subimage. | |
3157 | ||
3158 | FORMAT | |
3159 | Specifies the format of the compressed image data stored at address | |
3160 | DATA. | |
3161 | ||
3162 | IMAGESIZE | |
3163 | Specifies the number of unsigned bytes of image data starting at | |
3164 | the address specified by DATA. | |
3165 | ||
3166 | DATA | |
3167 | Specifies a pointer to the compressed image data in memory. | |
3168 | ||
3169 | Texturing maps a portion of a specified texture image onto each | |
3170 | graphical primitive for which texturing is enabled. To enable and | |
3171 | disable two-dimensional texturing, call `glEnable' and `glDisable' with | |
3172 | argument `GL_TEXTURE_2D'. To enable and disable texturing using | |
3173 | cube-mapped texture, call `glEnable' and `glDisable' with argument | |
3174 | `GL_TEXTURE_CUBE_MAP'. | |
3175 | ||
3176 | `glCompressedTexSubImage2D' redefines a contiguous subregion of an | |
3177 | existing two-dimensional texture image. The texels referenced by DATA | |
3178 | replace the portion of the existing texture array with x indices XOFFSET | |
3179 | and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 , | |
3180 | inclusive. This region may not include any texels outside the range of | |
3181 | the texture array as it was originally specified. It is not an error to | |
3182 | specify a subtexture with width of 0, but such a specification has no | |
3183 | effect. | |
3184 | ||
3185 | FORMAT must be an extension-specified compressed-texture format. The | |
3186 | FORMAT of the compressed texture image is selected by the GL | |
3187 | implementation that compressed it (see `glTexImage2D') and should be | |
3188 | queried at the time the texture was compressed with | |
3189 | `glGetTexLevelParameter'. | |
3190 | ||
3191 | If a non-zero named buffer object is bound to the | |
3192 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
3193 | image is specified, DATA is treated as a byte offset into the buffer | |
3194 | object's data store. | |
3195 | ||
3196 | `GL_INVALID_ENUM' is generated if FORMAT is one of these generic | |
3197 | compressed internal formats: `GL_COMPRESSED_ALPHA', | |
3198 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
3199 | `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', | |
3200 | `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA', | |
3201 | `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or | |
3202 | `GL_COMPRESSED_SRGB_ALPHA'. | |
3203 | ||
3204 | `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the | |
3205 | format, dimensions, and contents of the specified compressed image data. | |
3206 | ||
3207 | `GL_INVALID_OPERATION' is generated if parameter combinations are not | |
3208 | supported by the specific compressed internal format as specified in the | |
3209 | specific texture compression extension. | |
3210 | ||
3211 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3212 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
3213 | data store is currently mapped. | |
3214 | ||
3215 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3216 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
3217 | unpacked from the buffer object such that the memory reads required | |
3218 | would exceed the data store size. | |
3219 | ||
3220 | `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage2D' is | |
3221 | executed between the execution of `glBegin' and the corresponding | |
3222 | execution of `glEnd'. | |
3223 | ||
3224 | Undefined results, including abnormal program termination, are generated | |
3225 | if DATA is not encoded in a manner consistent with the extension | |
3226 | specification defining the internal compression format.") | |
8925f36f AW |
3227 | |
3228 | (define-gl-procedure | |
bb894c9d AW |
3229 | ((glCompressedTexSubImage3D |
3230 | (target GLenum) | |
3231 | (level GLint) | |
3232 | (xoffset GLint) | |
3233 | (yoffset GLint) | |
3234 | (zoffset GLint) | |
3235 | (width GLsizei) | |
3236 | (height GLsizei) | |
3237 | (depth GLsizei) | |
3238 | (format GLenum) | |
3239 | (imageSize GLsizei) | |
3240 | (data *) | |
3241 | -> | |
3242 | void)) | |
3c9b6116 AW |
3243 | "Specify a three-dimensional texture subimage in a compressed format. |
3244 | ||
3245 | TARGET | |
3246 | Specifies the target texture. Must be `GL_TEXTURE_3D'. | |
3247 | ||
3248 | LEVEL | |
3249 | Specifies the level-of-detail number. Level 0 is the base image | |
3250 | level. Level N is the Nth mipmap reduction image. | |
3251 | ||
3252 | XOFFSET | |
3253 | Specifies a texel offset in the x direction within the texture | |
3254 | array. | |
3255 | ||
3256 | YOFFSET | |
3257 | Specifies a texel offset in the y direction within the texture | |
3258 | array. | |
3259 | ||
3260 | WIDTH | |
3261 | Specifies the width of the texture subimage. | |
3262 | ||
3263 | HEIGHT | |
3264 | Specifies the height of the texture subimage. | |
3265 | ||
3266 | DEPTH | |
3267 | Specifies the depth of the texture subimage. | |
3268 | ||
3269 | FORMAT | |
3270 | Specifies the format of the compressed image data stored at address | |
3271 | DATA. | |
3272 | ||
3273 | IMAGESIZE | |
3274 | Specifies the number of unsigned bytes of image data starting at | |
3275 | the address specified by DATA. | |
3276 | ||
3277 | DATA | |
3278 | Specifies a pointer to the compressed image data in memory. | |
3279 | ||
3280 | Texturing maps a portion of a specified texture image onto each | |
3281 | graphical primitive for which texturing is enabled. To enable and | |
3282 | disable three-dimensional texturing, call `glEnable' and `glDisable' | |
3283 | with argument `GL_TEXTURE_3D'. | |
3284 | ||
3285 | `glCompressedTexSubImage3D' redefines a contiguous subregion of an | |
3286 | existing three-dimensional texture image. The texels referenced by DATA | |
3287 | replace the portion of the existing texture array with x indices XOFFSET | |
3288 | and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 , | |
3289 | and the z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This region | |
3290 | may not include any texels outside the range of the texture array as it | |
3291 | was originally specified. It is not an error to specify a subtexture | |
3292 | with width of 0, but such a specification has no effect. | |
3293 | ||
3294 | FORMAT must be an extension-specified compressed-texture format. The | |
3295 | FORMAT of the compressed texture image is selected by the GL | |
3296 | implementation that compressed it (see `glTexImage3D') and should be | |
3297 | queried at the time the texture was compressed with | |
3298 | `glGetTexLevelParameter'. | |
3299 | ||
3300 | If a non-zero named buffer object is bound to the | |
3301 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
3302 | image is specified, DATA is treated as a byte offset into the buffer | |
3303 | object's data store. | |
3304 | ||
3305 | `GL_INVALID_ENUM' is generated if FORMAT is one of these generic | |
3306 | compressed internal formats: `GL_COMPRESSED_ALPHA', | |
3307 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
3308 | `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', | |
3309 | `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA', | |
3310 | `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or | |
3311 | `GL_COMPRESSED_SRGB_ALPHA'. | |
3312 | ||
3313 | `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the | |
3314 | format, dimensions, and contents of the specified compressed image data. | |
3315 | ||
3316 | `GL_INVALID_OPERATION' is generated if parameter combinations are not | |
3317 | supported by the specific compressed internal format as specified in the | |
3318 | specific texture compression extension. | |
3319 | ||
3320 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3321 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
3322 | data store is currently mapped. | |
3323 | ||
3324 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3325 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
3326 | unpacked from the buffer object such that the memory reads required | |
3327 | would exceed the data store size. | |
3328 | ||
3329 | `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage3D' is | |
3330 | executed between the execution of `glBegin' and the corresponding | |
3331 | execution of `glEnd'. | |
3332 | ||
3333 | Undefined results, including abnormal program termination, are generated | |
3334 | if DATA is not encoded in a manner consistent with the extension | |
3335 | specification defining the internal compression format.") | |
8925f36f AW |
3336 | |
3337 | (define-gl-procedure | |
bb894c9d AW |
3338 | ((glConvolutionFilter1D |
3339 | (target GLenum) | |
3340 | (internalformat GLenum) | |
3341 | (width GLsizei) | |
3342 | (format GLenum) | |
3343 | (type GLenum) | |
3344 | (data *) | |
3345 | -> | |
3346 | void)) | |
3c9b6116 | 3347 | "Define a one-dimensional convolution filter. |
8925f36f | 3348 | |
3c9b6116 AW |
3349 | TARGET |
3350 | Must be `GL_CONVOLUTION_1D'. | |
3351 | ||
3352 | INTERNALFORMAT | |
3353 | The internal format of the convolution filter kernel. The allowable | |
3354 | values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', | |
3355 | `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', | |
3356 | `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', | |
3357 | `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2', | |
3358 | `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4', | |
3359 | `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', | |
3360 | `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12', | |
3361 | `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5', | |
3362 | `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA', | |
3363 | `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', | |
3364 | `GL_RGBA12', or `GL_RGBA16'. | |
3365 | ||
3366 | WIDTH | |
3367 | The width of the pixel array referenced by DATA. | |
3368 | ||
3369 | FORMAT | |
3370 | The format of the pixel data in DATA. The allowable values are | |
3371 | `GL_ALPHA', `GL_LUMINANCE', `GL_LUMINANCE_ALPHA', `GL_INTENSITY', | |
3372 | `GL_RGB', and `GL_RGBA'. | |
3373 | ||
3374 | TYPE | |
3375 | The type of the pixel data in DATA. Symbolic constants | |
3376 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
3377 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
3378 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
3379 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
3380 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
3381 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
3382 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
3383 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
3384 | are accepted. | |
3385 | ||
3386 | DATA | |
3387 | Pointer to a one-dimensional array of pixel data that is processed | |
3388 | to build the convolution filter kernel. | |
3389 | ||
3390 | `glConvolutionFilter1D' builds a one-dimensional convolution filter | |
3391 | kernel from an array of pixels. | |
3392 | ||
3393 | The pixel array specified by WIDTH, FORMAT, TYPE, and DATA is extracted | |
3394 | from memory and processed just as if `glDrawPixels' were called, but | |
3395 | processing stops after the final expansion to RGBA is completed. | |
3396 | ||
3397 | If a non-zero named buffer object is bound to the | |
3398 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution | |
3399 | filter is specified, DATA is treated as a byte offset into the buffer | |
3400 | object's data store. | |
3401 | ||
3402 | The R, G, B, and A components of each pixel are next scaled by the four | |
3403 | 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 1D | |
3404 | `GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters | |
3405 | are set by `glConvolutionParameter' using the `GL_CONVOLUTION_1D' target | |
3406 | and the names `GL_CONVOLUTION_FILTER_SCALE' and | |
3407 | `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of | |
3408 | four values that are applied to red, green, blue, and alpha, in that | |
3409 | order.) The R, G, B, and A values are not clamped to [0,1] at any time | |
3410 | during this process. | |
3411 | ||
3412 | Each pixel is then converted to the internal format specified by | |
3413 | INTERNALFORMAT. This conversion simply maps the component values of the | |
3414 | pixel (R, G, B, and A) to the values included in the internal format | |
3415 | (red, green, blue, alpha, luminance, and intensity). The mapping is as | |
3416 | follows: | |
3417 | ||
3418 | ||
3419 | ||
3420 | *Internal Format* | |
3421 | *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity* | |
3422 | ||
3423 | `GL_ALPHA' | |
3424 | , , , A , , | |
3425 | ||
3426 | `GL_LUMINANCE' | |
3427 | , , , , R , | |
3428 | ||
3429 | `GL_LUMINANCE_ALPHA' | |
3430 | , , , A , R , | |
3431 | ||
3432 | `GL_INTENSITY' | |
3433 | , , , , , R | |
3434 | ||
3435 | `GL_RGB' | |
3436 | R , G , B , , , | |
3437 | ||
3438 | `GL_RGBA' | |
3439 | R , G , B , A , , | |
3440 | ||
3441 | The red, green, blue, alpha, luminance, and/or intensity components of | |
3442 | the resulting pixels are stored in floating-point rather than integer | |
3443 | format. They form a one-dimensional filter kernel image indexed with | |
3444 | coordinate I such that I starts at 0 and increases from left to right. | |
3445 | Kernel location I is derived from the Ith pixel, counting from 0. | |
3446 | ||
3447 | Note that after a convolution is performed, the resulting color | |
3448 | components are also scaled by their corresponding | |
3449 | `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their | |
3450 | corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on | |
3451 | the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are | |
3452 | set by `glPixelTransfer'. | |
3453 | ||
3454 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'. | |
3455 | ||
3456 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the | |
3457 | allowable values. | |
3458 | ||
3459 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
3460 | values. | |
3461 | ||
3462 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable | |
3463 | values. | |
3464 | ||
3465 | `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater | |
3466 | than the maximum supported value. This value may be queried with | |
3467 | `glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name | |
3468 | `GL_MAX_CONVOLUTION_WIDTH'. | |
3469 | ||
3470 | `GL_INVALID_OPERATION' is generated if FORMAT is one of | |
3471 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
3472 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and TYPE is | |
3473 | not `GL_RGB'. | |
3474 | ||
3475 | `GL_INVALID_OPERATION' is generated if FORMAT is one of | |
3476 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
3477 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
3478 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
3479 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
3480 | TYPE is neither `GL_RGBA' nor `GL_BGRA'. | |
3481 | ||
3482 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3483 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
3484 | data store is currently mapped. | |
3485 | ||
3486 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3487 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
3488 | unpacked from the buffer object such that the memory reads required | |
3489 | would exceed the data store size. | |
3490 | ||
3491 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3492 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
3493 | divisible into the number of bytes needed to store in memory a datum | |
3494 | indicated by TYPE. | |
3495 | ||
3496 | `GL_INVALID_OPERATION' is generated if `glConvolutionFilter1D' is | |
3497 | executed between the execution of `glBegin' and the corresponding | |
3498 | execution of `glEnd'.") | |
3499 | ||
3500 | (define-gl-procedure | |
bb894c9d AW |
3501 | ((glConvolutionFilter2D |
3502 | (target GLenum) | |
3503 | (internalformat GLenum) | |
3504 | (width GLsizei) | |
3505 | (height GLsizei) | |
3506 | (format GLenum) | |
3507 | (type GLenum) | |
3508 | (data *) | |
3509 | -> | |
3510 | void)) | |
3c9b6116 AW |
3511 | "Define a two-dimensional convolution filter. |
3512 | ||
3513 | TARGET | |
3514 | Must be `GL_CONVOLUTION_2D'. | |
3515 | ||
3516 | INTERNALFORMAT | |
3517 | The internal format of the convolution filter kernel. The allowable | |
3518 | values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', | |
3519 | `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', | |
3520 | `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', | |
3521 | `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2', | |
3522 | `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4', | |
3523 | `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', | |
3524 | `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12', | |
3525 | `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5', | |
3526 | `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA', | |
3527 | `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', | |
3528 | `GL_RGBA12', or `GL_RGBA16'. | |
3529 | ||
3530 | WIDTH | |
3531 | The width of the pixel array referenced by DATA. | |
3532 | ||
3533 | HEIGHT | |
3534 | The height of the pixel array referenced by DATA. | |
3535 | ||
3536 | FORMAT | |
3537 | The format of the pixel data in DATA. The allowable values are | |
3538 | `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', | |
3539 | `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'. | |
3540 | ||
3541 | TYPE | |
3542 | The type of the pixel data in DATA. Symbolic constants | |
3543 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
3544 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
3545 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
3546 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
3547 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
3548 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
3549 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
3550 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
3551 | are accepted. | |
3552 | ||
3553 | DATA | |
3554 | Pointer to a two-dimensional array of pixel data that is processed | |
3555 | to build the convolution filter kernel. | |
3556 | ||
3557 | `glConvolutionFilter2D' builds a two-dimensional convolution filter | |
3558 | kernel from an array of pixels. | |
3559 | ||
3560 | The pixel array specified by WIDTH, HEIGHT, FORMAT, TYPE, and DATA is | |
3561 | extracted from memory and processed just as if `glDrawPixels' were | |
3562 | called, but processing stops after the final expansion to RGBA is | |
3563 | completed. | |
3564 | ||
3565 | If a non-zero named buffer object is bound to the | |
3566 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution | |
3567 | filter is specified, DATA is treated as a byte offset into the buffer | |
3568 | object's data store. | |
3569 | ||
8925f36f | 3570 | The R, G, B, and A components of each pixel are next scaled by the four |
3c9b6116 AW |
3571 | 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 2D |
3572 | `GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters | |
3573 | are set by `glConvolutionParameter' using the `GL_CONVOLUTION_2D' target | |
3574 | and the names `GL_CONVOLUTION_FILTER_SCALE' and | |
3575 | `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of | |
3576 | four values that are applied to red, green, blue, and alpha, in that | |
3577 | order.) The R, G, B, and A values are not clamped to [0,1] at any time | |
3578 | during this process. | |
3579 | ||
3580 | Each pixel is then converted to the internal format specified by | |
3581 | INTERNALFORMAT. This conversion simply maps the component values of the | |
3582 | pixel (R, G, B, and A) to the values included in the internal format | |
3583 | (red, green, blue, alpha, luminance, and intensity). The mapping is as | |
3584 | follows: | |
3585 | ||
3586 | ||
3587 | ||
3588 | *Internal Format* | |
3589 | *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity* | |
3590 | ||
3591 | `GL_ALPHA' | |
3592 | , , , A , , | |
3593 | ||
3594 | `GL_LUMINANCE' | |
3595 | , , , , R , | |
3596 | ||
3597 | `GL_LUMINANCE_ALPHA' | |
3598 | , , , A , R , | |
3599 | ||
3600 | `GL_INTENSITY' | |
3601 | , , , , , R | |
3602 | ||
3603 | `GL_RGB' | |
3604 | R , G , B , , , | |
3605 | ||
3606 | `GL_RGBA' | |
3607 | R , G , B , A , , | |
3608 | ||
8925f36f | 3609 | The red, green, blue, alpha, luminance, and/or intensity components of |
3c9b6116 AW |
3610 | the resulting pixels are stored in floating-point rather than integer |
3611 | format. They form a two-dimensional filter kernel image indexed with | |
3612 | coordinates I and J such that I starts at zero and increases from left | |
3613 | to right, and J starts at zero and increases from bottom to top. Kernel | |
3614 | location I,J is derived from the Nth pixel, where N is I+J*WIDTH. | |
3615 | ||
8925f36f | 3616 | Note that after a convolution is performed, the resulting color |
3c9b6116 AW |
3617 | components are also scaled by their corresponding |
3618 | `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their | |
3619 | corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on | |
3620 | the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are | |
3621 | set by `glPixelTransfer'. | |
3622 | ||
3623 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'. | |
3624 | ||
3625 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the | |
3626 | allowable values. | |
3627 | ||
3628 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
3629 | values. | |
3630 | ||
3631 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable | |
3632 | values. | |
3633 | ||
3634 | `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater | |
3635 | than the maximum supported value. This value may be queried with | |
3636 | `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name | |
3637 | `GL_MAX_CONVOLUTION_WIDTH'. | |
3638 | ||
3639 | `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater | |
3640 | than the maximum supported value. This value may be queried with | |
3641 | `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name | |
3642 | `GL_MAX_CONVOLUTION_HEIGHT'. | |
3643 | ||
3644 | `GL_INVALID_OPERATION' is generated if HEIGHT is one of | |
3645 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
3646 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
3647 | is not `GL_RGB'. | |
3648 | ||
3649 | `GL_INVALID_OPERATION' is generated if HEIGHT is one of | |
3650 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
3651 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
3652 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
3653 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
3654 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
3655 | ||
3656 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3657 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
3658 | data store is currently mapped. | |
3659 | ||
3660 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3661 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
3662 | unpacked from the buffer object such that the memory reads required | |
3663 | would exceed the data store size. | |
3664 | ||
3665 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
3666 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
3667 | divisible into the number of bytes needed to store in memory a datum | |
3668 | indicated by TYPE. | |
3669 | ||
3670 | `GL_INVALID_OPERATION' is generated if `glConvolutionFilter2D' is | |
3671 | executed between the execution of `glBegin' and the corresponding | |
3672 | execution of `glEnd'.") | |
8925f36f AW |
3673 | |
3674 | (define-gl-procedure | |
bb894c9d AW |
3675 | ((glConvolutionParameterf |
3676 | (target GLenum) | |
3677 | (pname GLenum) | |
3678 | (params GLfloat) | |
3679 | -> | |
3680 | void) | |
3681 | (glConvolutionParameteri | |
3682 | (target GLenum) | |
3683 | (pname GLenum) | |
3684 | (params GLint) | |
3685 | -> | |
3686 | void)) | |
3c9b6116 AW |
3687 | "Set convolution parameters. |
3688 | ||
3689 | TARGET | |
3690 | The target for the convolution parameter. Must be one of | |
3691 | `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'. | |
3692 | ||
3693 | PNAME | |
3694 | The parameter to be set. Must be `GL_CONVOLUTION_BORDER_MODE'. | |
3695 | ||
3696 | PARAMS | |
3697 | The parameter value. Must be one of `GL_REDUCE', | |
3698 | `GL_CONSTANT_BORDER', `GL_REPLICATE_BORDER'. | |
3699 | ||
3700 | ||
3701 | ||
3702 | `glConvolutionParameter' sets the value of a convolution parameter. | |
3703 | ||
3704 | TARGET selects the convolution filter to be affected: | |
3705 | `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D' for the | |
3706 | 1D, 2D, or separable 2D filter, respectively. | |
3707 | ||
3708 | PNAME selects the parameter to be changed. `GL_CONVOLUTION_FILTER_SCALE' | |
3709 | and `GL_CONVOLUTION_FILTER_BIAS' affect the definition of the | |
3710 | convolution filter kernel; see `glConvolutionFilter1D', | |
3711 | `glConvolutionFilter2D', and `glSeparableFilter2D' for details. In these | |
3712 | cases, PARAMSv is an array of four values to be applied to red, green, | |
3713 | blue, and alpha values, respectively. The initial value for | |
3714 | `GL_CONVOLUTION_FILTER_SCALE' is (1, 1, 1, 1), and the initial value for | |
3715 | `GL_CONVOLUTION_FILTER_BIAS' is (0, 0, 0, 0). | |
3716 | ||
3717 | A PNAME value of `GL_CONVOLUTION_BORDER_MODE' controls the convolution | |
3718 | border mode. The accepted modes are: | |
3719 | ||
3720 | `GL_REDUCE' | |
3721 | The image resulting from convolution is smaller than the source | |
3722 | image. If the filter width is WF and height is HF , and the source | |
3723 | image width is WS and height is HS , then the convolved image width | |
3724 | will be WS-WF+1 and height will be HS-HF+1 . (If this reduction | |
3725 | would generate an image with zero or negative width and/or height, | |
3726 | the output is simply null, with no error generated.) The | |
3727 | coordinates of the image resulting from convolution are zero | |
3728 | through WS-WF in width and zero through HS-HF in height. | |
3729 | ||
3730 | `GL_CONSTANT_BORDER' | |
3731 | The image resulting from convolution is the same size as the source | |
3732 | image, and processed as if the source image were surrounded by | |
3733 | pixels with their color specified by the | |
3734 | `GL_CONVOLUTION_BORDER_COLOR'. | |
3735 | ||
3736 | `GL_REPLICATE_BORDER' | |
3737 | The image resulting from convolution is the same size as the source | |
3738 | image, and processed as if the outermost pixel on the border of the | |
3739 | source image were replicated. | |
3740 | ||
3741 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
3742 | values. | |
3743 | ||
3744 | `GL_INVALID_ENUM' is generated if PNAME is not one of the allowable | |
3745 | values. | |
3746 | ||
3747 | `GL_INVALID_ENUM' is generated if PNAME is `GL_CONVOLUTION_BORDER_MODE' | |
3748 | and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or | |
3749 | `GL_REPLICATE_BORDER'. | |
3750 | ||
3751 | `GL_INVALID_OPERATION' is generated if `glConvolutionParameter' is | |
3752 | executed between the execution of `glBegin' and the corresponding | |
3753 | execution of `glEnd'.") | |
8925f36f AW |
3754 | |
3755 | (define-gl-procedure | |
bb894c9d AW |
3756 | ((glCopyColorSubTable |
3757 | (target GLenum) | |
3758 | (start GLsizei) | |
3759 | (x GLint) | |
3760 | (y GLint) | |
3761 | (width GLsizei) | |
3762 | -> | |
3763 | void)) | |
3c9b6116 AW |
3764 | "Respecify a portion of a color table. |
3765 | ||
3766 | TARGET | |
3767 | Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', | |
3768 | or `GL_POST_COLOR_MATRIX_COLOR_TABLE'. | |
3769 | ||
3770 | START | |
3771 | The starting index of the portion of the color table to be | |
3772 | replaced. | |
3773 | ||
3774 | X | |
3775 | Y | |
3776 | ||
3777 | The window coordinates of the left corner of the row of pixels to | |
3778 | be copied. | |
3779 | ||
3780 | WIDTH | |
3781 | The number of table entries to replace. | |
3782 | ||
3783 | `glCopyColorSubTable' is used to respecify a contiguous portion of a | |
3784 | color table previously defined using `glColorTable'. The pixels copied | |
3785 | from the framebuffer replace the portion of the existing table from | |
3786 | indices START to START+X-1 , inclusive. This region may not include any | |
3787 | entries outside the range of the color table, as was originally | |
3788 | specified. It is not an error to specify a subtexture with width of 0, | |
3789 | but such a specification has no effect. | |
3790 | ||
3791 | `GL_INVALID_VALUE' is generated if TARGET is not a previously defined | |
3792 | color table. | |
3793 | ||
3794 | `GL_INVALID_VALUE' is generated if TARGET is not one of the allowable | |
3795 | values. | |
3796 | ||
3797 | `GL_INVALID_VALUE' is generated if START+X>WIDTH . | |
3798 | ||
3799 | `GL_INVALID_OPERATION' is generated if `glCopyColorSubTable' is executed | |
3800 | between the execution of `glBegin' and the corresponding execution of | |
3801 | `glEnd'.") | |
8925f36f AW |
3802 | |
3803 | (define-gl-procedure | |
bb894c9d AW |
3804 | ((glCopyColorTable |
3805 | (target GLenum) | |
3806 | (internalformat GLenum) | |
3807 | (x GLint) | |
3808 | (y GLint) | |
3809 | (width GLsizei) | |
3810 | -> | |
3811 | void)) | |
3c9b6116 AW |
3812 | "Copy pixels into a color table. |
3813 | ||
3814 | TARGET | |
3815 | The color table target. Must be `GL_COLOR_TABLE', | |
3816 | `GL_POST_CONVOLUTION_COLOR_TABLE', or | |
3817 | `GL_POST_COLOR_MATRIX_COLOR_TABLE'. | |
3818 | ||
3819 | INTERNALFORMAT | |
3820 | The internal storage format of the texture image. Must be one of | |
3821 | the following symbolic constants: `GL_ALPHA', `GL_ALPHA4', | |
3822 | `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', `GL_LUMINANCE', | |
3823 | `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12', | |
3824 | `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
3825 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
3826 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
3827 | `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4', | |
3828 | `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2', | |
3829 | `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', | |
3830 | `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', | |
3831 | `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'. | |
3832 | ||
3833 | X | |
3834 | The x coordinate of the lower-left corner of the pixel rectangle to | |
3835 | be transferred to the color table. | |
3836 | ||
3837 | Y | |
3838 | The y coordinate of the lower-left corner of the pixel rectangle to | |
3839 | be transferred to the color table. | |
3840 | ||
3841 | WIDTH | |
3842 | The width of the pixel rectangle. | |
3843 | ||
3844 | `glCopyColorTable' loads a color table with pixels from the current | |
3845 | `GL_READ_BUFFER' (rather than from main memory, as is the case for | |
3846 | `glColorTable'). | |
3847 | ||
3848 | The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y) | |
3849 | having width WIDTH and height 1 is loaded into the color table. If any | |
3850 | pixels within this region are outside the window that is associated with | |
3851 | the GL context, the values obtained for those pixels are undefined. | |
3852 | ||
3853 | The pixels in the rectangle are processed just as if `glReadPixels' were | |
3854 | called, with INTERNALFORMAT set to RGBA, but processing stops after the | |
3855 | final conversion to RGBA. | |
3856 | ||
8925f36f | 3857 | The four scale parameters and the four bias parameters that are defined |
3c9b6116 AW |
3858 | for the table are then used to scale and bias the R, G, B, and A |
3859 | components of each pixel. The scale and bias parameters are set by | |
3860 | calling `glColorTableParameter'. | |
3861 | ||
3862 | Next, the R, G, B, and A values are clamped to the range [0,1] . Each | |
3863 | pixel is then converted to the internal format specified by | |
3864 | INTERNALFORMAT. This conversion simply maps the component values of the | |
3865 | pixel (R, G, B, and A) to the values included in the internal format | |
3866 | (red, green, blue, alpha, luminance, and intensity). The mapping is as | |
3867 | follows: | |
3868 | ||
3869 | ||
3870 | ||
3871 | *Internal Format* | |
3872 | *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity* | |
3873 | ||
3874 | `GL_ALPHA' | |
3875 | , , , A , , | |
3876 | ||
3877 | `GL_LUMINANCE' | |
3878 | , , , , R , | |
3879 | ||
3880 | `GL_LUMINANCE_ALPHA' | |
3881 | , , , A , R , | |
3882 | ||
3883 | `GL_INTENSITY' | |
3884 | , , , , , R | |
3885 | ||
3886 | `GL_RGB' | |
3887 | R , G , B , , , | |
3888 | ||
3889 | `GL_RGBA' | |
3890 | R , G , B , A , , | |
3891 | ||
3892 | Finally, the red, green, blue, alpha, luminance, and/or intensity | |
3893 | components of the resulting pixels are stored in the color table. They | |
3894 | form a one-dimensional table with indices in the range [0,WIDTH-1] . | |
3895 | ||
3896 | ||
3897 | ||
3898 | `GL_INVALID_ENUM' is generated when TARGET is not one of the allowable | |
3899 | values. | |
3900 | ||
3901 | `GL_INVALID_VALUE' is generated if WIDTH is less than zero. | |
3902 | ||
3903 | `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not one of the | |
3904 | allowable values. | |
3905 | ||
3906 | `GL_TABLE_TOO_LARGE' is generated if the requested color table is too | |
3907 | large to be supported by the implementation. | |
3908 | ||
3909 | `GL_INVALID_OPERATION' is generated if `glCopyColorTable' is executed | |
3910 | between the execution of `glBegin' and the corresponding execution of | |
3911 | `glEnd'.") | |
8925f36f AW |
3912 | |
3913 | (define-gl-procedure | |
bb894c9d AW |
3914 | ((glCopyConvolutionFilter1D |
3915 | (target GLenum) | |
3916 | (internalformat GLenum) | |
3917 | (x GLint) | |
3918 | (y GLint) | |
3919 | (width GLsizei) | |
3920 | -> | |
3921 | void)) | |
3c9b6116 AW |
3922 | "Copy pixels into a one-dimensional convolution filter. |
3923 | ||
3924 | TARGET | |
3925 | Must be `GL_CONVOLUTION_1D'. | |
3926 | ||
3927 | INTERNALFORMAT | |
3928 | The internal format of the convolution filter kernel. The allowable | |
3929 | values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', | |
3930 | `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', | |
3931 | `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', | |
3932 | `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2', | |
3933 | `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4', | |
3934 | `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', | |
3935 | `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12', | |
3936 | `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5', | |
3937 | `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA', | |
3938 | `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', | |
3939 | `GL_RGBA12', or `GL_RGBA16'. | |
3940 | ||
3941 | X | |
3942 | Y | |
3943 | ||
3944 | The window space coordinates of the lower-left coordinate of the | |
3945 | pixel array to copy. | |
3946 | ||
3947 | WIDTH | |
3948 | The width of the pixel array to copy. | |
3949 | ||
3950 | `glCopyConvolutionFilter1D' defines a one-dimensional convolution filter | |
3951 | kernel with pixels from the current `GL_READ_BUFFER' (rather than from | |
3952 | main memory, as is the case for `glConvolutionFilter1D'). | |
3953 | ||
3954 | The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y), | |
3955 | width WIDTH and height 1 is used to define the convolution filter. If | |
3956 | any pixels within this region are outside the window that is associated | |
3957 | with the GL context, the values obtained for those pixels are undefined. | |
3958 | ||
3959 | The pixels in the rectangle are processed exactly as if `glReadPixels' | |
3960 | had been called with FORMAT set to RGBA, but the process stops just | |
3961 | before final conversion. The R, G, B, and A components of each pixel are | |
3962 | next scaled by the four 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and | |
3963 | biased by the four 1D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The | |
3964 | scale and bias parameters are set by `glConvolutionParameter' using the | |
3965 | `GL_CONVOLUTION_1D' target and the names `GL_CONVOLUTION_FILTER_SCALE' | |
3966 | and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors | |
3967 | of four values that are applied to red, green, blue, and alpha, in that | |
3968 | order.) The R, G, B, and A values are not clamped to [0,1] at any time | |
3969 | during this process. | |
3970 | ||
3971 | Each pixel is then converted to the internal format specified by | |
3972 | INTERNALFORMAT. This conversion simply maps the component values of the | |
3973 | pixel (R, G, B, and A) to the values included in the internal format | |
3974 | (red, green, blue, alpha, luminance, and intensity). The mapping is as | |
3975 | follows: | |
3976 | ||
3977 | ||
3978 | ||
3979 | *Internal Format* | |
3980 | *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity* | |
3981 | ||
3982 | `GL_ALPHA' | |
3983 | , , , A , , | |
3984 | ||
3985 | `GL_LUMINANCE' | |
3986 | , , , , R , | |
3987 | ||
3988 | `GL_LUMINANCE_ALPHA' | |
3989 | , , , A , R , | |
3990 | ||
3991 | `GL_INTENSITY' | |
3992 | , , , , , R | |
3993 | ||
3994 | `GL_RGB' | |
3995 | R , G , B , , , | |
3996 | ||
3997 | `GL_RGBA' | |
3998 | R , G , B , A , , | |
3999 | ||
8925f36f | 4000 | The red, green, blue, alpha, luminance, and/or intensity components of |
3c9b6116 AW |
4001 | the resulting pixels are stored in floating-point rather than integer |
4002 | format. | |
4003 | ||
8925f36f | 4004 | Pixel ordering is such that lower x screen coordinates correspond to |
3c9b6116 AW |
4005 | lower I filter image coordinates. |
4006 | ||
8925f36f | 4007 | Note that after a convolution is performed, the resulting color |
3c9b6116 AW |
4008 | components are also scaled by their corresponding |
4009 | `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their | |
4010 | corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on | |
4011 | the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are | |
4012 | set by `glPixelTransfer'. | |
4013 | ||
4014 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'. | |
4015 | ||
4016 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the | |
4017 | allowable values. | |
4018 | ||
4019 | `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater | |
4020 | than the maximum supported value. This value may be queried with | |
4021 | `glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name | |
4022 | `GL_MAX_CONVOLUTION_WIDTH'. | |
4023 | ||
4024 | `GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter1D' is | |
4025 | executed between the execution of `glBegin' and the corresponding | |
4026 | execution of `glEnd'.") | |
8925f36f AW |
4027 | |
4028 | (define-gl-procedure | |
bb894c9d AW |
4029 | ((glCopyConvolutionFilter2D |
4030 | (target GLenum) | |
4031 | (internalformat GLenum) | |
4032 | (x GLint) | |
4033 | (y GLint) | |
4034 | (width GLsizei) | |
4035 | (height GLsizei) | |
4036 | -> | |
4037 | void)) | |
3c9b6116 AW |
4038 | "Copy pixels into a two-dimensional convolution filter. |
4039 | ||
4040 | TARGET | |
4041 | Must be `GL_CONVOLUTION_2D'. | |
4042 | ||
4043 | INTERNALFORMAT | |
4044 | The internal format of the convolution filter kernel. The allowable | |
4045 | values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', | |
4046 | `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', | |
4047 | `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', | |
4048 | `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2', | |
4049 | `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4', | |
4050 | `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', | |
4051 | `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12', | |
4052 | `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5', | |
4053 | `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA', | |
4054 | `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', | |
4055 | `GL_RGBA12', or `GL_RGBA16'. | |
4056 | ||
4057 | X | |
4058 | Y | |
4059 | ||
4060 | The window space coordinates of the lower-left coordinate of the | |
4061 | pixel array to copy. | |
4062 | ||
4063 | WIDTH | |
4064 | The width of the pixel array to copy. | |
4065 | ||
4066 | HEIGHT | |
4067 | The height of the pixel array to copy. | |
4068 | ||
4069 | `glCopyConvolutionFilter2D' defines a two-dimensional convolution filter | |
4070 | kernel with pixels from the current `GL_READ_BUFFER' (rather than from | |
4071 | main memory, as is the case for `glConvolutionFilter2D'). | |
4072 | ||
4073 | The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y), | |
4074 | width WIDTH and height HEIGHT is used to define the convolution filter. | |
4075 | If any pixels within this region are outside the window that is | |
4076 | associated with the GL context, the values obtained for those pixels are | |
4077 | undefined. | |
4078 | ||
4079 | The pixels in the rectangle are processed exactly as if `glReadPixels' | |
4080 | had been called with FORMAT set to RGBA, but the process stops just | |
4081 | before final conversion. The R, G, B, and A components of each pixel are | |
4082 | next scaled by the four 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and | |
4083 | biased by the four 2D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The | |
4084 | scale and bias parameters are set by `glConvolutionParameter' using the | |
4085 | `GL_CONVOLUTION_2D' target and the names `GL_CONVOLUTION_FILTER_SCALE' | |
4086 | and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors | |
4087 | of four values that are applied to red, green, blue, and alpha, in that | |
4088 | order.) The R, G, B, and A values are not clamped to [0,1] at any time | |
4089 | during this process. | |
4090 | ||
4091 | Each pixel is then converted to the internal format specified by | |
4092 | INTERNALFORMAT. This conversion simply maps the component values of the | |
4093 | pixel (R, G, B, and A) to the values included in the internal format | |
4094 | (red, green, blue, alpha, luminance, and intensity). The mapping is as | |
4095 | follows: | |
4096 | ||
4097 | ||
4098 | ||
4099 | *Internal Format* | |
4100 | *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity* | |
4101 | ||
4102 | `GL_ALPHA' | |
4103 | , , , A , , | |
4104 | ||
4105 | `GL_LUMINANCE' | |
4106 | , , , , R , | |
4107 | ||
4108 | `GL_LUMINANCE_ALPHA' | |
4109 | , , , A , R , | |
4110 | ||
4111 | `GL_INTENSITY' | |
4112 | , , , , , R | |
4113 | ||
4114 | `GL_RGB' | |
4115 | R , G , B , , , | |
4116 | ||
4117 | `GL_RGBA' | |
4118 | R , G , B , A , , | |
4119 | ||
8925f36f | 4120 | The red, green, blue, alpha, luminance, and/or intensity components of |
3c9b6116 AW |
4121 | the resulting pixels are stored in floating-point rather than integer |
4122 | format. | |
4123 | ||
8925f36f | 4124 | Pixel ordering is such that lower x screen coordinates correspond to |
3c9b6116 AW |
4125 | lower I filter image coordinates, and lower y screen coordinates |
4126 | correspond to lower J filter image coordinates. | |
4127 | ||
8925f36f | 4128 | Note that after a convolution is performed, the resulting color |
3c9b6116 AW |
4129 | components are also scaled by their corresponding |
4130 | `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their | |
4131 | corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on | |
4132 | the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are | |
4133 | set by `glPixelTransfer'. | |
4134 | ||
4135 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'. | |
4136 | ||
4137 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the | |
4138 | allowable values. | |
4139 | ||
4140 | `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater | |
4141 | than the maximum supported value. This value may be queried with | |
4142 | `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name | |
4143 | `GL_MAX_CONVOLUTION_WIDTH'. | |
4144 | ||
4145 | `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater | |
4146 | than the maximum supported value. This value may be queried with | |
4147 | `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name | |
4148 | `GL_MAX_CONVOLUTION_HEIGHT'. | |
4149 | ||
4150 | `GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter2D' is | |
4151 | executed between the execution of `glBegin' and the corresponding | |
4152 | execution of `glEnd'.") | |
8925f36f AW |
4153 | |
4154 | (define-gl-procedure | |
bb894c9d AW |
4155 | ((glCopyPixels |
4156 | (x GLint) | |
4157 | (y GLint) | |
4158 | (width GLsizei) | |
4159 | (height GLsizei) | |
4160 | (type GLenum) | |
4161 | -> | |
4162 | void)) | |
3c9b6116 AW |
4163 | "Copy pixels in the frame buffer. |
4164 | ||
4165 | X | |
4166 | Y | |
4167 | ||
4168 | Specify the window coordinates of the lower left corner of the | |
4169 | rectangular region of pixels to be copied. | |
4170 | ||
4171 | WIDTH | |
4172 | HEIGHT | |
4173 | ||
4174 | Specify the dimensions of the rectangular region of pixels to be | |
4175 | copied. Both must be nonnegative. | |
4176 | ||
4177 | TYPE | |
4178 | Specifies whether color values, depth values, or stencil values are | |
4179 | to be copied. Symbolic constants `GL_COLOR', `GL_DEPTH', and | |
4180 | `GL_STENCIL' are accepted. | |
4181 | ||
4182 | `glCopyPixels' copies a screen-aligned rectangle of pixels from the | |
4183 | specified frame buffer location to a region relative to the current | |
4184 | raster position. Its operation is well defined only if the entire pixel | |
4185 | source region is within the exposed portion of the window. Results of | |
4186 | copies from outside the window, or from regions of the window that are | |
4187 | not exposed, are hardware dependent and undefined. | |
4188 | ||
4189 | X and Y specify the window coordinates of the lower left corner of the | |
4190 | rectangular region to be copied. WIDTH and HEIGHT specify the dimensions | |
4191 | of the rectangular region to be copied. Both WIDTH and HEIGHT must not | |
4192 | be negative. | |
4193 | ||
4194 | Several parameters control the processing of the pixel data while it is | |
4195 | being copied. These parameters are set with three commands: | |
4196 | `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This reference page | |
4197 | describes the effects on `glCopyPixels' of most, but not all, of the | |
4198 | parameters specified by these three commands. | |
4199 | ||
4200 | `glCopyPixels' copies values from each pixel with the lower left-hand | |
4201 | corner at (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said | |
4202 | to be the I th pixel in the J th row. Pixels are copied in row order | |
4203 | from the lowest to the highest row, left to right in each row. | |
4204 | ||
4205 | TYPE specifies whether color, depth, or stencil data is to be copied. | |
4206 | The details of the transfer for each data type are as follows: | |
4207 | ||
4208 | `GL_COLOR' | |
4209 | Indices or RGBA colors are read from the buffer currently specified | |
4210 | as the read source buffer (see `glReadBuffer'). If the GL is in | |
4211 | color index mode, each index that is read from this buffer is | |
4212 | converted to a fixed-point format with an unspecified number of | |
4213 | bits to the right of the binary point. Each index is then shifted | |
4214 | left by `GL_INDEX_SHIFT' bits, and added to `GL_INDEX_OFFSET'. If | |
4215 | `GL_INDEX_SHIFT' is negative, the shift is to the right. In either | |
4216 | case, zero bits fill otherwise unspecified bit locations in the | |
4217 | result. If `GL_MAP_COLOR' is true, the index is replaced with the | |
4218 | value that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. | |
4219 | Whether the lookup replacement of the index is done or not, the | |
4220 | integer part of the index is then ANDed with 2^B-1 , where B is the | |
4221 | number of bits in a color index buffer. | |
4222 | ||
4223 | If the GL is in RGBA mode, the red, green, blue, and alpha | |
4224 | components of each pixel that is read are converted to an internal | |
4225 | floating-point format with unspecified precision. The conversion | |
4226 | maps the largest representable component value to 1.0, and | |
4227 | component value 0 to 0.0. The resulting floating-point color values | |
4228 | are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where | |
4229 | C is RED, GREEN, BLUE, and ALPHA for the respective color | |
4230 | components. The results are clamped to the range [0,1]. If | |
4231 | `GL_MAP_COLOR' is true, each color component is scaled by the size | |
4232 | of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the value | |
4233 | that it references in that table. C is R, G, B, or A. | |
4234 | ||
4235 | If the `ARB_imaging' extension is supported, the color values may | |
4236 | be additionally processed by color-table lookups, color-matrix | |
4237 | transformations, and convolution filters. | |
4238 | ||
4239 | The GL then converts the resulting indices or RGBA colors to | |
4240 | fragments by attaching the current raster position Z coordinate and | |
4241 | texture coordinates to each pixel, then assigning window | |
4242 | coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster | |
4243 | position, and the pixel was the I th pixel in the J th row. These | |
4244 | pixel fragments are then treated just like the fragments generated | |
4245 | by rasterizing points, lines, or polygons. Texture mapping, fog, | |
4246 | and all the fragment operations are applied before the fragments | |
4247 | are written to the frame buffer. | |
4248 | ||
4249 | `GL_DEPTH' | |
4250 | Depth values are read from the depth buffer and converted directly | |
4251 | to an internal floating-point format with unspecified precision. | |
4252 | The resulting floating-point depth value is then multiplied by | |
4253 | `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is | |
4254 | clamped to the range [0,1]. | |
4255 | ||
4256 | The GL then converts the resulting depth components to fragments by | |
4257 | attaching the current raster position color or color index and | |
4258 | texture coordinates to each pixel, then assigning window | |
4259 | coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster | |
4260 | position, and the pixel was the I th pixel in the J th row. These | |
4261 | pixel fragments are then treated just like the fragments generated | |
4262 | by rasterizing points, lines, or polygons. Texture mapping, fog, | |
4263 | and all the fragment operations are applied before the fragments | |
4264 | are written to the frame buffer. | |
4265 | ||
4266 | `GL_STENCIL' | |
4267 | Stencil indices are read from the stencil buffer and converted to | |
4268 | an internal fixed-point format with an unspecified number of bits | |
4269 | to the right of the binary point. Each fixed-point index is then | |
4270 | shifted left by `GL_INDEX_SHIFT' bits, and added to | |
4271 | `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is negative, the shift is to | |
4272 | the right. In either case, zero bits fill otherwise unspecified bit | |
4273 | locations in the result. If `GL_MAP_STENCIL' is true, the index is | |
4274 | replaced with the value that it references in lookup table | |
4275 | `GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index | |
4276 | is done or not, the integer part of the index is then ANDed with | |
4277 | 2^B-1 , where B is the number of bits in the stencil buffer. The | |
4278 | resulting stencil indices are then written to the stencil buffer | |
4279 | such that the index read from the I th location of the J th row is | |
4280 | written to location (X_R+I,Y_R+J) , where (X_R,Y_R) is the current | |
4281 | raster position. Only the pixel ownership test, the scissor test, | |
4282 | and the stencil writemask affect these write operations. | |
4283 | ||
8925f36f | 4284 | The rasterization described thus far assumes pixel zoom factors of 1.0. |
3c9b6116 AW |
4285 | If `glPixelZoom' is used to change the X and Y pixel zoom factors, |
4286 | pixels are converted to fragments as follows. If (X_R,Y_R) is the | |
4287 | current raster position, and a given pixel is in the I th location in | |
4288 | the J th row of the source pixel rectangle, then fragments are generated | |
4289 | for pixels whose centers are in the rectangle with corners at | |
4290 | ||
4291 | (X_R+ZOOM_X,\u2062I,Y_R+ZOOM_Y,\u2062J) | |
4292 | ||
4293 | and | |
4294 | ||
4295 | (X_R+ZOOM_X,\u2061(I+1,),Y_R+ZOOM_Y,\u2061(J+1,)) | |
4296 | ||
4297 | where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of | |
4298 | `GL_ZOOM_Y'. | |
4299 | ||
4300 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
4301 | ||
4302 | `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative. | |
4303 | ||
4304 | `GL_INVALID_OPERATION' is generated if TYPE is `GL_DEPTH' and there is | |
4305 | no depth buffer. | |
4306 | ||
4307 | `GL_INVALID_OPERATION' is generated if TYPE is `GL_STENCIL' and there is | |
4308 | no stencil buffer. | |
4309 | ||
4310 | `GL_INVALID_OPERATION' is generated if `glCopyPixels' is executed | |
4311 | between the execution of `glBegin' and the corresponding execution of | |
4312 | `glEnd'.") | |
8925f36f AW |
4313 | |
4314 | (define-gl-procedure | |
bb894c9d AW |
4315 | ((glCopyTexImage1D |
4316 | (target GLenum) | |
4317 | (level GLint) | |
4318 | (internalformat GLenum) | |
4319 | (x GLint) | |
4320 | (y GLint) | |
4321 | (width GLsizei) | |
4322 | (border GLint) | |
4323 | -> | |
4324 | void)) | |
3c9b6116 AW |
4325 | "Copy pixels into a 1D texture image. |
4326 | ||
4327 | TARGET | |
4328 | Specifies the target texture. Must be `GL_TEXTURE_1D'. | |
4329 | ||
4330 | LEVEL | |
4331 | Specifies the level-of-detail number. Level 0 is the base image | |
4332 | level. Level N is the Nth mipmap reduction image. | |
4333 | ||
4334 | INTERNALFORMAT | |
4335 | Specifies the internal format of the texture. Must be one of the | |
4336 | following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', | |
4337 | `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA', | |
4338 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
4339 | `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', | |
4340 | `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', | |
4341 | `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', | |
4342 | `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12', | |
4343 | `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
4344 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
4345 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
4346 | `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4', | |
4347 | `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB', | |
4348 | `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', | |
4349 | `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', | |
4350 | `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16', | |
4351 | `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA', | |
4352 | `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or | |
4353 | `GL_SRGB8_ALPHA8'. | |
4354 | ||
4355 | X | |
4356 | Y | |
4357 | ||
4358 | Specify the window coordinates of the left corner of the row of | |
4359 | pixels to be copied. | |
4360 | ||
4361 | WIDTH | |
4362 | Specifies the width of the texture image. Must be 0 or | |
4363 | 2^N+2\u2061(BORDER,) for some integer N . The height of the texture | |
4364 | image is 1. | |
4365 | ||
4366 | BORDER | |
4367 | Specifies the width of the border. Must be either 0 or 1. | |
4368 | ||
4369 | `glCopyTexImage1D' defines a one-dimensional texture image with pixels | |
4370 | from the current `GL_READ_BUFFER'. | |
4371 | ||
4372 | The screen-aligned pixel row with left corner at (X,Y) and with a length | |
4373 | of WIDTH+2\u2061(BORDER,) defines the texture array at the mipmap level | |
4374 | specified by LEVEL. INTERNALFORMAT specifies the internal format of the | |
4375 | texture array. | |
4376 | ||
4377 | The pixels in the row are processed exactly as if `glCopyPixels' had | |
4378 | been called, but the process stops just before final conversion. At this | |
4379 | point all pixel component values are clamped to the range [0,1] and then | |
4380 | converted to the texture's internal format for storage in the texel | |
4381 | array. | |
4382 | ||
4383 | Pixel ordering is such that lower X screen coordinates correspond to | |
4384 | lower texture coordinates. | |
4385 | ||
4386 | If any of the pixels within the specified row of the current | |
4387 | `GL_READ_BUFFER' are outside the window associated with the current | |
4388 | rendering context, then the values obtained for those pixels are | |
4389 | undefined. | |
4390 | ||
4391 | `glCopyTexImage1D' defines a one-dimensional texture image with pixels | |
4392 | from the current `GL_READ_BUFFER'. | |
4393 | ||
4394 | When INTERNALFORMAT is one of the sRGB types, the GL does not | |
4395 | automatically convert the source pixels to the sRGB color space. In this | |
4396 | case, the `glPixelMap' function can be used to accomplish the | |
4397 | conversion. | |
4398 | ||
4399 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
4400 | values. | |
4401 | ||
4402 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
4403 | ||
4404 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX , | |
4405 | where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
4406 | ||
4407 | `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an allowable | |
4408 | value. | |
4409 | ||
4410 | `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than | |
4411 | 2 + `GL_MAX_TEXTURE_SIZE'. | |
4412 | ||
4413 | `GL_INVALID_VALUE' is generated if non-power-of-two textures are not | |
4414 | supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for | |
4415 | some integer value of N. | |
4416 | ||
4417 | `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1. | |
4418 | ||
4419 | `GL_INVALID_OPERATION' is generated if `glCopyTexImage1D' is executed | |
4420 | between the execution of `glBegin' and the corresponding execution of | |
4421 | `glEnd'. | |
4422 | ||
4423 | `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is | |
4424 | `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or | |
4425 | `GL_DEPTH_COMPONENT32' and there is no depth buffer.") | |
8925f36f AW |
4426 | |
4427 | (define-gl-procedure | |
bb894c9d AW |
4428 | ((glCopyTexImage2D |
4429 | (target GLenum) | |
4430 | (level GLint) | |
4431 | (internalformat GLenum) | |
4432 | (x GLint) | |
4433 | (y GLint) | |
4434 | (width GLsizei) | |
4435 | (height GLsizei) | |
4436 | (border GLint) | |
4437 | -> | |
4438 | void)) | |
3c9b6116 AW |
4439 | "Copy pixels into a 2D texture image. |
4440 | ||
4441 | TARGET | |
4442 | Specifies the target texture. Must be `GL_TEXTURE_2D', | |
4443 | `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | |
4444 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | |
4445 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or | |
4446 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'. | |
4447 | ||
4448 | LEVEL | |
4449 | Specifies the level-of-detail number. Level 0 is the base image | |
4450 | level. Level N is the Nth mipmap reduction image. | |
4451 | ||
4452 | INTERNALFORMAT | |
4453 | Specifies the internal format of the texture. Must be one of the | |
4454 | following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', | |
4455 | `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA', | |
4456 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
4457 | `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', | |
4458 | `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', | |
4459 | `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', | |
4460 | `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12', | |
4461 | `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
4462 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
4463 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
4464 | `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4', | |
4465 | `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB', | |
4466 | `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', | |
4467 | `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', | |
4468 | `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16', | |
4469 | `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA', | |
4470 | `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or | |
4471 | `GL_SRGB8_ALPHA8'. | |
4472 | ||
4473 | X | |
4474 | Y | |
4475 | ||
4476 | Specify the window coordinates of the lower left corner of the | |
4477 | rectangular region of pixels to be copied. | |
4478 | ||
4479 | WIDTH | |
4480 | Specifies the width of the texture image. Must be 0 or | |
4481 | 2^N+2\u2061(BORDER,) for some integer N . | |
4482 | ||
4483 | HEIGHT | |
4484 | Specifies the height of the texture image. Must be 0 or | |
4485 | 2^M+2\u2061(BORDER,) for some integer M . | |
4486 | ||
4487 | BORDER | |
4488 | Specifies the width of the border. Must be either 0 or 1. | |
4489 | ||
4490 | `glCopyTexImage2D' defines a two-dimensional texture image, or cube-map | |
4491 | texture image with pixels from the current `GL_READ_BUFFER'. | |
4492 | ||
4493 | The screen-aligned pixel rectangle with lower left corner at (X, Y) and | |
4494 | with a width of WIDTH+2\u2061(BORDER,) and a height of HEIGHT+2\u2061(BORDER,) | |
4495 | defines the texture array at the mipmap level specified by LEVEL. | |
4496 | INTERNALFORMAT specifies the internal format of the texture array. | |
4497 | ||
4498 | The pixels in the rectangle are processed exactly as if `glCopyPixels' | |
4499 | had been called, but the process stops just before final conversion. At | |
4500 | this point all pixel component values are clamped to the range [0,1] and | |
4501 | then converted to the texture's internal format for storage in the texel | |
4502 | array. | |
4503 | ||
4504 | Pixel ordering is such that lower X and Y screen coordinates correspond | |
4505 | to lower S and T texture coordinates. | |
4506 | ||
4507 | If any of the pixels within the specified rectangle of the current | |
4508 | `GL_READ_BUFFER' are outside the window associated with the current | |
4509 | rendering context, then the values obtained for those pixels are | |
4510 | undefined. | |
4511 | ||
4512 | When INTERNALFORMAT is one of the sRGB types, the GL does not | |
4513 | automatically convert the source pixels to the sRGB color space. In this | |
4514 | case, the `glPixelMap' function can be used to accomplish the | |
4515 | conversion. | |
4516 | ||
4517 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D', | |
4518 | `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | |
4519 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | |
4520 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'. | |
4521 | ||
4522 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
4523 | ||
4524 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX , | |
4525 | where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
4526 | ||
4527 | `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than | |
4528 | 2 + `GL_MAX_TEXTURE_SIZE'. | |
4529 | ||
4530 | `GL_INVALID_VALUE' is generated if non-power-of-two textures are not | |
4531 | supported and the WIDTH or DEPTH cannot be represented as | |
4532 | 2^K+2\u2061(BORDER,) for some integer K . | |
4533 | ||
4534 | `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1. | |
4535 | ||
4536 | `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an accepted | |
4537 | format. | |
4538 | ||
4539 | `GL_INVALID_OPERATION' is generated if `glCopyTexImage2D' is executed | |
4540 | between the execution of `glBegin' and the corresponding execution of | |
4541 | `glEnd'. | |
4542 | ||
4543 | `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is | |
4544 | `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or | |
4545 | `GL_DEPTH_COMPONENT32' and there is no depth buffer.") | |
8925f36f AW |
4546 | |
4547 | (define-gl-procedure | |
bb894c9d AW |
4548 | ((glCopyTexSubImage1D |
4549 | (target GLenum) | |
4550 | (level GLint) | |
4551 | (xoffset GLint) | |
4552 | (x GLint) | |
4553 | (y GLint) | |
4554 | (width GLsizei) | |
4555 | -> | |
4556 | void)) | |
3c9b6116 AW |
4557 | "Copy a one-dimensional texture subimage. |
4558 | ||
4559 | TARGET | |
4560 | Specifies the target texture. Must be `GL_TEXTURE_1D'. | |
4561 | ||
4562 | LEVEL | |
4563 | Specifies the level-of-detail number. Level 0 is the base image | |
4564 | level. Level N is the Nth mipmap reduction image. | |
4565 | ||
4566 | XOFFSET | |
4567 | Specifies the texel offset within the texture array. | |
4568 | ||
4569 | X | |
4570 | Y | |
4571 | ||
4572 | Specify the window coordinates of the left corner of the row of | |
4573 | pixels to be copied. | |
4574 | ||
4575 | WIDTH | |
4576 | Specifies the width of the texture subimage. | |
4577 | ||
4578 | `glCopyTexSubImage1D' replaces a portion of a one-dimensional texture | |
4579 | image with pixels from the current `GL_READ_BUFFER' (rather than from | |
4580 | main memory, as is the case for `glTexSubImage1D'). | |
4581 | ||
4582 | The screen-aligned pixel row with left corner at (X,\\ Y), and with | |
4583 | length WIDTH replaces the portion of the texture array with x indices | |
4584 | XOFFSET through XOFFSET+WIDTH-1 , inclusive. The destination in the | |
4585 | texture array may not include any texels outside the texture array as it | |
4586 | was originally specified. | |
4587 | ||
4588 | The pixels in the row are processed exactly as if `glCopyPixels' had | |
4589 | been called, but the process stops just before final conversion. At this | |
4590 | point, all pixel component values are clamped to the range [0,1] and | |
4591 | then converted to the texture's internal format for storage in the texel | |
4592 | array. | |
4593 | ||
4594 | It is not an error to specify a subtexture with zero width, but such a | |
4595 | specification has no effect. If any of the pixels within the specified | |
4596 | row of the current `GL_READ_BUFFER' are outside the read window | |
4597 | associated with the current rendering context, then the values obtained | |
4598 | for those pixels are undefined. | |
4599 | ||
4600 | No change is made to the INTERNALFORMAT, WIDTH, or BORDER parameters of | |
4601 | the specified texture array or to texel values outside the specified | |
4602 | subregion. | |
4603 | ||
4604 | `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_1D'. | |
4605 | ||
4606 | `GL_INVALID_OPERATION' is generated if the texture array has not been | |
4607 | defined by a previous `glTexImage1D' or `glCopyTexImage1D' operation. | |
4608 | ||
4609 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
4610 | ||
4611 | `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is | |
4612 | the returned value of `GL_MAX_TEXTURE_SIZE'. | |
4613 | ||
4614 | `GL_INVALID_VALUE' is generated if XOFFSET<-B , or | |
4615 | (XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH' and B is the | |
4616 | `GL_TEXTURE_BORDER' of the texture image being modified. Note that W | |
4617 | includes twice the border width.") | |
8925f36f AW |
4618 | |
4619 | (define-gl-procedure | |
bb894c9d AW |
4620 | ((glCopyTexSubImage2D |
4621 | (target GLenum) | |
4622 | (level GLint) | |
4623 | (xoffset GLint) | |
4624 | (yoffset GLint) | |
4625 | (x GLint) | |
4626 | (y GLint) | |
4627 | (width GLsizei) | |
4628 | (height GLsizei) | |
4629 | -> | |
4630 | void)) | |
3c9b6116 AW |
4631 | "Copy a two-dimensional texture subimage. |
4632 | ||
4633 | TARGET | |
4634 | Specifies the target texture. Must be `GL_TEXTURE_2D', | |
4635 | `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | |
4636 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | |
4637 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or | |
4638 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'. | |
4639 | ||
4640 | LEVEL | |
4641 | Specifies the level-of-detail number. Level 0 is the base image | |
4642 | level. Level N is the Nth mipmap reduction image. | |
4643 | ||
4644 | XOFFSET | |
4645 | Specifies a texel offset in the x direction within the texture | |
4646 | array. | |
4647 | ||
4648 | YOFFSET | |
4649 | Specifies a texel offset in the y direction within the texture | |
4650 | array. | |
4651 | ||
4652 | X | |
4653 | Y | |
4654 | ||
4655 | Specify the window coordinates of the lower left corner of the | |
4656 | rectangular region of pixels to be copied. | |
4657 | ||
4658 | WIDTH | |
4659 | Specifies the width of the texture subimage. | |
4660 | ||
4661 | HEIGHT | |
4662 | Specifies the height of the texture subimage. | |
4663 | ||
4664 | `glCopyTexSubImage2D' replaces a rectangular portion of a | |
4665 | two-dimensional texture image or cube-map texture image with pixels from | |
4666 | the current `GL_READ_BUFFER' (rather than from main memory, as is the | |
4667 | case for `glTexSubImage2D'). | |
4668 | ||
4669 | The screen-aligned pixel rectangle with lower left corner at (X,Y) and | |
4670 | with width WIDTH and height HEIGHT replaces the portion of the texture | |
4671 | array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y | |
4672 | indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at the mipmap | |
4673 | level specified by LEVEL. | |
4674 | ||
4675 | The pixels in the rectangle are processed exactly as if `glCopyPixels' | |
4676 | had been called, but the process stops just before final conversion. At | |
4677 | this point, all pixel component values are clamped to the range [0,1] | |
4678 | and then converted to the texture's internal format for storage in the | |
4679 | texel array. | |
4680 | ||
4681 | The destination rectangle in the texture array may not include any | |
4682 | texels outside the texture array as it was originally specified. It is | |
4683 | not an error to specify a subtexture with zero width or height, but such | |
4684 | a specification has no effect. | |
4685 | ||
4686 | If any of the pixels within the specified rectangle of the current | |
4687 | `GL_READ_BUFFER' are outside the read window associated with the current | |
4688 | rendering context, then the values obtained for those pixels are | |
4689 | undefined. | |
4690 | ||
4691 | No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, or BORDER | |
4692 | parameters of the specified texture array or to texel values outside the | |
4693 | specified subregion. | |
4694 | ||
4695 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D', | |
4696 | `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | |
4697 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | |
4698 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'. | |
4699 | ||
4700 | `GL_INVALID_OPERATION' is generated if the texture array has not been | |
4701 | defined by a previous `glTexImage2D' or `glCopyTexImage2D' operation. | |
4702 | ||
4703 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
4704 | ||
4705 | `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is | |
4706 | the returned value of `GL_MAX_TEXTURE_SIZE'. | |
4707 | ||
4708 | `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,) | |
4709 | , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the | |
4710 | `GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the | |
4711 | `GL_TEXTURE_BORDER' of the texture image being modified. Note that W and | |
4712 | H include twice the border width. | |
4713 | ||
4714 | `GL_INVALID_OPERATION' is generated if `glCopyTexSubImage2D' is executed | |
4715 | between the execution of `glBegin' and the corresponding execution of | |
4716 | `glEnd'.") | |
8925f36f AW |
4717 | |
4718 | (define-gl-procedure | |
bb894c9d AW |
4719 | ((glCopyTexSubImage3D |
4720 | (target GLenum) | |
4721 | (level GLint) | |
4722 | (xoffset GLint) | |
4723 | (yoffset GLint) | |
4724 | (zoffset GLint) | |
4725 | (x GLint) | |
4726 | (y GLint) | |
4727 | (width GLsizei) | |
4728 | (height GLsizei) | |
4729 | -> | |
4730 | void)) | |
3c9b6116 AW |
4731 | "Copy a three-dimensional texture subimage. |
4732 | ||
4733 | TARGET | |
4734 | Specifies the target texture. Must be `GL_TEXTURE_3D' | |
4735 | ||
4736 | LEVEL | |
4737 | Specifies the level-of-detail number. Level 0 is the base image | |
4738 | level. Level N is the Nth mipmap reduction image. | |
4739 | ||
4740 | XOFFSET | |
4741 | Specifies a texel offset in the x direction within the texture | |
4742 | array. | |
4743 | ||
4744 | YOFFSET | |
4745 | Specifies a texel offset in the y direction within the texture | |
4746 | array. | |
4747 | ||
4748 | ZOFFSET | |
4749 | Specifies a texel offset in the z direction within the texture | |
4750 | array. | |
4751 | ||
4752 | X | |
4753 | Y | |
4754 | ||
4755 | Specify the window coordinates of the lower left corner of the | |
4756 | rectangular region of pixels to be copied. | |
4757 | ||
4758 | WIDTH | |
4759 | Specifies the width of the texture subimage. | |
4760 | ||
4761 | HEIGHT | |
4762 | Specifies the height of the texture subimage. | |
4763 | ||
4764 | `glCopyTexSubImage3D' replaces a rectangular portion of a | |
4765 | three-dimensional texture image with pixels from the current | |
4766 | `GL_READ_BUFFER' (rather than from main memory, as is the case for | |
4767 | `glTexSubImage3D'). | |
4768 | ||
4769 | The screen-aligned pixel rectangle with lower left corner at (X,\\ Y) and | |
4770 | with width WIDTH and height HEIGHT replaces the portion of the texture | |
4771 | array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y | |
4772 | indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at z index ZOFFSET | |
4773 | and at the mipmap level specified by LEVEL. | |
4774 | ||
4775 | The pixels in the rectangle are processed exactly as if `glCopyPixels' | |
4776 | had been called, but the process stops just before final conversion. At | |
4777 | this point, all pixel component values are clamped to the range [0,1] | |
4778 | and then converted to the texture's internal format for storage in the | |
4779 | texel array. | |
4780 | ||
4781 | The destination rectangle in the texture array may not include any | |
4782 | texels outside the texture array as it was originally specified. It is | |
4783 | not an error to specify a subtexture with zero width or height, but such | |
4784 | a specification has no effect. | |
4785 | ||
4786 | If any of the pixels within the specified rectangle of the current | |
4787 | `GL_READ_BUFFER' are outside the read window associated with the current | |
4788 | rendering context, then the values obtained for those pixels are | |
4789 | undefined. | |
4790 | ||
4791 | No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, DEPTH, or BORDER | |
4792 | parameters of the specified texture array or to texel values outside the | |
4793 | specified subregion. | |
4794 | ||
4795 | `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'. | |
4796 | ||
4797 | `GL_INVALID_OPERATION' is generated if the texture array has not been | |
4798 | defined by a previous `glTexImage3D' operation. | |
4799 | ||
4800 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
4801 | ||
4802 | `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is | |
4803 | the returned value of `GL_MAX_3D_TEXTURE_SIZE'. | |
4804 | ||
4805 | `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,) | |
4806 | , YOFFSET<-B , (YOFFSET+HEIGHT,)>(H-B,) , ZOFFSET<-B , or | |
4807 | (ZOFFSET+1,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the | |
4808 | `GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH', and B is the | |
4809 | `GL_TEXTURE_BORDER' of the texture image being modified. Note that W , H | |
4810 | , and D include twice the border width. | |
4811 | ||
4812 | `GL_INVALID_OPERATION' is generated if `glCopyTexSubImage3D' is executed | |
4813 | between the execution of `glBegin' and the corresponding execution of | |
4814 | `glEnd'.") | |
8925f36f AW |
4815 | |
4816 | (define-gl-procedure | |
bb894c9d | 4817 | ((glCreateProgram -> GLuint)) |
3c9b6116 AW |
4818 | "Creates a program object. |
4819 | ||
4820 | `glCreateProgram' creates an empty program object and returns a non-zero | |
4821 | value by which it can be referenced. A program object is an object to | |
4822 | which shader objects can be attached. This provides a mechanism to | |
4823 | specify the shader objects that will be linked to create a program. It | |
4824 | also provides a means for checking the compatibility of the shaders that | |
4825 | will be used to create a program (for instance, checking the | |
4826 | compatibility between a vertex shader and a fragment shader). When no | |
4827 | longer needed as part of a program object, shader objects can be | |
4828 | detached. | |
4829 | ||
4830 | One or more executables are created in a program object by successfully | |
4831 | attaching shader objects to it with `glAttachShader', successfully | |
4832 | compiling the shader objects with `glCompileShader', and successfully | |
4833 | linking the program object with `glLinkProgram'. These executables are | |
4834 | made part of current state when `glUseProgram' is called. Program | |
4835 | objects can be deleted by calling `glDeleteProgram'. The memory | |
4836 | associated with the program object will be deleted when it is no longer | |
4837 | part of current rendering state for any context. | |
4838 | ||
4839 | This function returns 0 if an error occurs creating the program object. | |
4840 | ||
4841 | `GL_INVALID_OPERATION' is generated if `glCreateProgram' is executed | |
4842 | between the execution of `glBegin' and the corresponding execution of | |
4843 | `glEnd'.") | |
8925f36f AW |
4844 | |
4845 | (define-gl-procedure | |
bb894c9d | 4846 | ((glCreateShader (shaderType GLenum) -> GLuint)) |
3c9b6116 AW |
4847 | "Creates a shader object. |
4848 | ||
4849 | SHADERTYPE | |
4850 | Specifies the type of shader to be created. Must be either | |
4851 | `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER'. | |
4852 | ||
4853 | `glCreateShader' creates an empty shader object and returns a non-zero | |
4854 | value by which it can be referenced. A shader object is used to maintain | |
4855 | the source code strings that define a shader. SHADERTYPE indicates the | |
4856 | type of shader to be created. Two types of shaders are supported. A | |
4857 | shader of type `GL_VERTEX_SHADER' is a shader that is intended to run on | |
4858 | the programmable vertex processor and replace the fixed functionality | |
4859 | vertex processing in OpenGL. A shader of type `GL_FRAGMENT_SHADER' is a | |
4860 | shader that is intended to run on the programmable fragment processor | |
4861 | and replace the fixed functionality fragment processing in OpenGL. | |
4862 | ||
4863 | When created, a shader object's `GL_SHADER_TYPE' parameter is set to | |
4864 | either `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER', depending on the | |
4865 | value of SHADERTYPE. | |
4866 | ||
4867 | This function returns 0 if an error occurs creating the shader object. | |
4868 | ||
4869 | `GL_INVALID_ENUM' is generated if SHADERTYPE is not an accepted value. | |
4870 | ||
4871 | `GL_INVALID_OPERATION' is generated if `glCreateShader' is executed | |
4872 | between the execution of `glBegin' and the corresponding execution of | |
4873 | `glEnd'.") | |
8925f36f AW |
4874 | |
4875 | (define-gl-procedure | |
bb894c9d | 4876 | ((glCullFace (mode GLenum) -> void)) |
3c9b6116 AW |
4877 | "Specify whether front- or back-facing facets can be culled. |
4878 | ||
4879 | MODE | |
4880 | Specifies whether front- or back-facing facets are candidates for | |
4881 | culling. Symbolic constants `GL_FRONT', `GL_BACK', and | |
4882 | `GL_FRONT_AND_BACK' are accepted. The initial value is `GL_BACK'. | |
4883 | ||
4884 | `glCullFace' specifies whether front- or back-facing facets are culled | |
4885 | (as specified by MODE) when facet culling is enabled. Facet culling is | |
4886 | initially disabled. To enable and disable facet culling, call the | |
4887 | `glEnable' and `glDisable' commands with the argument `GL_CULL_FACE'. | |
4888 | Facets include triangles, quadrilaterals, polygons, and rectangles. | |
4889 | ||
4890 | `glFrontFace' specifies which of the clockwise and counterclockwise | |
4891 | facets are front-facing and back-facing. See `glFrontFace'. | |
4892 | ||
4893 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
4894 | ||
4895 | `GL_INVALID_OPERATION' is generated if `glCullFace' is executed between | |
4896 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
4897 | |
4898 | (define-gl-procedure | |
bb894c9d | 4899 | ((glDeleteBuffers (n GLsizei) (buffers *) -> void)) |
3c9b6116 AW |
4900 | "Delete named buffer objects. |
4901 | ||
4902 | N | |
4903 | Specifies the number of buffer objects to be deleted. | |
4904 | ||
4905 | BUFFERS | |
4906 | Specifies an array of buffer objects to be deleted. | |
4907 | ||
4908 | `glDeleteBuffers' deletes N buffer objects named by the elements of the | |
4909 | array BUFFERS. After a buffer object is deleted, it has no contents, and | |
4910 | its name is free for reuse (for example by `glGenBuffers'). If a buffer | |
4911 | object that is currently bound is deleted, the binding reverts to 0 (the | |
4912 | absence of any buffer object, which reverts to client memory usage). | |
4913 | ||
4914 | `glDeleteBuffers' silently ignores 0's and names that do not correspond | |
4915 | to existing buffer objects. | |
4916 | ||
4917 | `GL_INVALID_VALUE' is generated if N is negative. | |
4918 | ||
4919 | `GL_INVALID_OPERATION' is generated if `glDeleteBuffers' is executed | |
4920 | between the execution of `glBegin' and the corresponding execution of | |
4921 | `glEnd'.") | |
8925f36f AW |
4922 | |
4923 | (define-gl-procedure | |
bb894c9d AW |
4924 | ((glDeleteLists |
4925 | (list GLuint) | |
4926 | (range GLsizei) | |
4927 | -> | |
4928 | void)) | |
3c9b6116 AW |
4929 | "Delete a contiguous group of display lists. |
4930 | ||
4931 | LIST | |
4932 | Specifies the integer name of the first display list to delete. | |
4933 | ||
4934 | RANGE | |
4935 | Specifies the number of display lists to delete. | |
4936 | ||
4937 | `glDeleteLists' causes a contiguous group of display lists to be | |
4938 | deleted. LIST is the name of the first display list to be deleted, and | |
4939 | RANGE is the number of display lists to delete. All display lists D with | |
4940 | LIST<=D<=LIST+RANGE-1 are deleted. | |
4941 | ||
4942 | All storage locations allocated to the specified display lists are | |
4943 | freed, and the names are available for reuse at a later time. Names | |
4944 | within the range that do not have an associated display list are | |
4945 | ignored. If RANGE is 0, nothing happens. | |
4946 | ||
4947 | `GL_INVALID_VALUE' is generated if RANGE is negative. | |
4948 | ||
4949 | `GL_INVALID_OPERATION' is generated if `glDeleteLists' is executed | |
4950 | between the execution of `glBegin' and the corresponding execution of | |
4951 | `glEnd'.") | |
8925f36f AW |
4952 | |
4953 | (define-gl-procedure | |
bb894c9d | 4954 | ((glDeleteProgram (program GLuint) -> void)) |
3c9b6116 AW |
4955 | "Deletes a program object. |
4956 | ||
4957 | PROGRAM | |
4958 | Specifies the program object to be deleted. | |
4959 | ||
4960 | `glDeleteProgram' frees the memory and invalidates the name associated | |
4961 | with the program object specified by PROGRAM. This command effectively | |
4962 | undoes the effects of a call to `glCreateProgram'. | |
4963 | ||
4964 | If a program object is in use as part of current rendering state, it | |
4965 | will be flagged for deletion, but it will not be deleted until it is no | |
4966 | longer part of current state for any rendering context. If a program | |
4967 | object to be deleted has shader objects attached to it, those shader | |
4968 | objects will be automatically detached but not deleted unless they have | |
4969 | already been flagged for deletion by a previous call to | |
4970 | `glDeleteShader'. A value of 0 for PROGRAM will be silently ignored. | |
4971 | ||
4972 | To determine whether a program object has been flagged for deletion, | |
4973 | call `glGetProgram' with arguments PROGRAM and `GL_DELETE_STATUS'. | |
4974 | ||
4975 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by | |
4976 | OpenGL. | |
4977 | ||
4978 | `GL_INVALID_OPERATION' is generated if `glDeleteProgram' is executed | |
4979 | between the execution of `glBegin' and the corresponding execution of | |
4980 | `glEnd'.") | |
8925f36f AW |
4981 | |
4982 | (define-gl-procedure | |
bb894c9d | 4983 | ((glDeleteQueries (n GLsizei) (ids *) -> void)) |
3c9b6116 AW |
4984 | "Delete named query objects. |
4985 | ||
4986 | N | |
4987 | Specifies the number of query objects to be deleted. | |
4988 | ||
4989 | IDS | |
4990 | Specifies an array of query objects to be deleted. | |
4991 | ||
4992 | `glDeleteQueries' deletes N query objects named by the elements of the | |
4993 | array IDS. After a query object is deleted, it has no contents, and its | |
4994 | name is free for reuse (for example by `glGenQueries'). | |
4995 | ||
4996 | `glDeleteQueries' silently ignores 0's and names that do not correspond | |
4997 | to existing query objects. | |
4998 | ||
4999 | `GL_INVALID_VALUE' is generated if N is negative. | |
5000 | ||
5001 | `GL_INVALID_OPERATION' is generated if `glDeleteQueries' is executed | |
5002 | between the execution of `glBegin' and the corresponding execution of | |
5003 | `glEnd'.") | |
8925f36f AW |
5004 | |
5005 | (define-gl-procedure | |
bb894c9d | 5006 | ((glDeleteShader (shader GLuint) -> void)) |
3c9b6116 AW |
5007 | "Deletes a shader object. |
5008 | ||
5009 | SHADER | |
5010 | Specifies the shader object to be deleted. | |
5011 | ||
5012 | `glDeleteShader' frees the memory and invalidates the name associated | |
5013 | with the shader object specified by SHADER. This command effectively | |
5014 | undoes the effects of a call to `glCreateShader'. | |
5015 | ||
5016 | If a shader object to be deleted is attached to a program object, it | |
5017 | will be flagged for deletion, but it will not be deleted until it is no | |
5018 | longer attached to any program object, for any rendering context (i.e., | |
5019 | it must be detached from wherever it was attached before it will be | |
5020 | deleted). A value of 0 for SHADER will be silently ignored. | |
5021 | ||
5022 | To determine whether an object has been flagged for deletion, call | |
5023 | `glGetShader' with arguments SHADER and `GL_DELETE_STATUS'. | |
5024 | ||
5025 | `GL_INVALID_VALUE' is generated if SHADER is not a value generated by | |
5026 | OpenGL. | |
5027 | ||
5028 | `GL_INVALID_OPERATION' is generated if `glDeleteShader' is executed | |
5029 | between the execution of `glBegin' and the corresponding execution of | |
5030 | `glEnd'.") | |
8925f36f AW |
5031 | |
5032 | (define-gl-procedure | |
bb894c9d AW |
5033 | ((glDeleteTextures |
5034 | (n GLsizei) | |
5035 | (textures *) | |
5036 | -> | |
5037 | void)) | |
3c9b6116 AW |
5038 | "Delete named textures. |
5039 | ||
5040 | N | |
5041 | Specifies the number of textures to be deleted. | |
5042 | ||
5043 | TEXTURES | |
5044 | Specifies an array of textures to be deleted. | |
5045 | ||
5046 | `glDeleteTextures' deletes N textures named by the elements of the array | |
5047 | TEXTURES. After a texture is deleted, it has no contents or | |
5048 | dimensionality, and its name is free for reuse (for example by | |
5049 | `glGenTextures'). If a texture that is currently bound is deleted, the | |
5050 | binding reverts to 0 (the default texture). | |
5051 | ||
5052 | `glDeleteTextures' silently ignores 0's and names that do not correspond | |
5053 | to existing textures. | |
5054 | ||
5055 | `GL_INVALID_VALUE' is generated if N is negative. | |
5056 | ||
5057 | `GL_INVALID_OPERATION' is generated if `glDeleteTextures' is executed | |
5058 | between the execution of `glBegin' and the corresponding execution of | |
5059 | `glEnd'.") | |
8925f36f AW |
5060 | |
5061 | (define-gl-procedure | |
bb894c9d | 5062 | ((glDepthFunc (func GLenum) -> void)) |
3c9b6116 AW |
5063 | "Specify the value used for depth buffer comparisons. |
5064 | ||
5065 | FUNC | |
5066 | Specifies the depth comparison function. Symbolic constants | |
5067 | `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER', | |
5068 | `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The | |
5069 | initial value is `GL_LESS'. | |
5070 | ||
5071 | `glDepthFunc' specifies the function used to compare each incoming pixel | |
5072 | depth value with the depth value present in the depth buffer. The | |
5073 | comparison is performed only if depth testing is enabled. (See | |
5074 | `glEnable' and `glDisable' of `GL_DEPTH_TEST'.) | |
5075 | ||
5076 | FUNC specifies the conditions under which the pixel will be drawn. The | |
5077 | comparison functions are as follows: | |
5078 | ||
5079 | `GL_NEVER' | |
5080 | Never passes. | |
5081 | ||
5082 | `GL_LESS' | |
5083 | Passes if the incoming depth value is less than the stored depth | |
5084 | value. | |
5085 | ||
5086 | `GL_EQUAL' | |
5087 | Passes if the incoming depth value is equal to the stored depth | |
5088 | value. | |
5089 | ||
5090 | `GL_LEQUAL' | |
5091 | Passes if the incoming depth value is less than or equal to the | |
5092 | stored depth value. | |
5093 | ||
5094 | `GL_GREATER' | |
5095 | Passes if the incoming depth value is greater than the stored depth | |
5096 | value. | |
5097 | ||
5098 | `GL_NOTEQUAL' | |
5099 | Passes if the incoming depth value is not equal to the stored depth | |
5100 | value. | |
5101 | ||
5102 | `GL_GEQUAL' | |
5103 | Passes if the incoming depth value is greater than or equal to the | |
5104 | stored depth value. | |
5105 | ||
5106 | `GL_ALWAYS' | |
5107 | Always passes. | |
5108 | ||
5109 | The initial value of FUNC is `GL_LESS'. Initially, depth testing is | |
5110 | disabled. If depth testing is disabled or if no depth buffer exists, it | |
5111 | is as if the depth test always passes. | |
5112 | ||
5113 | `GL_INVALID_ENUM' is generated if FUNC is not an accepted value. | |
5114 | ||
5115 | `GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between | |
5116 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
5117 | |
5118 | (define-gl-procedure | |
bb894c9d | 5119 | ((glDepthMask (flag GLboolean) -> void)) |
3c9b6116 AW |
5120 | "Enable or disable writing into the depth buffer. |
5121 | ||
5122 | FLAG | |
5123 | Specifies whether the depth buffer is enabled for writing. If FLAG | |
5124 | is `GL_FALSE', depth buffer writing is disabled. Otherwise, it is | |
5125 | enabled. Initially, depth buffer writing is enabled. | |
5126 | ||
5127 | `glDepthMask' specifies whether the depth buffer is enabled for writing. | |
5128 | If FLAG is `GL_FALSE', depth buffer writing is disabled. Otherwise, it | |
5129 | is enabled. Initially, depth buffer writing is enabled. | |
5130 | ||
5131 | `GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between | |
5132 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
5133 | |
5134 | (define-gl-procedure | |
bb894c9d AW |
5135 | ((glDepthRange |
5136 | (nearVal GLclampd) | |
5137 | (farVal GLclampd) | |
5138 | -> | |
5139 | void)) | |
3c9b6116 AW |
5140 | "Specify mapping of depth values from normalized device coordinates to |
5141 | window coordinates. | |
5142 | ||
5143 | NEARVAL | |
5144 | Specifies the mapping of the near clipping plane to window | |
5145 | coordinates. The initial value is 0. | |
5146 | ||
5147 | FARVAL | |
5148 | Specifies the mapping of the far clipping plane to window | |
5149 | coordinates. The initial value is 1. | |
5150 | ||
5151 | After clipping and division by W, depth coordinates range from -1 to 1, | |
5152 | corresponding to the near and far clipping planes. `glDepthRange' | |
5153 | specifies a linear mapping of the normalized depth coordinates in this | |
5154 | range to window depth coordinates. Regardless of the actual depth buffer | |
5155 | implementation, window coordinate depth values are treated as though | |
5156 | they range from 0 through 1 (like color components). Thus, the values | |
5157 | accepted by `glDepthRange' are both clamped to this range before they | |
5158 | are accepted. | |
5159 | ||
5160 | The setting of (0,1) maps the near plane to 0 and the far plane to 1. | |
5161 | With this mapping, the depth buffer range is fully utilized. | |
5162 | ||
5163 | `GL_INVALID_OPERATION' is generated if `glDepthRange' is executed | |
5164 | between the execution of `glBegin' and the corresponding execution of | |
5165 | `glEnd'.") | |
8925f36f AW |
5166 | |
5167 | (define-gl-procedure | |
bb894c9d AW |
5168 | ((glDetachShader |
5169 | (program GLuint) | |
5170 | (shader GLuint) | |
5171 | -> | |
5172 | void)) | |
3c9b6116 AW |
5173 | "Detaches a shader object from a program object to which it is attached. |
5174 | ||
5175 | PROGRAM | |
5176 | Specifies the program object from which to detach the shader | |
5177 | object. | |
5178 | ||
5179 | SHADER | |
5180 | Specifies the shader object to be detached. | |
5181 | ||
5182 | `glDetachShader' detaches the shader object specified by SHADER from the | |
5183 | program object specified by PROGRAM. This command can be used to undo | |
5184 | the effect of the command `glAttachShader'. | |
5185 | ||
5186 | If SHADER has already been flagged for deletion by a call to | |
5187 | `glDeleteShader' and it is not attached to any other program object, it | |
5188 | will be deleted after it has been detached. | |
5189 | ||
5190 | `GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is a value | |
5191 | that was not generated by OpenGL. | |
5192 | ||
5193 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
5194 | ||
5195 | `GL_INVALID_OPERATION' is generated if SHADER is not a shader object. | |
5196 | ||
5197 | `GL_INVALID_OPERATION' is generated if SHADER is not attached to | |
5198 | PROGRAM. | |
5199 | ||
5200 | `GL_INVALID_OPERATION' is generated if `glDetachShader' is executed | |
5201 | between the execution of `glBegin' and the corresponding execution of | |
5202 | `glEnd'.") | |
8925f36f AW |
5203 | |
5204 | (define-gl-procedure | |
bb894c9d AW |
5205 | ((glDrawArrays |
5206 | (mode GLenum) | |
5207 | (first GLint) | |
5208 | (count GLsizei) | |
5209 | -> | |
5210 | void)) | |
3c9b6116 AW |
5211 | "Render primitives from array data. |
5212 | ||
5213 | MODE | |
5214 | Specifies what kind of primitives to render. Symbolic constants | |
5215 | `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES', | |
5216 | `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES', | |
5217 | `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted. | |
5218 | ||
5219 | FIRST | |
5220 | Specifies the starting index in the enabled arrays. | |
5221 | ||
5222 | COUNT | |
5223 | Specifies the number of indices to be rendered. | |
5224 | ||
5225 | `glDrawArrays' specifies multiple geometric primitives with very few | |
5226 | subroutine calls. Instead of calling a GL procedure to pass each | |
5227 | individual vertex, normal, texture coordinate, edge flag, or color, you | |
5228 | can prespecify separate arrays of vertices, normals, and colors and use | |
5229 | them to construct a sequence of primitives with a single call to | |
5230 | `glDrawArrays'. | |
5231 | ||
5232 | When `glDrawArrays' is called, it uses COUNT sequential elements from | |
5233 | each enabled array to construct a sequence of geometric primitives, | |
5234 | beginning with element FIRST. MODE specifies what kind of primitives are | |
5235 | constructed and how the array elements construct those primitives. If | |
5236 | `GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated. | |
5237 | ||
5238 | Vertex attributes that are modified by `glDrawArrays' have an | |
5239 | unspecified value after `glDrawArrays' returns. For example, if | |
5240 | `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined | |
5241 | after `glDrawArrays' executes. Attributes that aren't modified remain | |
5242 | well defined. | |
5243 | ||
5244 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
5245 | ||
5246 | `GL_INVALID_VALUE' is generated if COUNT is negative. | |
5247 | ||
5248 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
5249 | bound to an enabled array and the buffer object's data store is | |
5250 | currently mapped. | |
5251 | ||
5252 | `GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed | |
5253 | between the execution of `glBegin' and the corresponding `glEnd'.") | |
8925f36f AW |
5254 | |
5255 | (define-gl-procedure | |
bb894c9d | 5256 | ((glDrawBuffers (n GLsizei) (bufs *) -> void)) |
3c9b6116 AW |
5257 | "Specifies a list of color buffers to be drawn into. |
5258 | ||
5259 | N | |
5260 | Specifies the number of buffers in BUFS. | |
5261 | ||
5262 | BUFS | |
5263 | Points to an array of symbolic constants specifying the buffers | |
5264 | into which fragment colors or data values will be written. | |
5265 | ||
5266 | `glDrawBuffers' defines an array of buffers into which fragment color | |
5267 | values or fragment data will be written. If no fragment shader is | |
5268 | active, rendering operations will generate only one fragment color per | |
5269 | fragment and it will be written into each of the buffers specified by | |
5270 | BUFS. If a fragment shader is active and it writes a value to the output | |
5271 | variable `gl_FragColor', then that value will be written into each of | |
5272 | the buffers specified by BUFS. If a fragment shader is active and it | |
5273 | writes a value to one or more elements of the output array variable | |
5274 | `gl_FragData[]', then the value of `gl_FragData[0] ' will be written | |
5275 | into the first buffer specified by BUFS, the value of `gl_FragData[1] ' | |
5276 | will be written into the second buffer specified by BUFS, and so on up | |
5277 | to `gl_FragData[n-1]'. The draw buffer used for `gl_FragData[n]' and | |
5278 | beyond is implicitly set to be `GL_NONE'. | |
5279 | ||
5280 | The symbolic constants contained in BUFS may be any of the following: | |
5281 | ||
5282 | `GL_NONE' | |
5283 | The fragment color/data value is not written into any color buffer. | |
5284 | ||
5285 | `GL_FRONT_LEFT' | |
5286 | The fragment color/data value is written into the front left color | |
5287 | buffer. | |
5288 | ||
5289 | `GL_FRONT_RIGHT' | |
5290 | The fragment color/data value is written into the front right color | |
5291 | buffer. | |
5292 | ||
5293 | `GL_BACK_LEFT' | |
5294 | The fragment color/data value is written into the back left color | |
5295 | buffer. | |
5296 | ||
5297 | `GL_BACK_RIGHT' | |
5298 | The fragment color/data value is written into the back right color | |
5299 | buffer. | |
5300 | ||
5301 | `GL_AUXi' | |
5302 | The fragment color/data value is written into auxiliary buffer `i'. | |
5303 | ||
5304 | Except for `GL_NONE', the preceding symbolic constants may not appear | |
5305 | more than once in BUFS. The maximum number of draw buffers supported is | |
5306 | implementation dependent and can be queried by calling `glGet' with the | |
5307 | argument `GL_MAX_DRAW_BUFFERS'. The number of auxiliary buffers can be | |
5308 | queried by calling `glGet' with the argument `GL_AUX_BUFFERS'. | |
5309 | ||
5310 | `GL_INVALID_ENUM' is generated if one of the values in BUFS is not an | |
5311 | accepted value. | |
5312 | ||
5313 | `GL_INVALID_ENUM' is generated if N is less than 0. | |
5314 | ||
5315 | `GL_INVALID_OPERATION' is generated if a symbolic constant other than | |
5316 | `GL_NONE' appears more than once in BUFS. | |
5317 | ||
5318 | `GL_INVALID_OPERATION' is generated if any of the entries in BUFS (other | |
5319 | than `GL_NONE' ) indicates a color buffer that does not exist in the | |
5320 | current GL context. | |
5321 | ||
5322 | `GL_INVALID_VALUE' is generated if N is greater than | |
5323 | `GL_MAX_DRAW_BUFFERS'. | |
5324 | ||
5325 | `GL_INVALID_OPERATION' is generated if `glDrawBuffers' is executed | |
5326 | between the execution of `glBegin' and the corresponding execution of | |
5327 | `glEnd'.") | |
8925f36f AW |
5328 | |
5329 | (define-gl-procedure | |
bb894c9d | 5330 | ((glDrawBuffer (mode GLenum) -> void)) |
3c9b6116 AW |
5331 | "Specify which color buffers are to be drawn into. |
5332 | ||
5333 | MODE | |
5334 | Specifies up to four color buffers to be drawn into. Symbolic | |
5335 | constants `GL_NONE', `GL_FRONT_LEFT', `GL_FRONT_RIGHT', | |
5336 | `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', `GL_BACK', `GL_LEFT', | |
5337 | `GL_RIGHT', `GL_FRONT_AND_BACK', and `GL_AUX'I, where I is between | |
5338 | 0 and the value of `GL_AUX_BUFFERS' minus 1, are accepted. | |
5339 | (`GL_AUX_BUFFERS' is not the upper limit; use `glGet' to query the | |
5340 | number of available aux buffers.) The initial value is `GL_FRONT' | |
5341 | for single-buffered contexts, and `GL_BACK' for double-buffered | |
5342 | contexts. | |
5343 | ||
5344 | When colors are written to the frame buffer, they are written into the | |
5345 | color buffers specified by `glDrawBuffer'. The specifications are as | |
5346 | follows: | |
5347 | ||
5348 | `GL_NONE' | |
5349 | No color buffers are written. | |
5350 | ||
5351 | `GL_FRONT_LEFT' | |
5352 | Only the front left color buffer is written. | |
5353 | ||
5354 | `GL_FRONT_RIGHT' | |
5355 | Only the front right color buffer is written. | |
5356 | ||
5357 | `GL_BACK_LEFT' | |
5358 | Only the back left color buffer is written. | |
5359 | ||
5360 | `GL_BACK_RIGHT' | |
5361 | Only the back right color buffer is written. | |
5362 | ||
5363 | `GL_FRONT' | |
5364 | Only the front left and front right color buffers are written. If | |
5365 | there is no front right color buffer, only the front left color | |
5366 | buffer is written. | |
5367 | ||
5368 | `GL_BACK' | |
5369 | Only the back left and back right color buffers are written. If | |
5370 | there is no back right color buffer, only the back left color | |
5371 | buffer is written. | |
5372 | ||
5373 | `GL_LEFT' | |
5374 | Only the front left and back left color buffers are written. If | |
5375 | there is no back left color buffer, only the front left color | |
5376 | buffer is written. | |
5377 | ||
5378 | `GL_RIGHT' | |
5379 | Only the front right and back right color buffers are written. If | |
5380 | there is no back right color buffer, only the front right color | |
5381 | buffer is written. | |
5382 | ||
5383 | `GL_FRONT_AND_BACK' | |
5384 | All the front and back color buffers (front left, front right, back | |
5385 | left, back right) are written. If there are no back color buffers, | |
5386 | only the front left and front right color buffers are written. If | |
5387 | there are no right color buffers, only the front left and back left | |
5388 | color buffers are written. If there are no right or back color | |
5389 | buffers, only the front left color buffer is written. | |
5390 | ||
5391 | `GL_AUX'I | |
5392 | Only auxiliary color buffer I is written. | |
5393 | ||
5394 | If more than one color buffer is selected for drawing, then blending or | |
5395 | logical operations are computed and applied independently for each color | |
5396 | buffer and can produce different results in each buffer. | |
5397 | ||
5398 | Monoscopic contexts include only LEFT buffers, and stereoscopic contexts | |
5399 | include both LEFT and RIGHT buffers. Likewise, single-buffered contexts | |
5400 | include only FRONT buffers, and double-buffered contexts include both | |
5401 | FRONT and BACK buffers. The context is selected at GL initialization. | |
5402 | ||
5403 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
5404 | ||
5405 | `GL_INVALID_OPERATION' is generated if none of the buffers indicated by | |
5406 | MODE exists. | |
5407 | ||
5408 | `GL_INVALID_OPERATION' is generated if `glDrawBuffer' is executed | |
5409 | between the execution of `glBegin' and the corresponding execution of | |
5410 | `glEnd'.") | |
8925f36f AW |
5411 | |
5412 | (define-gl-procedure | |
bb894c9d AW |
5413 | ((glDrawElements |
5414 | (mode GLenum) | |
5415 | (count GLsizei) | |
5416 | (type GLenum) | |
5417 | (indices *) | |
5418 | -> | |
5419 | void)) | |
3c9b6116 AW |
5420 | "Render primitives from array data. |
5421 | ||
5422 | MODE | |
5423 | Specifies what kind of primitives to render. Symbolic constants | |
5424 | `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES', | |
5425 | `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES', | |
5426 | `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted. | |
5427 | ||
5428 | COUNT | |
5429 | Specifies the number of elements to be rendered. | |
5430 | ||
5431 | TYPE | |
5432 | Specifies the type of the values in INDICES. Must be one of | |
5433 | `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'. | |
5434 | ||
5435 | INDICES | |
5436 | Specifies a pointer to the location where the indices are stored. | |
5437 | ||
5438 | `glDrawElements' specifies multiple geometric primitives with very few | |
5439 | subroutine calls. Instead of calling a GL function to pass each | |
5440 | individual vertex, normal, texture coordinate, edge flag, or color, you | |
5441 | can prespecify separate arrays of vertices, normals, and so on, and use | |
5442 | them to construct a sequence of primitives with a single call to | |
5443 | `glDrawElements'. | |
5444 | ||
5445 | When `glDrawElements' is called, it uses COUNT sequential elements from | |
5446 | an enabled array, starting at INDICES to construct a sequence of | |
5447 | geometric primitives. MODE specifies what kind of primitives are | |
5448 | constructed and how the array elements construct these primitives. If | |
5449 | more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is | |
5450 | not enabled, no geometric primitives are constructed. | |
5451 | ||
5452 | Vertex attributes that are modified by `glDrawElements' have an | |
5453 | unspecified value after `glDrawElements' returns. For example, if | |
5454 | `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined | |
5455 | after `glDrawElements' executes. Attributes that aren't modified | |
5456 | maintain their previous values. | |
5457 | ||
5458 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
5459 | ||
5460 | `GL_INVALID_VALUE' is generated if COUNT is negative. | |
5461 | ||
5462 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
5463 | bound to an enabled array or the element array and the buffer object's | |
5464 | data store is currently mapped. | |
5465 | ||
5466 | `GL_INVALID_OPERATION' is generated if `glDrawElements' is executed | |
5467 | between the execution of `glBegin' and the corresponding `glEnd'.") | |
8925f36f AW |
5468 | |
5469 | (define-gl-procedure | |
bb894c9d AW |
5470 | ((glDrawPixels |
5471 | (width GLsizei) | |
5472 | (height GLsizei) | |
5473 | (format GLenum) | |
5474 | (type GLenum) | |
5475 | (data *) | |
5476 | -> | |
5477 | void)) | |
3c9b6116 | 5478 | "Write a block of pixels to the frame buffer. |
8925f36f | 5479 | |
3c9b6116 AW |
5480 | WIDTH |
5481 | HEIGHT | |
8925f36f | 5482 | |
3c9b6116 AW |
5483 | Specify the dimensions of the pixel rectangle to be written into |
5484 | the frame buffer. | |
8925f36f | 5485 | |
3c9b6116 AW |
5486 | FORMAT |
5487 | Specifies the format of the pixel data. Symbolic constants | |
5488 | `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', | |
5489 | `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_RED', `GL_GREEN', | |
5490 | `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA' are | |
5491 | accepted. | |
8925f36f | 5492 | |
3c9b6116 AW |
5493 | TYPE |
5494 | Specifies the data type for DATA. Symbolic constants | |
5495 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
5496 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
5497 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
5498 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
5499 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
5500 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
5501 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
5502 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
5503 | are accepted. | |
8925f36f | 5504 | |
3c9b6116 AW |
5505 | DATA |
5506 | Specifies a pointer to the pixel data. | |
8925f36f | 5507 | |
3c9b6116 AW |
5508 | `glDrawPixels' reads pixel data from memory and writes it into the frame |
5509 | buffer relative to the current raster position, provided that the raster | |
5510 | position is valid. Use `glRasterPos' or `glWindowPos' to set the current | |
5511 | raster position; use `glGet' with argument | |
5512 | `GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster | |
5513 | position is valid, and `glGet' with argument | |
5514 | `GL_CURRENT_RASTER_POSITION' to query the raster position. | |
8925f36f | 5515 | |
3c9b6116 AW |
5516 | Several parameters define the encoding of pixel data in memory and |
5517 | control the processing of the pixel data before it is placed in the | |
5518 | frame buffer. These parameters are set with four commands: | |
5519 | `glPixelStore', `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This | |
5520 | reference page describes the effects on `glDrawPixels' of many, but not | |
5521 | all, of the parameters specified by these four commands. | |
8925f36f | 5522 | |
3c9b6116 AW |
5523 | Data is read from DATA as a sequence of signed or unsigned bytes, signed |
5524 | or unsigned shorts, signed or unsigned integers, or single-precision | |
5525 | floating-point values, depending on TYPE. When TYPE is one of | |
5526 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT', | |
5527 | `GL_UNSIGNED_INT', `GL_INT', or `GL_FLOAT' each of these bytes, shorts, | |
5528 | integers, or floating-point values is interpreted as one color or depth | |
5529 | component, or one index, depending on FORMAT. When TYPE is one of | |
5530 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_SHORT_5_6_5', | |
5531 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_5_5_5_1', | |
5532 | `GL_UNSIGNED_INT_8_8_8_8', or `GL_UNSIGNED_INT_10_10_10_2', each | |
5533 | unsigned value is interpreted as containing all the components for a | |
5534 | single pixel, with the color components arranged according to FORMAT. | |
5535 | When TYPE is one of `GL_UNSIGNED_BYTE_2_3_3_REV', | |
5536 | `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
5537 | `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8_REV', or | |
5538 | `GL_UNSIGNED_INT_2_10_10_10_REV', each unsigned value is interpreted as | |
5539 | containing all color components, specified by FORMAT, for a single pixel | |
5540 | in a reversed order. Indices are always treated individually. Color | |
5541 | components are treated as groups of one, two, three, or four values, | |
5542 | again based on FORMAT. Both individual indices and groups of components | |
5543 | are referred to as pixels. If TYPE is `GL_BITMAP', the data must be | |
5544 | unsigned bytes, and FORMAT must be either `GL_COLOR_INDEX' or | |
5545 | `GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels, | |
5546 | with bit ordering determined by `GL_UNPACK_LSB_FIRST' (see | |
5547 | `glPixelStore'). | |
8925f36f | 5548 | |
3c9b6116 AW |
5549 | WIDTH×HEIGHT pixels are read from memory, starting at location DATA. By |
5550 | default, these pixels are taken from adjacent memory locations, except | |
5551 | that after all WIDTH pixels are read, the read pointer is advanced to | |
5552 | the next four-byte boundary. The four-byte row alignment is specified by | |
5553 | `glPixelStore' with argument `GL_UNPACK_ALIGNMENT', and it can be set to | |
5554 | one, two, four, or eight bytes. Other pixel store parameters specify | |
5555 | different read pointer advancements, both before the first pixel is read | |
5556 | and after all WIDTH pixels are read. See the `glPixelStore' reference | |
5557 | page for details on these options. | |
5558 | ||
5559 | If a non-zero named buffer object is bound to the | |
5560 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a block of | |
5561 | pixels is specified, DATA is treated as a byte offset into the buffer | |
5562 | object's data store. | |
5563 | ||
5564 | The WIDTH×HEIGHT pixels that are read from memory are each operated on | |
5565 | in the same way, based on the values of several parameters specified by | |
5566 | `glPixelTransfer' and `glPixelMap'. The details of these operations, as | |
5567 | well as the target buffer into which the pixels are drawn, are specific | |
5568 | to the format of the pixels, as specified by FORMAT. FORMAT can assume | |
5569 | one of 13 symbolic values: | |
5570 | ||
5571 | `GL_COLOR_INDEX' | |
5572 | Each pixel is a single value, a color index. It is converted to | |
5573 | fixed-point format, with an unspecified number of bits to the right | |
5574 | of the binary point, regardless of the memory data type. | |
5575 | Floating-point values convert to true fixed-point values. Signed | |
5576 | and unsigned integer data is converted with all fraction bits set | |
5577 | to 0. Bitmap data convert to either 0 or 1. | |
5578 | ||
5579 | Each fixed-point index is then shifted left by `GL_INDEX_SHIFT' | |
5580 | bits and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is | |
5581 | negative, the shift is to the right. In either case, zero bits fill | |
5582 | otherwise unspecified bit locations in the result. | |
5583 | ||
5584 | If the GL is in RGBA mode, the resulting index is converted to an | |
5585 | RGBA pixel with the help of the `GL_PIXEL_MAP_I_TO_R', | |
5586 | `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and | |
5587 | `GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and | |
5588 | if `GL_MAP_COLOR' is true, the index is replaced with the value | |
5589 | that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. Whether | |
5590 | the lookup replacement of the index is done or not, the integer | |
5591 | part of the index is then ANDed with 2^B-1 , where B is the number | |
5592 | of bits in a color index buffer. | |
5593 | ||
5594 | The GL then converts the resulting indices or RGBA colors to | |
5595 | fragments by attaching the current raster position Z coordinate and | |
5596 | texture coordinates to each pixel, then assigning X and Y window | |
5597 | coordinates to the N th fragment such that X_N=X_R+N%WIDTH | |
5598 | Y_N=Y_R+⌊N/WIDTH,⌋ | |
5599 | ||
5600 | where (X_R,Y_R) is the current raster position. These pixel | |
5601 | fragments are then treated just like the fragments generated by | |
5602 | rasterizing points, lines, or polygons. Texture mapping, fog, and | |
5603 | all the fragment operations are applied before the fragments are | |
5604 | written to the frame buffer. | |
5605 | ||
5606 | `GL_STENCIL_INDEX' | |
5607 | Each pixel is a single value, a stencil index. It is converted to | |
5608 | fixed-point format, with an unspecified number of bits to the right | |
5609 | of the binary point, regardless of the memory data type. | |
5610 | Floating-point values convert to true fixed-point values. Signed | |
5611 | and unsigned integer data is converted with all fraction bits set | |
5612 | to 0. Bitmap data convert to either 0 or 1. | |
5613 | ||
5614 | Each fixed-point index is then shifted left by `GL_INDEX_SHIFT' | |
5615 | bits, and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is | |
5616 | negative, the shift is to the right. In either case, zero bits fill | |
5617 | otherwise unspecified bit locations in the result. If | |
5618 | `GL_MAP_STENCIL' is true, the index is replaced with the value that | |
5619 | it references in lookup table `GL_PIXEL_MAP_S_TO_S'. Whether the | |
5620 | lookup replacement of the index is done or not, the integer part of | |
5621 | the index is then ANDed with 2^B-1 , where B is the number of bits | |
5622 | in the stencil buffer. The resulting stencil indices are then | |
5623 | written to the stencil buffer such that the N th index is written | |
5624 | to location | |
5625 | ||
5626 | X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋ | |
5627 | ||
5628 | where (X_R,Y_R) is the current raster position. Only the pixel | |
5629 | ownership test, the scissor test, and the stencil writemask affect | |
5630 | these write operations. | |
5631 | ||
5632 | `GL_DEPTH_COMPONENT' | |
5633 | Each pixel is a single-depth component. Floating-point data is | |
5634 | converted directly to an internal floating-point format with | |
5635 | unspecified precision. Signed integer data is mapped linearly to | |
5636 | the internal floating-point format such that the most positive | |
5637 | representable integer value maps to 1.0, and the most negative | |
5638 | representable value maps to -1.0 . Unsigned integer data is mapped | |
5639 | similarly: the largest integer value maps to 1.0, and 0 maps to | |
5640 | 0.0. The resulting floating-point depth value is then multiplied by | |
5641 | `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is | |
5642 | clamped to the range [0,1] . | |
5643 | ||
5644 | The GL then converts the resulting depth components to fragments by | |
5645 | attaching the current raster position color or color index and | |
5646 | texture coordinates to each pixel, then assigning X and Y window | |
5647 | coordinates to the N th fragment such that | |
5648 | ||
5649 | X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋ | |
5650 | ||
5651 | where (X_R,Y_R) is the current raster position. These pixel | |
5652 | fragments are then treated just like the fragments generated by | |
5653 | rasterizing points, lines, or polygons. Texture mapping, fog, and | |
5654 | all the fragment operations are applied before the fragments are | |
5655 | written to the frame buffer. | |
5656 | ||
5657 | `GL_RGBA' | |
5658 | `GL_BGRA' | |
5659 | Each pixel is a four-component group: For `GL_RGBA', the red | |
5660 | component is first, followed by green, followed by blue, followed | |
5661 | by alpha; for `GL_BGRA' the order is blue, green, red and then | |
5662 | alpha. Floating-point values are converted directly to an internal | |
5663 | floating-point format with unspecified precision. Signed integer | |
5664 | values are mapped linearly to the internal floating-point format | |
5665 | such that the most positive representable integer value maps to | |
5666 | 1.0, and the most negative representable value maps to -1.0 . (Note | |
5667 | that this mapping does not convert 0 precisely to 0.0.) Unsigned | |
5668 | integer data is mapped similarly: The largest integer value maps to | |
5669 | 1.0, and 0 maps to 0.0. The resulting floating-point color values | |
5670 | are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where | |
5671 | C is RED, GREEN, BLUE, and ALPHA for the respective color | |
5672 | components. The results are clamped to the range [0,1] . | |
5673 | ||
5674 | If `GL_MAP_COLOR' is true, each color component is scaled by the | |
5675 | size of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the | |
5676 | value that it references in that table. C is R, G, B, or A | |
5677 | respectively. | |
5678 | ||
5679 | The GL then converts the resulting RGBA colors to fragments by | |
5680 | attaching the current raster position Z coordinate and texture | |
5681 | coordinates to each pixel, then assigning X and Y window | |
5682 | coordinates to the N th fragment such that | |
5683 | ||
5684 | X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋ | |
5685 | ||
5686 | where (X_R,Y_R) is the current raster position. These pixel | |
5687 | fragments are then treated just like the fragments generated by | |
5688 | rasterizing points, lines, or polygons. Texture mapping, fog, and | |
5689 | all the fragment operations are applied before the fragments are | |
5690 | written to the frame buffer. | |
5691 | ||
5692 | `GL_RED' | |
5693 | Each pixel is a single red component. This component is converted | |
5694 | to the internal floating-point format in the same way the red | |
5695 | component of an RGBA pixel is. It is then converted to an RGBA | |
5696 | pixel with green and blue set to 0, and alpha set to 1. After this | |
5697 | conversion, the pixel is treated as if it had been read as an RGBA | |
5698 | pixel. | |
5699 | ||
5700 | `GL_GREEN' | |
5701 | Each pixel is a single green component. This component is converted | |
5702 | to the internal floating-point format in the same way the green | |
5703 | component of an RGBA pixel is. It is then converted to an RGBA | |
5704 | pixel with red and blue set to 0, and alpha set to 1. After this | |
5705 | conversion, the pixel is treated as if it had been read as an RGBA | |
5706 | pixel. | |
5707 | ||
5708 | `GL_BLUE' | |
5709 | Each pixel is a single blue component. This component is converted | |
5710 | to the internal floating-point format in the same way the blue | |
5711 | component of an RGBA pixel is. It is then converted to an RGBA | |
5712 | pixel with red and green set to 0, and alpha set to 1. After this | |
5713 | conversion, the pixel is treated as if it had been read as an RGBA | |
5714 | pixel. | |
5715 | ||
5716 | `GL_ALPHA' | |
5717 | Each pixel is a single alpha component. This component is converted | |
5718 | to the internal floating-point format in the same way the alpha | |
5719 | component of an RGBA pixel is. It is then converted to an RGBA | |
5720 | pixel with red, green, and blue set to 0. After this conversion, | |
5721 | the pixel is treated as if it had been read as an RGBA pixel. | |
5722 | ||
5723 | `GL_RGB' | |
5724 | `GL_BGR' | |
5725 | Each pixel is a three-component group: red first, followed by | |
5726 | green, followed by blue; for `GL_BGR', the first component is blue, | |
5727 | followed by green and then red. Each component is converted to the | |
5728 | internal floating-point format in the same way the red, green, and | |
5729 | blue components of an RGBA pixel are. The color triple is converted | |
5730 | to an RGBA pixel with alpha set to 1. After this conversion, the | |
5731 | pixel is treated as if it had been read as an RGBA pixel. | |
5732 | ||
5733 | `GL_LUMINANCE' | |
5734 | Each pixel is a single luminance component. This component is | |
5735 | converted to the internal floating-point format in the same way the | |
5736 | red component of an RGBA pixel is. It is then converted to an RGBA | |
5737 | pixel with red, green, and blue set to the converted luminance | |
5738 | value, and alpha set to 1. After this conversion, the pixel is | |
5739 | treated as if it had been read as an RGBA pixel. | |
5740 | ||
5741 | `GL_LUMINANCE_ALPHA' | |
5742 | Each pixel is a two-component group: luminance first, followed by | |
5743 | alpha. The two components are converted to the internal | |
5744 | floating-point format in the same way the red component of an RGBA | |
5745 | pixel is. They are then converted to an RGBA pixel with red, green, | |
5746 | and blue set to the converted luminance value, and alpha set to the | |
5747 | converted alpha value. After this conversion, the pixel is treated | |
5748 | as if it had been read as an RGBA pixel. | |
5749 | ||
5750 | The following table summarizes the meaning of the valid constants for | |
5751 | the TYPE parameter: | |
5752 | ||
5753 | ||
5754 | ||
5755 | *Type* | |
5756 | *Corresponding Type* | |
5757 | ||
5758 | `GL_UNSIGNED_BYTE' | |
5759 | unsigned 8-bit integer | |
5760 | ||
5761 | `GL_BYTE' | |
5762 | signed 8-bit integer | |
5763 | ||
5764 | `GL_BITMAP' | |
5765 | single bits in unsigned 8-bit integers | |
5766 | ||
5767 | `GL_UNSIGNED_SHORT' | |
5768 | unsigned 16-bit integer | |
5769 | ||
5770 | `GL_SHORT' | |
5771 | signed 16-bit integer | |
5772 | ||
5773 | `GL_UNSIGNED_INT' | |
5774 | unsigned 32-bit integer | |
5775 | ||
5776 | `GL_INT' | |
5777 | 32-bit integer | |
5778 | ||
5779 | `GL_FLOAT' | |
5780 | single-precision floating-point | |
5781 | ||
5782 | `GL_UNSIGNED_BYTE_3_3_2' | |
5783 | unsigned 8-bit integer | |
5784 | ||
5785 | `GL_UNSIGNED_BYTE_2_3_3_REV' | |
5786 | unsigned 8-bit integer with reversed component ordering | |
5787 | ||
5788 | `GL_UNSIGNED_SHORT_5_6_5' | |
5789 | unsigned 16-bit integer | |
5790 | ||
5791 | `GL_UNSIGNED_SHORT_5_6_5_REV' | |
5792 | unsigned 16-bit integer with reversed component ordering | |
5793 | ||
5794 | `GL_UNSIGNED_SHORT_4_4_4_4' | |
5795 | unsigned 16-bit integer | |
5796 | ||
5797 | `GL_UNSIGNED_SHORT_4_4_4_4_REV' | |
5798 | unsigned 16-bit integer with reversed component ordering | |
5799 | ||
5800 | `GL_UNSIGNED_SHORT_5_5_5_1' | |
5801 | unsigned 16-bit integer | |
5802 | ||
5803 | `GL_UNSIGNED_SHORT_1_5_5_5_REV' | |
5804 | unsigned 16-bit integer with reversed component ordering | |
5805 | ||
5806 | `GL_UNSIGNED_INT_8_8_8_8' | |
5807 | unsigned 32-bit integer | |
5808 | ||
5809 | `GL_UNSIGNED_INT_8_8_8_8_REV' | |
5810 | unsigned 32-bit integer with reversed component ordering | |
5811 | ||
5812 | `GL_UNSIGNED_INT_10_10_10_2' | |
5813 | unsigned 32-bit integer | |
5814 | ||
5815 | `GL_UNSIGNED_INT_2_10_10_10_REV' | |
5816 | unsigned 32-bit integer with reversed component ordering | |
5817 | ||
5818 | ||
5819 | ||
5820 | The rasterization described so far assumes pixel zoom factors of 1. If | |
5821 | `glPixelZoom' is used to change the X and Y pixel zoom factors, pixels | |
5822 | are converted to fragments as follows. If (X_R,Y_R) is the current | |
5823 | raster position, and a given pixel is in the N th column and M th row of | |
5824 | the pixel rectangle, then fragments are generated for pixels whose | |
5825 | centers are in the rectangle with corners at | |
5826 | ||
5827 | (X_R+ZOOM_X,\u2062N,Y_R+ZOOM_Y,\u2062M) (X_R+ZOOM_X,\u2061(N+1,),Y_R+ZOOM_Y,\u2061(M+1,)) | |
5828 | ||
5829 | where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of | |
5830 | `GL_ZOOM_Y'. | |
5831 | ||
5832 | `GL_INVALID_ENUM' is generated if FORMAT or TYPE is not one of the | |
5833 | accepted values. | |
5834 | ||
5835 | `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not | |
5836 | either `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'. | |
5837 | ||
5838 | `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative. | |
5839 | ||
5840 | `GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and | |
5841 | there is no stencil buffer. | |
5842 | ||
5843 | `GL_INVALID_OPERATION' is generated if FORMAT is `GL_RED', `GL_GREEN', | |
5844 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_RGBA', `GL_BGR', `GL_BGRA', | |
5845 | `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA', and the GL is in color index | |
5846 | mode. | |
5847 | ||
5848 | `GL_INVALID_OPERATION' is generated if FORMAT is one of | |
5849 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
5850 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
5851 | is not `GL_RGB'. | |
5852 | ||
5853 | `GL_INVALID_OPERATION' is generated if FORMAT is one of | |
5854 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
5855 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
5856 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
5857 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
5858 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
5859 | ||
5860 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
5861 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
5862 | data store is currently mapped. | |
5863 | ||
5864 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
5865 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
5866 | unpacked from the buffer object such that the memory reads required | |
5867 | would exceed the data store size. | |
5868 | ||
5869 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
5870 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
5871 | divisible into the number of bytes needed to store in memory a datum | |
5872 | indicated by TYPE. | |
5873 | ||
5874 | `GL_INVALID_OPERATION' is generated if `glDrawPixels' is executed | |
5875 | between the execution of `glBegin' and the corresponding execution of | |
5876 | `glEnd'.") | |
8925f36f AW |
5877 | |
5878 | (define-gl-procedure | |
bb894c9d AW |
5879 | ((glDrawRangeElements |
5880 | (mode GLenum) | |
5881 | (start GLuint) | |
5882 | (end GLuint) | |
5883 | (count GLsizei) | |
5884 | (type GLenum) | |
5885 | (indices *) | |
5886 | -> | |
5887 | void)) | |
3c9b6116 | 5888 | "Render primitives from array data. |
8925f36f | 5889 | |
3c9b6116 AW |
5890 | MODE |
5891 | Specifies what kind of primitives to render. Symbolic constants | |
5892 | `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES', | |
5893 | `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES', | |
5894 | `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted. | |
8925f36f | 5895 | |
3c9b6116 AW |
5896 | START |
5897 | Specifies the minimum array index contained in INDICES. | |
5898 | ||
5899 | END | |
5900 | Specifies the maximum array index contained in INDICES. | |
5901 | ||
5902 | COUNT | |
5903 | Specifies the number of elements to be rendered. | |
5904 | ||
5905 | TYPE | |
5906 | Specifies the type of the values in INDICES. Must be one of | |
5907 | `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'. | |
5908 | ||
5909 | INDICES | |
5910 | Specifies a pointer to the location where the indices are stored. | |
5911 | ||
5912 | `glDrawRangeElements' is a restricted form of `glDrawElements'. MODE, | |
5913 | START, END, and COUNT match the corresponding arguments to | |
5914 | `glDrawElements', with the additional constraint that all values in the | |
5915 | arrays COUNT must lie between START and END, inclusive. | |
5916 | ||
5917 | Implementations denote recommended maximum amounts of vertex and index | |
5918 | data, which may be queried by calling `glGet' with argument | |
5919 | `GL_MAX_ELEMENTS_VERTICES' and `GL_MAX_ELEMENTS_INDICES'. If END-START+1 | |
5920 | is greater than the value of `GL_MAX_ELEMENTS_VERTICES', or if COUNT is | |
5921 | greater than the value of `GL_MAX_ELEMENTS_INDICES', then the call may | |
5922 | operate at reduced performance. There is no requirement that all | |
5923 | vertices in the range [START,END] be referenced. However, the | |
5924 | implementation may partially process unused vertices, reducing | |
5925 | performance from what could be achieved with an optimal index set. | |
5926 | ||
5927 | When `glDrawRangeElements' is called, it uses COUNT sequential elements | |
5928 | from an enabled array, starting at START to construct a sequence of | |
5929 | geometric primitives. MODE specifies what kind of primitives are | |
5930 | constructed, and how the array elements construct these primitives. If | |
5931 | more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is | |
5932 | not enabled, no geometric primitives are constructed. | |
5933 | ||
5934 | Vertex attributes that are modified by `glDrawRangeElements' have an | |
5935 | unspecified value after `glDrawRangeElements' returns. For example, if | |
5936 | `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined | |
5937 | after `glDrawRangeElements' executes. Attributes that aren't modified | |
5938 | maintain their previous values. | |
5939 | ||
5940 | It is an error for indices to lie outside the range [START,END] , but | |
5941 | implementations may not check for this situation. Such indices cause | |
5942 | implementation-dependent behavior. | |
5943 | ||
5944 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
5945 | ||
5946 | `GL_INVALID_VALUE' is generated if COUNT is negative. | |
5947 | ||
5948 | `GL_INVALID_VALUE' is generated if END<START . | |
5949 | ||
5950 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
5951 | bound to an enabled array or the element array and the buffer object's | |
5952 | data store is currently mapped. | |
5953 | ||
5954 | `GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed | |
5955 | between the execution of `glBegin' and the corresponding `glEnd'.") | |
8925f36f AW |
5956 | |
5957 | (define-gl-procedure | |
bb894c9d AW |
5958 | ((glEdgeFlagPointer |
5959 | (stride GLsizei) | |
5960 | (pointer *) | |
5961 | -> | |
5962 | void)) | |
3c9b6116 | 5963 | "Define an array of edge flags. |
8925f36f | 5964 | |
3c9b6116 AW |
5965 | STRIDE |
5966 | Specifies the byte offset between consecutive edge flags. If STRIDE | |
5967 | is 0, the edge flags are understood to be tightly packed in the | |
5968 | array. The initial value is 0. | |
8925f36f | 5969 | |
3c9b6116 AW |
5970 | POINTER |
5971 | Specifies a pointer to the first edge flag in the array. The | |
5972 | initial value is 0. | |
8925f36f | 5973 | |
3c9b6116 AW |
5974 | `glEdgeFlagPointer' specifies the location and data format of an array |
5975 | of boolean edge flags to use when rendering. STRIDE specifies the byte | |
5976 | stride from one edge flag to the next, allowing vertices and attributes | |
5977 | to be packed into a single array or stored in separate arrays. | |
8925f36f | 5978 | |
3c9b6116 AW |
5979 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' |
5980 | target (see `glBindBuffer') while an edge flag array is specified, | |
5981 | POINTER is treated as a byte offset into the buffer object's data store. | |
5982 | Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as | |
5983 | edge flag vertex array client-side state | |
5984 | (`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING'). | |
8925f36f | 5985 | |
3c9b6116 AW |
5986 | When an edge flag array is specified, STRIDE and POINTER are saved as |
5987 | client-side state, in addition to the current vertex array buffer object | |
5988 | binding. | |
5989 | ||
5990 | To enable and disable the edge flag array, call `glEnableClientState' | |
5991 | and `glDisableClientState' with the argument `GL_EDGE_FLAG_ARRAY'. If | |
5992 | enabled, the edge flag array is used when `glDrawArrays', | |
5993 | `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', | |
5994 | `glDrawRangeElements', or `glArrayElement' is called. | |
5995 | ||
5996 | `GL_INVALID_ENUM' is generated if STRIDE is negative.") | |
8925f36f AW |
5997 | |
5998 | (define-gl-procedure | |
bb894c9d | 5999 | ((glEdgeFlag (flag GLboolean) -> void)) |
3c9b6116 AW |
6000 | "Flag edges as either boundary or nonboundary. |
6001 | ||
6002 | FLAG | |
6003 | Specifies the current edge flag value, either `GL_TRUE' or | |
6004 | `GL_FALSE'. The initial value is `GL_TRUE'. | |
6005 | ||
6006 | Each vertex of a polygon, separate triangle, or separate quadrilateral | |
6007 | specified between a `glBegin'/`glEnd' pair is marked as the start of | |
6008 | either a boundary or nonboundary edge. If the current edge flag is true | |
6009 | when the vertex is specified, the vertex is marked as the start of a | |
6010 | boundary edge. Otherwise, the vertex is marked as the start of a | |
6011 | nonboundary edge. `glEdgeFlag' sets the edge flag bit to `GL_TRUE' if | |
6012 | FLAG is `GL_TRUE' and to `GL_FALSE' otherwise. | |
6013 | ||
6014 | The vertices of connected triangles and connected quadrilaterals are | |
6015 | always marked as boundary, regardless of the value of the edge flag. | |
6016 | ||
6017 | Boundary and nonboundary edge flags on vertices are significant only if | |
6018 | `GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See | |
6019 | `glPolygonMode'.") | |
8925f36f AW |
6020 | |
6021 | (define-gl-procedure | |
bb894c9d AW |
6022 | ((glEnableClientState (cap GLenum) -> void) |
6023 | (glDisableClientState (cap GLenum) -> void)) | |
3c9b6116 AW |
6024 | "Enable or disable client-side capability. |
6025 | ||
6026 | CAP | |
6027 | Specifies the capability to enable. Symbolic constants | |
6028 | `GL_COLOR_ARRAY', `GL_EDGE_FLAG_ARRAY', `GL_FOG_COORD_ARRAY', | |
6029 | `GL_INDEX_ARRAY', `GL_NORMAL_ARRAY', `GL_SECONDARY_COLOR_ARRAY', | |
6030 | `GL_TEXTURE_COORD_ARRAY', and `GL_VERTEX_ARRAY' are accepted. | |
6031 | ||
6032 | `glEnableClientState' and `glDisableClientState' enable or disable | |
6033 | individual client-side capabilities. By default, all client-side | |
6034 | capabilities are disabled. Both `glEnableClientState' and | |
6035 | `glDisableClientState' take a single argument, CAP, which can assume one | |
6036 | of the following values: | |
6037 | ||
6038 | `GL_COLOR_ARRAY' | |
6039 | If enabled, the color array is enabled for writing and used during | |
6040 | rendering when `glArrayElement', `glDrawArrays', `glDrawElements', | |
6041 | `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements' | |
6042 | is called. See `glColorPointer'. | |
6043 | ||
6044 | `GL_EDGE_FLAG_ARRAY' | |
6045 | If enabled, the edge flag array is enabled for writing and used | |
6046 | during rendering when `glArrayElement', `glDrawArrays', | |
6047 | `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or | |
6048 | `glMultiDrawElements' is called. See `glEdgeFlagPointer'. | |
6049 | ||
6050 | `GL_FOG_COORD_ARRAY' | |
6051 | If enabled, the fog coordinate array is enabled for writing and | |
6052 | used during rendering when `glArrayElement', `glDrawArrays', | |
6053 | `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or | |
6054 | `glMultiDrawElements' is called. See `glFogCoordPointer'. | |
6055 | ||
6056 | `GL_INDEX_ARRAY' | |
6057 | If enabled, the index array is enabled for writing and used during | |
6058 | rendering when `glArrayElement', `glDrawArrays', `glDrawElements', | |
6059 | `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements' | |
6060 | is called. See `glIndexPointer'. | |
6061 | ||
6062 | `GL_NORMAL_ARRAY' | |
6063 | If enabled, the normal array is enabled for writing and used during | |
6064 | rendering when `glArrayElement', `glDrawArrays', `glDrawElements', | |
6065 | `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements' | |
6066 | is called. See `glNormalPointer'. | |
6067 | ||
6068 | `GL_SECONDARY_COLOR_ARRAY' | |
6069 | If enabled, the secondary color array is enabled for writing and | |
6070 | used during rendering when `glArrayElement', `glDrawArrays', | |
6071 | `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or | |
6072 | `glMultiDrawElements' is called. See `glColorPointer'. | |
6073 | ||
6074 | `GL_TEXTURE_COORD_ARRAY' | |
6075 | If enabled, the texture coordinate array is enabled for writing and | |
6076 | used during rendering when `glArrayElement', `glDrawArrays', | |
6077 | `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or | |
6078 | `glMultiDrawElements' is called. See `glTexCoordPointer'. | |
6079 | ||
6080 | `GL_VERTEX_ARRAY' | |
6081 | If enabled, the vertex array is enabled for writing and used during | |
6082 | rendering when `glArrayElement', `glDrawArrays', `glDrawElements', | |
6083 | `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements' | |
6084 | is called. See `glVertexPointer'. | |
6085 | ||
6086 | `GL_INVALID_ENUM' is generated if CAP is not an accepted value. | |
6087 | ||
6088 | `glEnableClientState' is not allowed between the execution of `glBegin' | |
6089 | and the corresponding `glEnd', but an error may or may not be generated. | |
6090 | If no error is generated, the behavior is undefined.") | |
8925f36f AW |
6091 | |
6092 | (define-gl-procedure | |
bb894c9d AW |
6093 | ((glEnableVertexAttribArray |
6094 | (index GLuint) | |
6095 | -> | |
6096 | void) | |
6097 | (glDisableVertexAttribArray | |
6098 | (index GLuint) | |
6099 | -> | |
6100 | void)) | |
3c9b6116 AW |
6101 | "Enable or disable a generic vertex attribute array. |
6102 | ||
6103 | INDEX | |
6104 | Specifies the index of the generic vertex attribute to be enabled | |
6105 | or disabled. | |
6106 | ||
6107 | `glEnableVertexAttribArray' enables the generic vertex attribute array | |
6108 | specified by INDEX. `glDisableVertexAttribArray' disables the generic | |
6109 | vertex attribute array specified by INDEX. By default, all client-side | |
6110 | capabilities are disabled, including all generic vertex attribute | |
6111 | arrays. If enabled, the values in the generic vertex attribute array | |
6112 | will be accessed and used for rendering when calls are made to vertex | |
6113 | array commands such as `glDrawArrays', `glDrawElements', | |
6114 | `glDrawRangeElements', `glArrayElement', `glMultiDrawElements', or | |
6115 | `glMultiDrawArrays'. | |
6116 | ||
6117 | `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to | |
6118 | `GL_MAX_VERTEX_ATTRIBS'. | |
6119 | ||
6120 | `GL_INVALID_OPERATION' is generated if either `glEnableVertexAttribArray | |
6121 | ' or `glDisableVertexAttribArray ' is executed between the execution of | |
6122 | `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
6123 | |
6124 | (define-gl-procedure | |
bb894c9d AW |
6125 | ((glEnable (cap GLenum) -> void) |
6126 | (glDisable (cap GLenum) -> void)) | |
3c9b6116 AW |
6127 | "Enable or disable server-side GL capabilities. |
6128 | ||
6129 | CAP | |
6130 | Specifies a symbolic constant indicating a GL capability. | |
6131 | ||
6132 | `glEnable' and `glDisable' enable and disable various capabilities. Use | |
6133 | `glIsEnabled' or `glGet' to determine the current setting of any | |
6134 | capability. The initial value for each capability with the exception of | |
6135 | `GL_DITHER' and `GL_MULTISAMPLE' is `GL_FALSE'. The initial value for | |
6136 | `GL_DITHER' and `GL_MULTISAMPLE' is `GL_TRUE'. | |
6137 | ||
6138 | Both `glEnable' and `glDisable' take a single argument, CAP, which can | |
6139 | assume one of the following values: | |
6140 | ||
6141 | `GL_ALPHA_TEST' | |
6142 | ||
6143 | ||
6144 | If enabled, do alpha testing. See `glAlphaFunc'. | |
6145 | ||
6146 | `GL_AUTO_NORMAL' | |
6147 | ||
6148 | ||
6149 | If enabled, generate normal vectors when either `GL_MAP2_VERTEX_3' | |
6150 | or `GL_MAP2_VERTEX_4' is used to generate vertices. See `glMap2'. | |
6151 | ||
6152 | `GL_BLEND' | |
6153 | ||
6154 | ||
6155 | If enabled, blend the computed fragment color values with the | |
6156 | values in the color buffers. See `glBlendFunc'. | |
6157 | ||
6158 | `GL_CLIP_PLANE'I | |
6159 | ||
6160 | ||
6161 | If enabled, clip geometry against user-defined clipping plane I. | |
6162 | See `glClipPlane'. | |
6163 | ||
6164 | `GL_COLOR_LOGIC_OP' | |
6165 | ||
6166 | ||
6167 | If enabled, apply the currently selected logical operation to the | |
6168 | computed fragment color and color buffer values. See `glLogicOp'. | |
6169 | ||
6170 | `GL_COLOR_MATERIAL' | |
6171 | ||
6172 | ||
6173 | If enabled, have one or more material parameters track the current | |
6174 | color. See `glColorMaterial'. | |
6175 | ||
6176 | `GL_COLOR_SUM' | |
6177 | ||
6178 | ||
6179 | If enabled and no fragment shader is active, add the secondary | |
6180 | color value to the computed fragment color. See `glSecondaryColor'. | |
6181 | ||
6182 | `GL_COLOR_TABLE' | |
6183 | ||
6184 | ||
6185 | If enabled, perform a color table lookup on the incoming RGBA color | |
6186 | values. See `glColorTable'. | |
6187 | ||
6188 | `GL_CONVOLUTION_1D' | |
6189 | ||
6190 | ||
6191 | If enabled, perform a 1D convolution operation on incoming RGBA | |
6192 | color values. See `glConvolutionFilter1D'. | |
6193 | ||
6194 | `GL_CONVOLUTION_2D' | |
6195 | ||
6196 | ||
6197 | If enabled, perform a 2D convolution operation on incoming RGBA | |
6198 | color values. See `glConvolutionFilter2D'. | |
6199 | ||
6200 | `GL_CULL_FACE' | |
6201 | ||
6202 | ||
6203 | If enabled, cull polygons based on their winding in window | |
6204 | coordinates. See `glCullFace'. | |
6205 | ||
6206 | `GL_DEPTH_TEST' | |
6207 | ||
6208 | ||
6209 | If enabled, do depth comparisons and update the depth buffer. Note | |
6210 | that even if the depth buffer exists and the depth mask is | |
6211 | non-zero, the depth buffer is not updated if the depth test is | |
6212 | disabled. See `glDepthFunc' and `glDepthRange'. | |
6213 | ||
6214 | `GL_DITHER' | |
6215 | ||
6216 | ||
6217 | If enabled, dither color components or indices before they are | |
6218 | written to the color buffer. | |
6219 | ||
6220 | `GL_FOG' | |
6221 | ||
6222 | ||
6223 | If enabled and no fragment shader is active, blend a fog color into | |
6224 | the post-texturing color. See `glFog'. | |
6225 | ||
6226 | `GL_HISTOGRAM' | |
6227 | ||
6228 | ||
6229 | If enabled, histogram incoming RGBA color values. See | |
6230 | `glHistogram'. | |
6231 | ||
6232 | `GL_INDEX_LOGIC_OP' | |
6233 | ||
6234 | ||
6235 | If enabled, apply the currently selected logical operation to the | |
6236 | incoming index and color buffer indices. See `glLogicOp'. | |
6237 | ||
6238 | `GL_LIGHT'I | |
6239 | ||
6240 | ||
6241 | If enabled, include light I in the evaluation of the lighting | |
6242 | equation. See `glLightModel' and `glLight'. | |
6243 | ||
6244 | `GL_LIGHTING' | |
6245 | ||
6246 | ||
6247 | If enabled and no vertex shader is active, use the current lighting | |
6248 | parameters to compute the vertex color or index. Otherwise, simply | |
6249 | associate the current color or index with each vertex. See | |
6250 | `glMaterial', `glLightModel', and `glLight'. | |
6251 | ||
6252 | `GL_LINE_SMOOTH' | |
6253 | ||
6254 | ||
6255 | If enabled, draw lines with correct filtering. Otherwise, draw | |
6256 | aliased lines. See `glLineWidth'. | |
6257 | ||
6258 | `GL_LINE_STIPPLE' | |
6259 | ||
6260 | ||
6261 | If enabled, use the current line stipple pattern when drawing | |
6262 | lines. See `glLineStipple'. | |
6263 | ||
6264 | `GL_MAP1_COLOR_4' | |
6265 | ||
6266 | ||
6267 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6268 | `glEvalPoint1' generate RGBA values. See `glMap1'. | |
6269 | ||
6270 | `GL_MAP1_INDEX' | |
6271 | ||
6272 | ||
6273 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6274 | `glEvalPoint1' generate color indices. See `glMap1'. | |
6275 | ||
6276 | `GL_MAP1_NORMAL' | |
6277 | ||
6278 | ||
6279 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6280 | `glEvalPoint1' generate normals. See `glMap1'. | |
6281 | ||
6282 | `GL_MAP1_TEXTURE_COORD_1' | |
6283 | ||
6284 | ||
6285 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6286 | `glEvalPoint1' generate S texture coordinates. See `glMap1'. | |
6287 | ||
6288 | `GL_MAP1_TEXTURE_COORD_2' | |
6289 | ||
6290 | ||
6291 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6292 | `glEvalPoint1' generate S and T texture coordinates. See `glMap1'. | |
6293 | ||
6294 | `GL_MAP1_TEXTURE_COORD_3' | |
6295 | ||
6296 | ||
6297 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6298 | `glEvalPoint1' generate S, T, and R texture coordinates. See | |
6299 | `glMap1'. | |
6300 | ||
6301 | `GL_MAP1_TEXTURE_COORD_4' | |
6302 | ||
6303 | ||
6304 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6305 | `glEvalPoint1' generate S, T, R, and Q texture coordinates. See | |
6306 | `glMap1'. | |
6307 | ||
6308 | `GL_MAP1_VERTEX_3' | |
6309 | ||
6310 | ||
6311 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6312 | `glEvalPoint1' generate X, Y, and Z vertex coordinates. See | |
6313 | `glMap1'. | |
6314 | ||
6315 | `GL_MAP1_VERTEX_4' | |
6316 | ||
6317 | ||
6318 | If enabled, calls to `glEvalCoord1', `glEvalMesh1', and | |
6319 | `glEvalPoint1' generate homogeneous X, Y, Z, and W vertex | |
6320 | coordinates. See `glMap1'. | |
6321 | ||
6322 | `GL_MAP2_COLOR_4' | |
6323 | ||
6324 | ||
6325 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6326 | `glEvalPoint2' generate RGBA values. See `glMap2'. | |
6327 | ||
6328 | `GL_MAP2_INDEX' | |
6329 | ||
6330 | ||
6331 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6332 | `glEvalPoint2' generate color indices. See `glMap2'. | |
6333 | ||
6334 | `GL_MAP2_NORMAL' | |
6335 | ||
6336 | ||
6337 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6338 | `glEvalPoint2' generate normals. See `glMap2'. | |
6339 | ||
6340 | `GL_MAP2_TEXTURE_COORD_1' | |
6341 | ||
6342 | ||
6343 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6344 | `glEvalPoint2' generate S texture coordinates. See `glMap2'. | |
6345 | ||
6346 | `GL_MAP2_TEXTURE_COORD_2' | |
6347 | ||
6348 | ||
6349 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6350 | `glEvalPoint2' generate S and T texture coordinates. See `glMap2'. | |
6351 | ||
6352 | `GL_MAP2_TEXTURE_COORD_3' | |
6353 | ||
6354 | ||
6355 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6356 | `glEvalPoint2' generate S, T, and R texture coordinates. See | |
6357 | `glMap2'. | |
6358 | ||
6359 | `GL_MAP2_TEXTURE_COORD_4' | |
6360 | ||
6361 | ||
6362 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6363 | `glEvalPoint2' generate S, T, R, and Q texture coordinates. See | |
6364 | `glMap2'. | |
6365 | ||
6366 | `GL_MAP2_VERTEX_3' | |
6367 | ||
6368 | ||
6369 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6370 | `glEvalPoint2' generate X, Y, and Z vertex coordinates. See | |
6371 | `glMap2'. | |
6372 | ||
6373 | `GL_MAP2_VERTEX_4' | |
6374 | ||
6375 | ||
6376 | If enabled, calls to `glEvalCoord2', `glEvalMesh2', and | |
6377 | `glEvalPoint2' generate homogeneous X, Y, Z, and W vertex | |
6378 | coordinates. See `glMap2'. | |
6379 | ||
6380 | `GL_MINMAX' | |
6381 | ||
6382 | ||
6383 | If enabled, compute the minimum and maximum values of incoming RGBA | |
6384 | color values. See `glMinmax'. | |
6385 | ||
6386 | `GL_MULTISAMPLE' | |
6387 | ||
6388 | ||
6389 | If enabled, use multiple fragment samples in computing the final | |
6390 | color of a pixel. See `glSampleCoverage'. | |
6391 | ||
6392 | `GL_NORMALIZE' | |
6393 | ||
6394 | ||
6395 | If enabled and no vertex shader is active, normal vectors are | |
6396 | normalized to unit length after transformation and before lighting. | |
6397 | This method is generally less efficient than `GL_RESCALE_NORMAL'. | |
6398 | See `glNormal' and `glNormalPointer'. | |
6399 | ||
6400 | `GL_POINT_SMOOTH' | |
6401 | ||
6402 | ||
6403 | If enabled, draw points with proper filtering. Otherwise, draw | |
6404 | aliased points. See `glPointSize'. | |
6405 | ||
6406 | `GL_POINT_SPRITE' | |
6407 | ||
6408 | ||
6409 | If enabled, calculate texture coordinates for points based on | |
6410 | texture environment and point parameter settings. Otherwise texture | |
6411 | coordinates are constant across points. | |
6412 | ||
6413 | `GL_POLYGON_OFFSET_FILL' | |
6414 | ||
6415 | ||
6416 | If enabled, and if the polygon is rendered in `GL_FILL' mode, an | |
6417 | offset is added to depth values of a polygon's fragments before the | |
6418 | depth comparison is performed. See `glPolygonOffset'. | |
6419 | ||
6420 | `GL_POLYGON_OFFSET_LINE' | |
6421 | ||
6422 | ||
6423 | If enabled, and if the polygon is rendered in `GL_LINE' mode, an | |
6424 | offset is added to depth values of a polygon's fragments before the | |
6425 | depth comparison is performed. See `glPolygonOffset'. | |
6426 | ||
6427 | `GL_POLYGON_OFFSET_POINT' | |
6428 | ||
6429 | ||
6430 | If enabled, an offset is added to depth values of a polygon's | |
6431 | fragments before the depth comparison is performed, if the polygon | |
6432 | is rendered in `GL_POINT' mode. See `glPolygonOffset'. | |
6433 | ||
6434 | `GL_POLYGON_SMOOTH' | |
6435 | ||
6436 | ||
6437 | If enabled, draw polygons with proper filtering. Otherwise, draw | |
6438 | aliased polygons. For correct antialiased polygons, an alpha buffer | |
6439 | is needed and the polygons must be sorted front to back. | |
6440 | ||
6441 | `GL_POLYGON_STIPPLE' | |
6442 | ||
6443 | ||
6444 | If enabled, use the current polygon stipple pattern when rendering | |
6445 | polygons. See `glPolygonStipple'. | |
6446 | ||
6447 | `GL_POST_COLOR_MATRIX_COLOR_TABLE' | |
6448 | ||
6449 | ||
6450 | If enabled, perform a color table lookup on RGBA color values after | |
6451 | color matrix transformation. See `glColorTable'. | |
6452 | ||
6453 | `GL_POST_CONVOLUTION_COLOR_TABLE' | |
6454 | ||
6455 | ||
6456 | If enabled, perform a color table lookup on RGBA color values after | |
6457 | convolution. See `glColorTable'. | |
6458 | ||
6459 | `GL_RESCALE_NORMAL' | |
6460 | ||
6461 | ||
6462 | If enabled and no vertex shader is active, normal vectors are | |
6463 | scaled after transformation and before lighting by a factor | |
6464 | computed from the modelview matrix. If the modelview matrix scales | |
6465 | space uniformly, this has the effect of restoring the transformed | |
6466 | normal to unit length. This method is generally more efficient than | |
6467 | `GL_NORMALIZE'. See `glNormal' and `glNormalPointer'. | |
6468 | ||
6469 | `GL_SAMPLE_ALPHA_TO_COVERAGE' | |
6470 | ||
6471 | ||
6472 | If enabled, compute a temporary coverage value where each bit is | |
6473 | determined by the alpha value at the corresponding sample location. | |
6474 | The temporary coverage value is then ANDed with the fragment | |
6475 | coverage value. | |
6476 | ||
6477 | `GL_SAMPLE_ALPHA_TO_ONE' | |
6478 | ||
6479 | ||
6480 | If enabled, each sample alpha value is replaced by the maximum | |
6481 | representable alpha value. | |
6482 | ||
6483 | `GL_SAMPLE_COVERAGE' | |
6484 | ||
6485 | ||
6486 | If enabled, the fragment's coverage is ANDed with the temporary | |
6487 | coverage value. If `GL_SAMPLE_COVERAGE_INVERT' is set to `GL_TRUE', | |
6488 | invert the coverage value. See `glSampleCoverage'. | |
6489 | ||
6490 | `GL_SEPARABLE_2D' | |
6491 | ||
6492 | ||
6493 | If enabled, perform a two-dimensional convolution operation using a | |
6494 | separable convolution filter on incoming RGBA color values. See | |
6495 | `glSeparableFilter2D'. | |
6496 | ||
6497 | `GL_SCISSOR_TEST' | |
6498 | ||
6499 | ||
6500 | If enabled, discard fragments that are outside the scissor | |
6501 | rectangle. See `glScissor'. | |
6502 | ||
6503 | `GL_STENCIL_TEST' | |
6504 | ||
6505 | ||
6506 | If enabled, do stencil testing and update the stencil buffer. See | |
6507 | `glStencilFunc' and `glStencilOp'. | |
6508 | ||
6509 | `GL_TEXTURE_1D' | |
6510 | ||
6511 | ||
6512 | If enabled and no fragment shader is active, one-dimensional | |
6513 | texturing is performed (unless two- or three-dimensional or | |
6514 | cube-mapped texturing is also enabled). See `glTexImage1D'. | |
6515 | ||
6516 | `GL_TEXTURE_2D' | |
6517 | ||
6518 | ||
6519 | If enabled and no fragment shader is active, two-dimensional | |
6520 | texturing is performed (unless three-dimensional or cube-mapped | |
6521 | texturing is also enabled). See `glTexImage2D'. | |
6522 | ||
6523 | `GL_TEXTURE_3D' | |
6524 | ||
6525 | ||
6526 | If enabled and no fragment shader is active, three-dimensional | |
6527 | texturing is performed (unless cube-mapped texturing is also | |
6528 | enabled). See `glTexImage3D'. | |
6529 | ||
6530 | `GL_TEXTURE_CUBE_MAP' | |
6531 | ||
6532 | ||
6533 | If enabled and no fragment shader is active, cube-mapped texturing | |
6534 | is performed. See `glTexImage2D'. | |
6535 | ||
6536 | `GL_TEXTURE_GEN_Q' | |
6537 | ||
6538 | ||
6539 | If enabled and no vertex shader is active, the Q texture coordinate | |
6540 | is computed using the texture generation function defined with | |
6541 | `glTexGen'. Otherwise, the current Q texture coordinate is used. | |
6542 | See `glTexGen'. | |
6543 | ||
6544 | `GL_TEXTURE_GEN_R' | |
6545 | ||
6546 | ||
6547 | If enabled and no vertex shader is active, the R texture coordinate | |
6548 | is computed using the texture generation function defined with | |
6549 | `glTexGen'. Otherwise, the current R texture coordinate is used. | |
6550 | See `glTexGen'. | |
6551 | ||
6552 | `GL_TEXTURE_GEN_S' | |
6553 | ||
6554 | ||
6555 | If enabled and no vertex shader is active, the S texture coordinate | |
6556 | is computed using the texture generation function defined with | |
6557 | `glTexGen'. Otherwise, the current S texture coordinate is used. | |
6558 | See `glTexGen'. | |
6559 | ||
6560 | `GL_TEXTURE_GEN_T' | |
6561 | ||
6562 | ||
6563 | If enabled and no vertex shader is active, the T texture coordinate | |
6564 | is computed using the texture generation function defined with | |
6565 | `glTexGen'. Otherwise, the current T texture coordinate is used. | |
6566 | See `glTexGen'. | |
6567 | ||
6568 | `GL_VERTEX_PROGRAM_POINT_SIZE' | |
6569 | ||
6570 | ||
6571 | If enabled and a vertex shader is active, then the derived point | |
6572 | size is taken from the (potentially clipped) shader builtin | |
6573 | `gl_PointSize' and clamped to the implementation-dependent point | |
6574 | size range. | |
6575 | ||
6576 | `GL_VERTEX_PROGRAM_TWO_SIDE' | |
6577 | ||
6578 | ||
6579 | If enabled and a vertex shader is active, it specifies that the GL | |
6580 | will choose between front and back colors based on the polygon's | |
6581 | face direction of which the vertex being shaded is a part. It has | |
6582 | no effect on points or lines. | |
6583 | ||
6584 | `GL_INVALID_ENUM' is generated if CAP is not one of the values listed | |
6585 | previously. | |
6586 | ||
6587 | `GL_INVALID_OPERATION' is generated if `glEnable' or `glDisable' is | |
6588 | executed between the execution of `glBegin' and the corresponding | |
6589 | execution of `glEnd'.") | |
6590 | ||
6591 | (define-gl-procedure | |
bb894c9d AW |
6592 | ((glEvalCoord1d (u GLdouble) -> void) |
6593 | (glEvalCoord2d (u GLdouble) (v GLdouble) -> void)) | |
3c9b6116 AW |
6594 | "Evaluate enabled one- and two-dimensional maps. |
6595 | ||
6596 | U | |
6597 | Specifies a value that is the domain coordinate U to the basis | |
6598 | function defined in a previous `glMap1' or `glMap2' command. | |
6599 | ||
6600 | V | |
6601 | Specifies a value that is the domain coordinate V to the basis | |
6602 | function defined in a previous `glMap2' command. This argument is | |
6603 | not present in a `glEvalCoord1' command. | |
6604 | ||
6605 | `glEvalCoord1' evaluates enabled one-dimensional maps at argument U. | |
6606 | `glEvalCoord2' does the same for two-dimensional maps using two domain | |
6607 | values, U and V. To define a map, call `glMap1' and `glMap2'; to enable | |
6608 | and disable it, call `glEnable' and `glDisable'. | |
6609 | ||
6610 | When one of the `glEvalCoord' commands is issued, all currently enabled | |
6611 | maps of the indicated dimension are evaluated. Then, for each enabled | |
6612 | map, it is as if the corresponding GL command had been issued with the | |
6613 | computed value. That is, if `GL_MAP1_INDEX' or `GL_MAP2_INDEX' is | |
6614 | enabled, a `glIndex' command is simulated. If `GL_MAP1_COLOR_4' or | |
6615 | `GL_MAP2_COLOR_4' is enabled, a `glColor' command is simulated. If | |
6616 | `GL_MAP1_NORMAL' or `GL_MAP2_NORMAL' is enabled, a normal vector is | |
6617 | produced, and if any of `GL_MAP1_TEXTURE_COORD_1', | |
6618 | `GL_MAP1_TEXTURE_COORD_2', `GL_MAP1_TEXTURE_COORD_3', | |
6619 | `GL_MAP1_TEXTURE_COORD_4', `GL_MAP2_TEXTURE_COORD_1', | |
6620 | `GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3', or | |
6621 | `GL_MAP2_TEXTURE_COORD_4' is enabled, then an appropriate `glTexCoord' | |
6622 | command is simulated. | |
6623 | ||
6624 | For color, color index, normal, and texture coordinates the GL uses | |
6625 | evaluated values instead of current values for those evaluations that | |
6626 | are enabled, and current values otherwise, However, the evaluated values | |
6627 | do not update the current values. Thus, if `glVertex' commands are | |
6628 | interspersed with `glEvalCoord' commands, the color, normal, and texture | |
6629 | coordinates associated with the `glVertex' commands are not affected by | |
6630 | the values generated by the `glEvalCoord' commands, but only by the most | |
6631 | recent `glColor', `glIndex', `glNormal', and `glTexCoord' commands. | |
6632 | ||
6633 | No commands are issued for maps that are not enabled. If more than one | |
6634 | texture evaluation is enabled for a particular dimension (for example, | |
6635 | `GL_MAP2_TEXTURE_COORD_1' and `GL_MAP2_TEXTURE_COORD_2'), then only the | |
6636 | evaluation of the map that produces the larger number of coordinates (in | |
6637 | this case, `GL_MAP2_TEXTURE_COORD_2') is carried out. `GL_MAP1_VERTEX_4' | |
6638 | overrides `GL_MAP1_VERTEX_3', and `GL_MAP2_VERTEX_4' overrides | |
6639 | `GL_MAP2_VERTEX_3', in the same manner. If neither a three- nor a | |
6640 | four-component vertex map is enabled for the specified dimension, the | |
6641 | `glEvalCoord' command is ignored. | |
6642 | ||
6643 | If you have enabled automatic normal generation, by calling `glEnable' | |
6644 | with argument `GL_AUTO_NORMAL', `glEvalCoord2' generates surface normals | |
6645 | analytically, regardless of the contents or enabling of the | |
6646 | `GL_MAP2_NORMAL' map. Let | |
6647 | ||
6648 | `m'=∂`p',/∂U,,×∂`p',/∂V,, | |
6649 | ||
6650 | Then the generated normal `n' is `n'=`m'/∥`m',∥, | |
6651 | ||
6652 | If automatic normal generation is disabled, the corresponding normal map | |
6653 | `GL_MAP2_NORMAL', if enabled, is used to produce a normal. If neither | |
6654 | automatic normal generation nor a normal map is enabled, no normal is | |
6655 | generated for `glEvalCoord2' commands.") | |
6656 | ||
6657 | (define-gl-procedure | |
bb894c9d AW |
6658 | ((glEvalMesh1 |
6659 | (mode GLenum) | |
6660 | (i1 GLint) | |
6661 | (i2 GLint) | |
6662 | -> | |
6663 | void) | |
6664 | (glEvalMesh2 | |
6665 | (mode GLenum) | |
6666 | (i1 GLint) | |
6667 | (i2 GLint) | |
6668 | (j1 GLint) | |
6669 | (j2 GLint) | |
6670 | -> | |
6671 | void)) | |
3c9b6116 AW |
6672 | "Compute a one- or two-dimensional grid of points or lines. |
6673 | ||
6674 | MODE | |
6675 | In `glEvalMesh1', specifies whether to compute a one-dimensional | |
6676 | mesh of points or lines. Symbolic constants `GL_POINT' and | |
6677 | `GL_LINE' are accepted. | |
6678 | ||
6679 | I1 | |
6680 | I2 | |
6681 | ||
6682 | Specify the first and last integer values for grid domain variable | |
6683 | I . | |
6684 | ||
6685 | `glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate | |
6686 | and evaluate a series of evenly-spaced map domain values. `glEvalMesh' | |
6687 | steps through the integer domain of a one- or two-dimensional grid, | |
6688 | whose range is the domain of the evaluation maps specified by `glMap1' | |
6689 | and `glMap2'. MODE determines whether the resulting vertices are | |
6690 | connected as points, lines, or filled polygons. | |
6691 | ||
6692 | In the one-dimensional case, `glEvalMesh1', the mesh is generated as if | |
6693 | the following code fragment were executed: | |
6694 | ||
6695 | where | |
6696 | ||
6697 | ||
6698 | glBegin( TYPE ); | |
6699 | for ( i = I1; i <= I2; i += 1 ) | |
6700 | glEvalCoord1( i·ΔU+U_1 | |
6701 | ||
6702 | ); | |
6703 | glEnd(); | |
6704 | ||
6705 | ΔU=(U_2-U_1,)/N | |
6706 | ||
6707 | and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1' | |
6708 | command. TYPE is `GL_POINTS' if MODE is `GL_POINT', or `GL_LINES' if | |
6709 | MODE is `GL_LINE'. | |
6710 | ||
6711 | The one absolute numeric requirement is that if I=N , then the value | |
6712 | computed from I·ΔU+U_1 is exactly U_2 . | |
6713 | ||
6714 | In the two-dimensional case, `glEvalMesh2', let .cp ΔU=(U_2-U_1,)/N | |
6715 | ||
6716 | ΔV=(V_2-V_1,)/M | |
6717 | ||
6718 | where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most | |
6719 | recent `glMapGrid2' command. Then, if MODE is `GL_FILL', the | |
6720 | `glEvalMesh2' command is equivalent to: | |
6721 | ||
6722 | ||
6723 | ||
6724 | ||
6725 | for ( j = J1; j < J2; j += 1 ) { | |
6726 | glBegin( GL_QUAD_STRIP ); | |
6727 | for ( i = I1; i <= I2; i += 1 ) { | |
6728 | glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1 | |
6729 | ||
6730 | ); | |
6731 | glEvalCoord2( i·ΔU+U_1,(j+1,)·ΔV+V_1 | |
6732 | ||
6733 | ); | |
6734 | } | |
6735 | glEnd(); | |
6736 | } | |
6737 | ||
6738 | If MODE is `GL_LINE', then a call to `glEvalMesh2' is equivalent to: | |
6739 | ||
6740 | ||
6741 | ||
6742 | ||
6743 | for ( j = J1; j <= J2; j += 1 ) { | |
6744 | glBegin( GL_LINE_STRIP ); | |
6745 | for ( i = I1; i <= I2; i += 1 ) | |
6746 | glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1 | |
6747 | ||
6748 | ); | |
6749 | glEnd(); | |
6750 | } | |
6751 | ||
6752 | for ( i = I1; i <= I2; i += 1 ) { | |
6753 | glBegin( GL_LINE_STRIP ); | |
6754 | for ( j = J1; j <= J1; j += 1 ) | |
6755 | glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1 | |
6756 | ||
6757 | ); | |
6758 | glEnd(); | |
6759 | } | |
6760 | ||
6761 | And finally, if MODE is `GL_POINT', then a call to `glEvalMesh2' is | |
6762 | equivalent to: | |
6763 | ||
6764 | ||
6765 | ||
6766 | ||
6767 | glBegin( GL_POINTS ); | |
6768 | for ( j = J1; j <= J2; j += 1 ) | |
6769 | for ( i = I1; i <= I2; i += 1 ) | |
6770 | glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1 | |
6771 | ||
6772 | ); | |
6773 | glEnd(); | |
6774 | ||
6775 | In all three cases, the only absolute numeric requirements are that if | |
6776 | I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M | |
6777 | , then the value computed from J·ΔV+V_1 is exactly V_2 . | |
6778 | ||
6779 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
6780 | ||
6781 | `GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between | |
6782 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
6783 | ||
6784 | (define-gl-procedure | |
bb894c9d AW |
6785 | ((glEvalPoint1 (i GLint) -> void) |
6786 | (glEvalPoint2 (i GLint) (j GLint) -> void)) | |
3c9b6116 AW |
6787 | "Generate and evaluate a single point in a mesh. |
6788 | ||
6789 | I | |
6790 | Specifies the integer value for grid domain variable I . | |
6791 | ||
6792 | J | |
6793 | Specifies the integer value for grid domain variable J | |
6794 | (`glEvalPoint2' only). | |
6795 | ||
6796 | `glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate | |
6797 | and evaluate a series of evenly spaced map domain values. `glEvalPoint' | |
6798 | can be used to evaluate a single grid point in the same gridspace that | |
6799 | is traversed by `glEvalMesh'. Calling `glEvalPoint1' is equivalent to | |
6800 | calling where ΔU=(U_2-U_1,)/N | |
6801 | ||
6802 | ||
6803 | glEvalCoord1( i·ΔU+U_1 | |
6804 | ||
6805 | ); | |
6806 | ||
6807 | and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1' | |
6808 | command. The one absolute numeric requirement is that if I=N , then the | |
6809 | value computed from I·ΔU+U_1 is exactly U_2 . | |
6810 | ||
6811 | In the two-dimensional case, `glEvalPoint2', let | |
6812 | ||
6813 | ΔU=(U_2-U_1,)/N ΔV=(V_2-V_1,)/M | |
6814 | ||
6815 | where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most | |
6816 | recent `glMapGrid2' command. Then the `glEvalPoint2' command is | |
6817 | equivalent to calling The only absolute numeric requirements are that if | |
6818 | I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M | |
6819 | , then the value computed from J·ΔV+V_1 is exactly V_2 . | |
6820 | ||
6821 | ||
6822 | glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1 | |
6823 | ||
6824 | );") | |
6825 | ||
6826 | (define-gl-procedure | |
bb894c9d AW |
6827 | ((glFeedbackBuffer |
6828 | (size GLsizei) | |
6829 | (type GLenum) | |
6830 | (buffer *) | |
6831 | -> | |
6832 | void)) | |
3c9b6116 AW |
6833 | "Controls feedback mode. |
6834 | ||
6835 | SIZE | |
6836 | Specifies the maximum number of values that can be written into | |
6837 | BUFFER. | |
6838 | ||
6839 | TYPE | |
6840 | Specifies a symbolic constant that describes the information that | |
6841 | will be returned for each vertex. `GL_2D', `GL_3D', `GL_3D_COLOR', | |
6842 | `GL_3D_COLOR_TEXTURE', and `GL_4D_COLOR_TEXTURE' are accepted. | |
6843 | ||
6844 | BUFFER | |
6845 | Returns the feedback data. | |
6846 | ||
6847 | The `glFeedbackBuffer' function controls feedback. Feedback, like | |
6848 | selection, is a GL mode. The mode is selected by calling `glRenderMode' | |
6849 | with `GL_FEEDBACK'. When the GL is in feedback mode, no pixels are | |
6850 | produced by rasterization. Instead, information about primitives that | |
6851 | would have been rasterized is fed back to the application using the GL. | |
6852 | ||
6853 | `glFeedbackBuffer' has three arguments: BUFFER is a pointer to an array | |
6854 | of floating-point values into which feedback information is placed. SIZE | |
6855 | indicates the size of the array. TYPE is a symbolic constant describing | |
6856 | the information that is fed back for each vertex. `glFeedbackBuffer' | |
6857 | must be issued before feedback mode is enabled (by calling | |
6858 | `glRenderMode' with argument `GL_FEEDBACK'). Setting `GL_FEEDBACK' | |
6859 | without establishing the feedback buffer, or calling `glFeedbackBuffer' | |
6860 | while the GL is in feedback mode, is an error. | |
6861 | ||
6862 | When `glRenderMode' is called while in feedback mode, it returns the | |
6863 | number of entries placed in the feedback array and resets the feedback | |
6864 | array pointer to the base of the feedback buffer. The returned value | |
6865 | never exceeds SIZE. If the feedback data required more room than was | |
6866 | available in BUFFER, `glRenderMode' returns a negative value. To take | |
6867 | the GL out of feedback mode, call `glRenderMode' with a parameter value | |
6868 | other than `GL_FEEDBACK'. | |
6869 | ||
6870 | While in feedback mode, each primitive, bitmap, or pixel rectangle that | |
6871 | would be rasterized generates a block of values that are copied into the | |
6872 | feedback array. If doing so would cause the number of entries to exceed | |
6873 | the maximum, the block is partially written so as to fill the array (if | |
6874 | there is any room left at all), and an overflow flag is set. Each block | |
6875 | begins with a code indicating the primitive type, followed by values | |
6876 | that describe the primitive's vertices and associated data. Entries are | |
6877 | also written for bitmaps and pixel rectangles. Feedback occurs after | |
6878 | polygon culling and `glPolygonMode' interpretation of polygons has taken | |
6879 | place, so polygons that are culled are not returned in the feedback | |
6880 | buffer. It can also occur after polygons with more than three edges are | |
6881 | broken up into triangles, if the GL implementation renders polygons by | |
6882 | performing this decomposition. | |
6883 | ||
6884 | The `glPassThrough' command can be used to insert a marker into the | |
6885 | feedback buffer. See `glPassThrough'. | |
6886 | ||
6887 | Following is the grammar for the blocks of values written into the | |
6888 | feedback buffer. Each primitive is indicated with a unique identifying | |
6889 | value followed by some number of vertices. Polygon entries include an | |
6890 | integer value indicating how many vertices follow. A vertex is fed back | |
6891 | as some number of floating-point values, as determined by TYPE. Colors | |
6892 | are fed back as four values in RGBA mode and one value in color index | |
6893 | mode. | |
6894 | ||
6895 | feedbackList ← feedbackItem feedbackList | feedbackItem feedbackItem ← | |
6896 | point | lineSegment | polygon | bitmap | pixelRectangle | passThru point | |
6897 | ← `GL_POINT_TOKEN' vertex lineSegment ← `GL_LINE_TOKEN' vertex vertex | | |
6898 | `GL_LINE_RESET_TOKEN' vertex vertex polygon ← `GL_POLYGON_TOKEN' n | |
6899 | polySpec polySpec ← polySpec vertex | vertex vertex vertex bitmap ← | |
6900 | `GL_BITMAP_TOKEN' vertex pixelRectangle ← `GL_DRAW_PIXEL_TOKEN' vertex | | |
6901 | `GL_COPY_PIXEL_TOKEN' vertex passThru ← `GL_PASS_THROUGH_TOKEN' value | |
6902 | vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture 2d ← value | |
6903 | value 3d ← value value value 3dColor ← value value value color | |
6904 | 3dColorTexture ← value value value color tex 4dColorTexture ← value | |
6905 | value value value color tex color ← rgba | index rgba ← value value | |
6906 | value value index ← value tex ← value value value value | |
6907 | ||
6908 | VALUE is a floating-point number, and N is a floating-point integer | |
6909 | giving the number of vertices in the polygon. `GL_POINT_TOKEN', | |
6910 | `GL_LINE_TOKEN', `GL_LINE_RESET_TOKEN', `GL_POLYGON_TOKEN', | |
6911 | `GL_BITMAP_TOKEN', `GL_DRAW_PIXEL_TOKEN', `GL_COPY_PIXEL_TOKEN' and | |
6912 | `GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants. | |
6913 | `GL_LINE_RESET_TOKEN' is returned whenever the line stipple pattern is | |
6914 | reset. The data returned as a vertex depends on the feedback TYPE. | |
6915 | ||
6916 | The following table gives the correspondence between TYPE and the number | |
6917 | of values per vertex. K is 1 in color index mode and 4 in RGBA mode. | |
6918 | ||
6919 | ||
6920 | ||
6921 | *Type* | |
6922 | *Coordinates*, *Color*, *Texture*, *Total Number of Values* | |
6923 | ||
6924 | `GL_2D' | |
6925 | X, Y, , , 2 | |
6926 | ||
6927 | `GL_3D' | |
6928 | X, Y, Z, , , 3 | |
6929 | ||
6930 | `GL_3D_COLOR' | |
6931 | X, Y, Z, K , , 3+K | |
6932 | ||
6933 | `GL_3D_COLOR_TEXTURE' | |
6934 | X, Y, Z, K , 4 , 7+K | |
6935 | ||
6936 | `GL_4D_COLOR_TEXTURE' | |
6937 | X, Y, Z, W, K , 4 , 8+K | |
6938 | ||
6939 | Feedback vertex coordinates are in window coordinates, except W, which | |
6940 | is in clip coordinates. Feedback colors are lighted, if lighting is | |
6941 | enabled. Feedback texture coordinates are generated, if texture | |
6942 | coordinate generation is enabled. They are always transformed by the | |
6943 | texture matrix. | |
6944 | ||
6945 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
6946 | ||
6947 | `GL_INVALID_VALUE' is generated if SIZE is negative. | |
6948 | ||
6949 | `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called | |
6950 | while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called | |
6951 | with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least | |
6952 | once. | |
6953 | ||
6954 | `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is executed | |
6955 | between the execution of `glBegin' and the corresponding execution of | |
6956 | `glEnd'.") | |
6957 | ||
6958 | (define-gl-procedure | |
bb894c9d | 6959 | ((glFinish -> void)) |
3c9b6116 AW |
6960 | "Block until all GL execution is complete. |
6961 | ||
6962 | `glFinish' does not return until the effects of all previously called GL | |
6963 | commands are complete. Such effects include all changes to GL state, all | |
6964 | changes to connection state, and all changes to the frame buffer | |
6965 | contents. | |
6966 | ||
6967 | `GL_INVALID_OPERATION' is generated if `glFinish' is executed between | |
6968 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
6969 | ||
6970 | (define-gl-procedure | |
bb894c9d | 6971 | ((glFlush -> void)) |
3c9b6116 AW |
6972 | "Force execution of GL commands in finite time. |
6973 | ||
6974 | Different GL implementations buffer commands in several different | |
6975 | locations, including network buffers and the graphics accelerator | |
6976 | itself. `glFlush' empties all of these buffers, causing all issued | |
6977 | commands to be executed as quickly as they are accepted by the actual | |
6978 | rendering engine. Though this execution may not be completed in any | |
6979 | particular time period, it does complete in finite time. | |
6980 | ||
6981 | Because any GL program might be executed over a network, or on an | |
6982 | accelerator that buffers commands, all programs should call `glFlush' | |
6983 | whenever they count on having all of their previously issued commands | |
6984 | completed. For example, call `glFlush' before waiting for user input | |
6985 | that depends on the generated image. | |
6986 | ||
6987 | `GL_INVALID_OPERATION' is generated if `glFlush' is executed between the | |
6988 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
6989 | ||
6990 | (define-gl-procedure | |
bb894c9d AW |
6991 | ((glFogCoordPointer |
6992 | (type GLenum) | |
6993 | (stride GLsizei) | |
6994 | (pointer *) | |
6995 | -> | |
6996 | void)) | |
3c9b6116 AW |
6997 | "Define an array of fog coordinates. |
6998 | ||
6999 | TYPE | |
7000 | Specifies the data type of each fog coordinate. Symbolic constants | |
7001 | `GL_FLOAT', or `GL_DOUBLE' are accepted. The initial value is | |
7002 | `GL_FLOAT'. | |
7003 | ||
7004 | STRIDE | |
7005 | Specifies the byte offset between consecutive fog coordinates. If | |
7006 | STRIDE is 0, the array elements are understood to be tightly | |
7007 | packed. The initial value is 0. | |
7008 | ||
7009 | POINTER | |
7010 | Specifies a pointer to the first coordinate of the first fog | |
7011 | coordinate in the array. The initial value is 0. | |
7012 | ||
7013 | `glFogCoordPointer' specifies the location and data format of an array | |
7014 | of fog coordinates to use when rendering. TYPE specifies the data type | |
7015 | of each fog coordinate, and STRIDE specifies the byte stride from one | |
7016 | fog coordinate to the next, allowing vertices and attributes to be | |
7017 | packed into a single array or stored in separate arrays. | |
7018 | ||
7019 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' | |
7020 | target (see `glBindBuffer') while a fog coordinate array is specified, | |
7021 | POINTER is treated as a byte offset into the buffer object's data store. | |
7022 | Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as | |
7023 | fog coordinate vertex array client-side state | |
7024 | (`GL_FOG_COORD_ARRAY_BUFFER_BINDING'). | |
7025 | ||
7026 | When a fog coordinate array is specified, TYPE, STRIDE, and POINTER are | |
7027 | saved as client-side state, in addition to the current vertex array | |
7028 | buffer object binding. | |
7029 | ||
7030 | To enable and disable the fog coordinate array, call | |
7031 | `glEnableClientState' and `glDisableClientState' with the argument | |
7032 | `GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is used when | |
7033 | `glDrawArrays', `glMultiDrawArrays', `glDrawElements', | |
7034 | `glMultiDrawElements', `glDrawRangeElements', or `glArrayElement' is | |
7035 | called. | |
7036 | ||
7037 | `GL_INVALID_ENUM' is generated if TYPE is not either `GL_FLOAT' or | |
7038 | `GL_DOUBLE'. | |
7039 | ||
7040 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
7041 | ||
7042 | (define-gl-procedure | |
bb894c9d | 7043 | ((glFogCoordd (coord GLdouble) -> void)) |
3c9b6116 AW |
7044 | "Set the current fog coordinates. |
7045 | ||
7046 | COORD | |
7047 | Specify the fog distance. | |
7048 | ||
7049 | `glFogCoord' specifies the fog coordinate that is associated with each | |
7050 | vertex and the current raster position. The value specified is | |
7051 | interpolated and used in computing the fog color (see `glFog').") | |
7052 | ||
7053 | (define-gl-procedure | |
bb894c9d AW |
7054 | ((glFogf (pname GLenum) (param GLfloat) -> void) |
7055 | (glFogi (pname GLenum) (param GLint) -> void)) | |
3c9b6116 AW |
7056 | "Specify fog parameters. |
7057 | ||
7058 | PNAME | |
7059 | Specifies a single-valued fog parameter. `GL_FOG_MODE', | |
7060 | `GL_FOG_DENSITY', `GL_FOG_START', `GL_FOG_END', `GL_FOG_INDEX', and | |
7061 | `GL_FOG_COORD_SRC' are accepted. | |
7062 | ||
7063 | PARAM | |
7064 | Specifies the value that PNAME will be set to. | |
7065 | ||
7066 | Fog is initially disabled. While enabled, fog affects rasterized | |
7067 | geometry, bitmaps, and pixel blocks, but not buffer clear operations. To | |
7068 | enable and disable fog, call `glEnable' and `glDisable' with argument | |
7069 | `GL_FOG'. | |
7070 | ||
7071 | `glFog' assigns the value or values in PARAMS to the fog parameter | |
7072 | specified by PNAME. The following values are accepted for PNAME: | |
7073 | ||
7074 | `GL_FOG_MODE' | |
7075 | PARAMS is a single integer or floating-point value that specifies | |
7076 | the equation to be used to compute the fog blend factor, F . Three | |
7077 | symbolic constants are accepted: `GL_LINEAR', `GL_EXP', and | |
7078 | `GL_EXP2'. The equations corresponding to these symbolic constants | |
7079 | are defined below. The initial fog mode is `GL_EXP'. | |
7080 | ||
7081 | `GL_FOG_DENSITY' | |
7082 | PARAMS is a single integer or floating-point value that specifies | |
7083 | DENSITY , the fog density used in both exponential fog equations. | |
7084 | Only nonnegative densities are accepted. The initial fog density is | |
7085 | 1. | |
7086 | ||
7087 | `GL_FOG_START' | |
7088 | PARAMS is a single integer or floating-point value that specifies | |
7089 | START , the near distance used in the linear fog equation. The | |
7090 | initial near distance is 0. | |
7091 | ||
7092 | `GL_FOG_END' | |
7093 | PARAMS is a single integer or floating-point value that specifies | |
7094 | END , the far distance used in the linear fog equation. The initial | |
7095 | far distance is 1. | |
7096 | ||
7097 | `GL_FOG_INDEX' | |
7098 | PARAMS is a single integer or floating-point value that specifies | |
7099 | I_F , the fog color index. The initial fog index is 0. | |
7100 | ||
7101 | `GL_FOG_COLOR' | |
7102 | PARAMS contains four integer or floating-point values that specify | |
7103 | C_F , the fog color. Integer values are mapped linearly such that | |
7104 | the most positive representable value maps to 1.0, and the most | |
7105 | negative representable value maps to -1.0 . Floating-point values | |
7106 | are mapped directly. After conversion, all color components are | |
7107 | clamped to the range [0,1] . The initial fog color is (0, 0, 0, 0). | |
7108 | ||
7109 | `GL_FOG_COORD_SRC' | |
7110 | PARAMS contains either of the following symbolic constants: | |
7111 | `GL_FOG_COORD' or `GL_FRAGMENT_DEPTH'. `GL_FOG_COORD' specifies | |
7112 | that the current fog coordinate should be used as distance value in | |
7113 | the fog color computation. `GL_FRAGMENT_DEPTH' specifies that the | |
7114 | current fragment depth should be used as distance value in the fog | |
7115 | computation. | |
7116 | ||
7117 | Fog blends a fog color with each rasterized pixel fragment's | |
7118 | post-texturing color using a blending factor F . Factor F is computed in | |
7119 | one of three ways, depending on the fog mode. Let C be either the | |
7120 | distance in eye coordinate from the origin (in the case that the | |
7121 | `GL_FOG_COORD_SRC' is `GL_FRAGMENT_DEPTH') or the current fog coordinate | |
7122 | (in the case that `GL_FOG_COORD_SRC' is `GL_FOG_COORD'). The equation | |
7123 | for `GL_LINEAR' fog is F=END-C,/END-START, | |
7124 | ||
7125 | The equation for `GL_EXP' fog is F=E^-(DENSITY·C,), | |
7126 | ||
7127 | The equation for `GL_EXP2' fog is F=E^-(DENSITY·C,),^2 | |
7128 | ||
7129 | Regardless of the fog mode, F is clamped to the range [0,1] after it is | |
7130 | computed. Then, if the GL is in RGBA color mode, the fragment's red, | |
7131 | green, and blue colors, represented by C_R , are replaced by | |
7132 | ||
7133 | C_R,^″=F×C_R+(1-F,)×C_F | |
7134 | ||
7135 | Fog does not affect a fragment's alpha component. | |
7136 | ||
7137 | In color index mode, the fragment's color index I_R is replaced by | |
7138 | ||
7139 | I_R,^″=I_R+(1-F,)×I_F | |
7140 | ||
7141 | ||
7142 | ||
7143 | `GL_INVALID_ENUM' is generated if PNAME is not an accepted value, or if | |
7144 | PNAME is `GL_FOG_MODE' and PARAMS is not an accepted value. | |
7145 | ||
7146 | `GL_INVALID_VALUE' is generated if PNAME is `GL_FOG_DENSITY' and PARAMS | |
7147 | is negative. | |
7148 | ||
7149 | `GL_INVALID_OPERATION' is generated if `glFog' is executed between the | |
7150 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
7151 | ||
7152 | (define-gl-procedure | |
bb894c9d | 7153 | ((glFrontFace (mode GLenum) -> void)) |
3c9b6116 AW |
7154 | "Define front- and back-facing polygons. |
7155 | ||
7156 | MODE | |
7157 | Specifies the orientation of front-facing polygons. `GL_CW' and | |
7158 | `GL_CCW' are accepted. The initial value is `GL_CCW'. | |
7159 | ||
7160 | In a scene composed entirely of opaque closed surfaces, back-facing | |
7161 | polygons are never visible. Eliminating these invisible polygons has the | |
7162 | obvious benefit of speeding up the rendering of the image. To enable and | |
7163 | disable elimination of back-facing polygons, call `glEnable' and | |
7164 | `glDisable' with argument `GL_CULL_FACE'. | |
7165 | ||
7166 | The projection of a polygon to window coordinates is said to have | |
7167 | clockwise winding if an imaginary object following the path from its | |
7168 | first vertex, its second vertex, and so on, to its last vertex, and | |
7169 | finally back to its first vertex, moves in a clockwise direction about | |
7170 | the interior of the polygon. The polygon's winding is said to be | |
7171 | counterclockwise if the imaginary object following the same path moves | |
7172 | in a counterclockwise direction about the interior of the polygon. | |
7173 | `glFrontFace' specifies whether polygons with clockwise winding in | |
7174 | window coordinates, or counterclockwise winding in window coordinates, | |
7175 | are taken to be front-facing. Passing `GL_CCW' to MODE selects | |
7176 | counterclockwise polygons as front-facing; `GL_CW' selects clockwise | |
7177 | polygons as front-facing. By default, counterclockwise polygons are | |
7178 | taken to be front-facing. | |
7179 | ||
7180 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
7181 | ||
7182 | `GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between | |
7183 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
7184 | ||
7185 | (define-gl-procedure | |
bb894c9d AW |
7186 | ((glFrustum |
7187 | (left GLdouble) | |
7188 | (right GLdouble) | |
7189 | (bottom GLdouble) | |
7190 | (top GLdouble) | |
7191 | (nearVal GLdouble) | |
7192 | (farVal GLdouble) | |
7193 | -> | |
7194 | void)) | |
3c9b6116 AW |
7195 | "Multiply the current matrix by a perspective matrix. |
7196 | ||
7197 | LEFT | |
7198 | RIGHT | |
7199 | ||
7200 | Specify the coordinates for the left and right vertical clipping | |
7201 | planes. | |
7202 | ||
7203 | BOTTOM | |
7204 | TOP | |
7205 | ||
7206 | Specify the coordinates for the bottom and top horizontal clipping | |
7207 | planes. | |
7208 | ||
7209 | NEARVAL | |
7210 | FARVAL | |
7211 | ||
7212 | Specify the distances to the near and far depth clipping planes. | |
7213 | Both distances must be positive. | |
7214 | ||
7215 | `glFrustum' describes a perspective matrix that produces a perspective | |
7216 | projection. The current matrix (see `glMatrixMode') is multiplied by | |
7217 | this matrix and the result replaces the current matrix, as if | |
7218 | `glMultMatrix' were called with the following matrix as its argument: | |
7219 | ||
7220 | ||
7221 | ||
7222 | [(2\u2062NEARVAL,/RIGHT-LEFT,, 0 A 0), (0 2\u2062NEARVAL,/TOP-BOTTOM,, B 0), (0 0 | |
7223 | C D), (0 0 -1 0),] | |
7224 | ||
7225 | A=RIGHT+LEFT,/RIGHT-LEFT, | |
7226 | ||
7227 | B=TOP+BOTTOM,/TOP-BOTTOM, | |
7228 | ||
7229 | C=-FARVAL+NEARVAL,/FARVAL-NEARVAL,, | |
7230 | ||
7231 | D=-2\u2062FARVAL\u2062NEARVAL,/FARVAL-NEARVAL,, | |
7232 | ||
7233 | ||
7234 | ||
7235 | Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL) | |
7236 | and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane | |
7237 | that are mapped to the lower left and upper right corners of the window, | |
7238 | assuming that the eye is located at (0, 0, 0). -FARVAL specifies the | |
7239 | location of the far clipping plane. Both NEARVAL and FARVAL must be | |
7240 | positive. | |
7241 | ||
7242 | Use `glPushMatrix' and `glPopMatrix' to save and restore the current | |
7243 | matrix stack. | |
7244 | ||
7245 | `GL_INVALID_VALUE' is generated if NEARVAL or FARVAL is not positive, or | |
7246 | if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR. | |
7247 | ||
7248 | `GL_INVALID_OPERATION' is generated if `glFrustum' is executed between | |
7249 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
7250 | ||
7251 | (define-gl-procedure | |
bb894c9d | 7252 | ((glGenBuffers (n GLsizei) (buffers *) -> void)) |
3c9b6116 AW |
7253 | "Generate buffer object names. |
7254 | ||
7255 | N | |
7256 | Specifies the number of buffer object names to be generated. | |
7257 | ||
7258 | BUFFERS | |
7259 | Specifies an array in which the generated buffer object names are | |
7260 | stored. | |
7261 | ||
7262 | `glGenBuffers' returns N buffer object names in BUFFERS. There is no | |
7263 | guarantee that the names form a contiguous set of integers; however, it | |
7264 | is guaranteed that none of the returned names was in use immediately | |
7265 | before the call to `glGenBuffers'. | |
7266 | ||
7267 | Buffer object names returned by a call to `glGenBuffers' are not | |
7268 | returned by subsequent calls, unless they are first deleted with | |
7269 | `glDeleteBuffers'. | |
7270 | ||
7271 | No buffer objects are associated with the returned buffer object names | |
7272 | until they are first bound by calling `glBindBuffer'. | |
7273 | ||
7274 | `GL_INVALID_VALUE' is generated if N is negative. | |
7275 | ||
7276 | `GL_INVALID_OPERATION' is generated if `glGenBuffers' is executed | |
7277 | between the execution of `glBegin' and the corresponding execution of | |
7278 | `glEnd'.") | |
7279 | ||
7280 | (define-gl-procedure | |
bb894c9d | 7281 | ((glGenLists (range GLsizei) -> GLuint)) |
3c9b6116 AW |
7282 | "Generate a contiguous set of empty display lists. |
7283 | ||
7284 | RANGE | |
7285 | Specifies the number of contiguous empty display lists to be | |
7286 | generated. | |
7287 | ||
7288 | `glGenLists' has one argument, RANGE. It returns an integer N such that | |
7289 | RANGE contiguous empty display lists, named N , N+1 , ... , N+RANGE-1 , | |
7290 | are created. If RANGE is 0, if there is no group of RANGE contiguous | |
7291 | names available, or if any error is generated, no display lists are | |
7292 | generated, and 0 is returned. | |
7293 | ||
7294 | `GL_INVALID_VALUE' is generated if RANGE is negative. | |
7295 | ||
7296 | `GL_INVALID_OPERATION' is generated if `glGenLists' is executed between | |
7297 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
7298 | ||
7299 | (define-gl-procedure | |
bb894c9d | 7300 | ((glGenQueries (n GLsizei) (ids *) -> void)) |
3c9b6116 AW |
7301 | "Generate query object names. |
7302 | ||
7303 | N | |
7304 | Specifies the number of query object names to be generated. | |
7305 | ||
7306 | IDS | |
7307 | Specifies an array in which the generated query object names are | |
7308 | stored. | |
7309 | ||
7310 | `glGenQueries' returns N query object names in IDS. There is no | |
7311 | guarantee that the names form a contiguous set of integers; however, it | |
7312 | is guaranteed that none of the returned names was in use immediately | |
7313 | before the call to `glGenQueries'. | |
7314 | ||
7315 | Query object names returned by a call to `glGenQueries' are not returned | |
7316 | by subsequent calls, unless they are first deleted with | |
7317 | `glDeleteQueries'. | |
7318 | ||
7319 | No query objects are associated with the returned query object names | |
7320 | until they are first used by calling `glBeginQuery'. | |
7321 | ||
7322 | `GL_INVALID_VALUE' is generated if N is negative. | |
7323 | ||
7324 | `GL_INVALID_OPERATION' is generated if `glGenQueries' is executed | |
7325 | between the execution of `glBegin' and the corresponding execution of | |
7326 | `glEnd'.") | |
7327 | ||
7328 | (define-gl-procedure | |
bb894c9d | 7329 | ((glGenTextures (n GLsizei) (textures *) -> void)) |
3c9b6116 AW |
7330 | "Generate texture names. |
7331 | ||
7332 | N | |
7333 | Specifies the number of texture names to be generated. | |
7334 | ||
7335 | TEXTURES | |
7336 | Specifies an array in which the generated texture names are stored. | |
7337 | ||
7338 | `glGenTextures' returns N texture names in TEXTURES. There is no | |
7339 | guarantee that the names form a contiguous set of integers; however, it | |
7340 | is guaranteed that none of the returned names was in use immediately | |
7341 | before the call to `glGenTextures'. | |
7342 | ||
7343 | The generated textures have no dimensionality; they assume the | |
7344 | dimensionality of the texture target to which they are first bound (see | |
7345 | `glBindTexture'). | |
7346 | ||
7347 | Texture names returned by a call to `glGenTextures' are not returned by | |
7348 | subsequent calls, unless they are first deleted with `glDeleteTextures'. | |
7349 | ||
7350 | `GL_INVALID_VALUE' is generated if N is negative. | |
7351 | ||
7352 | `GL_INVALID_OPERATION' is generated if `glGenTextures' is executed | |
7353 | between the execution of `glBegin' and the corresponding execution of | |
7354 | `glEnd'.") | |
7355 | ||
7356 | (define-gl-procedure | |
bb894c9d AW |
7357 | ((glGetActiveAttrib |
7358 | (program GLuint) | |
7359 | (index GLuint) | |
7360 | (bufSize GLsizei) | |
7361 | (length *) | |
7362 | (size *) | |
7363 | (type *) | |
7364 | (name *) | |
7365 | -> | |
7366 | void)) | |
3c9b6116 AW |
7367 | "Returns information about an active attribute variable for the specified |
7368 | program object. | |
7369 | ||
7370 | PROGRAM | |
7371 | Specifies the program object to be queried. | |
7372 | ||
7373 | INDEX | |
7374 | Specifies the index of the attribute variable to be queried. | |
7375 | ||
7376 | BUFSIZE | |
7377 | Specifies the maximum number of characters OpenGL is allowed to | |
7378 | write in the character buffer indicated by NAME. | |
7379 | ||
7380 | LENGTH | |
7381 | Returns the number of characters actually written by OpenGL in the | |
7382 | string indicated by NAME (excluding the null terminator) if a value | |
7383 | other than `NULL' is passed. | |
7384 | ||
7385 | SIZE | |
7386 | Returns the size of the attribute variable. | |
7387 | ||
7388 | TYPE | |
7389 | Returns the data type of the attribute variable. | |
7390 | ||
7391 | NAME | |
7392 | Returns a null terminated string containing the name of the | |
7393 | attribute variable. | |
7394 | ||
7395 | `glGetActiveAttrib' returns information about an active attribute | |
7396 | variable in the program object specified by PROGRAM. The number of | |
7397 | active attributes can be obtained by calling `glGetProgram' with the | |
7398 | value `GL_ACTIVE_ATTRIBUTES'. A value of 0 for INDEX selects the first | |
7399 | active attribute variable. Permissible values for INDEX range from 0 to | |
7400 | the number of active attribute variables minus 1. | |
7401 | ||
7402 | A vertex shader may use either built-in attribute variables, | |
7403 | user-defined attribute variables, or both. Built-in attribute variables | |
7404 | have a prefix of \"gl_\" and reference conventional OpenGL vertex | |
7405 | attribtes (e.g., GL_VERTEX, GL_NORMAL, etc., see the OpenGL Shading | |
7406 | Language specification for a complete list.) User-defined attribute | |
7407 | variables have arbitrary names and obtain their values through numbered | |
7408 | generic vertex attributes. An attribute variable (either built-in or | |
7409 | user-defined) is considered active if it is determined during the link | |
7410 | operation that it may be accessed during program execution. Therefore, | |
7411 | PROGRAM should have previously been the target of a call to | |
7412 | `glLinkProgram', but it is not necessary for it to have been linked | |
7413 | successfully. | |
7414 | ||
7415 | The size of the character buffer required to store the longest attribute | |
7416 | variable name in PROGRAM can be obtained by calling `glGetProgram' with | |
7417 | the value `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'. This value should be used to | |
7418 | allocate a buffer of sufficient size to store the returned attribute | |
7419 | name. The size of this character buffer is passed in BUFSIZE, and a | |
7420 | pointer to this character buffer is passed in NAME. | |
7421 | ||
7422 | `glGetActiveAttrib' returns the name of the attribute variable indicated | |
7423 | by INDEX, storing it in the character buffer specified by NAME. The | |
7424 | string returned will be null terminated. The actual number of characters | |
7425 | written into this buffer is returned in LENGTH, and this count does not | |
7426 | include the null termination character. If the length of the returned | |
7427 | string is not required, a value of `NULL' can be passed in the LENGTH | |
7428 | argument. | |
7429 | ||
7430 | The TYPE argument will return a pointer to the attribute variable's data | |
7431 | type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2', | |
7432 | `GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', | |
7433 | `GL_FLOAT_MAT4', `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', | |
7434 | `GL_FLOAT_MAT3x2', `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', or | |
7435 | `GL_FLOAT_MAT4x3' may be returned. The SIZE argument will return the | |
7436 | size of the attribute, in units of the type returned in TYPE. | |
7437 | ||
7438 | The list of active attribute variables may include both built-in | |
7439 | attribute variables (which begin with the prefix \"gl_\") as well as | |
7440 | user-defined attribute variable names. | |
7441 | ||
7442 | This function will return as much information as it can about the | |
7443 | specified active attribute variable. If no information is available, | |
7444 | LENGTH will be 0, and NAME will be an empty string. This situation could | |
7445 | occur if this function is called after a link operation that failed. If | |
7446 | an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be | |
7447 | unmodified. | |
7448 | ||
7449 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by | |
7450 | OpenGL. | |
7451 | ||
7452 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
7453 | ||
7454 | `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the | |
7455 | number of active attribute variables in PROGRAM. | |
7456 | ||
7457 | `GL_INVALID_OPERATION' is generated if `glGetActiveAttrib' is executed | |
7458 | between the execution of `glBegin' and the corresponding execution of | |
7459 | `glEnd'. | |
7460 | ||
7461 | `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.") | |
7462 | ||
7463 | (define-gl-procedure | |
bb894c9d AW |
7464 | ((glGetActiveUniform |
7465 | (program GLuint) | |
7466 | (index GLuint) | |
7467 | (bufSize GLsizei) | |
7468 | (length *) | |
7469 | (size *) | |
7470 | (type *) | |
7471 | (name *) | |
7472 | -> | |
7473 | void)) | |
3c9b6116 AW |
7474 | "Returns information about an active uniform variable for the specified |
7475 | program object. | |
7476 | ||
7477 | PROGRAM | |
7478 | Specifies the program object to be queried. | |
7479 | ||
7480 | INDEX | |
7481 | Specifies the index of the uniform variable to be queried. | |
7482 | ||
7483 | BUFSIZE | |
7484 | Specifies the maximum number of characters OpenGL is allowed to | |
7485 | write in the character buffer indicated by NAME. | |
7486 | ||
7487 | LENGTH | |
7488 | Returns the number of characters actually written by OpenGL in the | |
7489 | string indicated by NAME (excluding the null terminator) if a value | |
7490 | other than `NULL' is passed. | |
7491 | ||
7492 | SIZE | |
7493 | Returns the size of the uniform variable. | |
7494 | ||
7495 | TYPE | |
7496 | Returns the data type of the uniform variable. | |
7497 | ||
7498 | NAME | |
7499 | Returns a null terminated string containing the name of the uniform | |
7500 | variable. | |
7501 | ||
7502 | `glGetActiveUniform' returns information about an active uniform | |
7503 | variable in the program object specified by PROGRAM. The number of | |
7504 | active uniform variables can be obtained by calling `glGetProgram' with | |
7505 | the value `GL_ACTIVE_UNIFORMS'. A value of 0 for INDEX selects the first | |
7506 | active uniform variable. Permissible values for INDEX range from 0 to | |
7507 | the number of active uniform variables minus 1. | |
7508 | ||
7509 | Shaders may use either built-in uniform variables, user-defined uniform | |
7510 | variables, or both. Built-in uniform variables have a prefix of \"gl_\" | |
7511 | and reference existing OpenGL state or values derived from such state | |
7512 | (e.g., GL_FOG, GL_MODELVIEWMATRIX, etc., see the OpenGL Shading Language | |
7513 | specification for a complete list.) User-defined uniform variables have | |
7514 | arbitrary names and obtain their values from the application through | |
7515 | calls to `glUniform'. A uniform variable (either built-in or | |
7516 | user-defined) is considered active if it is determined during the link | |
7517 | operation that it may be accessed during program execution. Therefore, | |
7518 | PROGRAM should have previously been the target of a call to | |
7519 | `glLinkProgram', but it is not necessary for it to have been linked | |
7520 | successfully. | |
7521 | ||
7522 | The size of the character buffer required to store the longest uniform | |
7523 | variable name in PROGRAM can be obtained by calling `glGetProgram' with | |
7524 | the value `GL_ACTIVE_UNIFORM_MAX_LENGTH'. This value should be used to | |
7525 | allocate a buffer of sufficient size to store the returned uniform | |
7526 | variable name. The size of this character buffer is passed in BUFSIZE, | |
7527 | and a pointer to this character buffer is passed in NAME. | |
7528 | ||
7529 | `glGetActiveUniform' returns the name of the uniform variable indicated | |
7530 | by INDEX, storing it in the character buffer specified by NAME. The | |
7531 | string returned will be null terminated. The actual number of characters | |
7532 | written into this buffer is returned in LENGTH, and this count does not | |
7533 | include the null termination character. If the length of the returned | |
7534 | string is not required, a value of `NULL' can be passed in the LENGTH | |
7535 | argument. | |
7536 | ||
7537 | The TYPE argument will return a pointer to the uniform variable's data | |
7538 | type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2', | |
7539 | `GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_INT', `GL_INT_VEC2', | |
7540 | `GL_INT_VEC3', `GL_INT_VEC4', `GL_BOOL', `GL_BOOL_VEC2', `GL_BOOL_VEC3', | |
7541 | `GL_BOOL_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', `GL_FLOAT_MAT4', | |
7542 | `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', `GL_FLOAT_MAT3x2', | |
7543 | `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', `GL_FLOAT_MAT4x3', | |
7544 | `GL_SAMPLER_1D', `GL_SAMPLER_2D', `GL_SAMPLER_3D', `GL_SAMPLER_CUBE', | |
7545 | `GL_SAMPLER_1D_SHADOW', or `GL_SAMPLER_2D_SHADOW' may be returned. | |
7546 | ||
7547 | If one or more elements of an array are active, the name of the array is | |
7548 | returned in NAME, the type is returned in TYPE, and the SIZE parameter | |
7549 | returns the highest array element index used, plus one, as determined by | |
7550 | the compiler and/or linker. Only one active uniform variable will be | |
7551 | reported for a uniform array. | |
7552 | ||
7553 | Uniform variables that are declared as structures or arrays of | |
7554 | structures will not be returned directly by this function. Instead, each | |
7555 | of these uniform variables will be reduced to its fundamental components | |
7556 | containing the \".\" and \"[]\" operators such that each of the names is | |
7557 | valid as an argument to `glGetUniformLocation'. Each of these reduced | |
7558 | uniform variables is counted as one active uniform variable and is | |
7559 | assigned an index. A valid name cannot be a structure, an array of | |
7560 | structures, or a subcomponent of a vector or matrix. | |
7561 | ||
7562 | The size of the uniform variable will be returned in SIZE. Uniform | |
7563 | variables other than arrays will have a size of 1. Structures and arrays | |
7564 | of structures will be reduced as described earlier, such that each of | |
7565 | the names returned will be a data type in the earlier list. If this | |
7566 | reduction results in an array, the size returned will be as described | |
7567 | for uniform arrays; otherwise, the size returned will be 1. | |
7568 | ||
7569 | The list of active uniform variables may include both built-in uniform | |
7570 | variables (which begin with the prefix \"gl_\") as well as user-defined | |
7571 | uniform variable names. | |
7572 | ||
7573 | This function will return as much information as it can about the | |
7574 | specified active uniform variable. If no information is available, | |
7575 | LENGTH will be 0, and NAME will be an empty string. This situation could | |
7576 | occur if this function is called after a link operation that failed. If | |
7577 | an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be | |
7578 | unmodified. | |
7579 | ||
7580 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by | |
7581 | OpenGL. | |
7582 | ||
7583 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
7584 | ||
7585 | `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the | |
7586 | number of active uniform variables in PROGRAM. | |
7587 | ||
7588 | `GL_INVALID_OPERATION' is generated if `glGetActiveUniform' is executed | |
7589 | between the execution of `glBegin' and the corresponding execution of | |
7590 | `glEnd'. | |
7591 | ||
7592 | `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.") | |
7593 | ||
7594 | (define-gl-procedure | |
bb894c9d AW |
7595 | ((glGetAttachedShaders |
7596 | (program GLuint) | |
7597 | (maxCount GLsizei) | |
7598 | (count *) | |
7599 | (shaders *) | |
7600 | -> | |
7601 | void)) | |
3c9b6116 AW |
7602 | "Returns the handles of the shader objects attached to a program object. |
7603 | ||
7604 | PROGRAM | |
7605 | Specifies the program object to be queried. | |
7606 | ||
7607 | MAXCOUNT | |
7608 | Specifies the size of the array for storing the returned object | |
7609 | names. | |
7610 | ||
7611 | COUNT | |
7612 | Returns the number of names actually returned in OBJECTS. | |
7613 | ||
7614 | SHADERS | |
7615 | Specifies an array that is used to return the names of attached | |
7616 | shader objects. | |
7617 | ||
7618 | `glGetAttachedShaders' returns the names of the shader objects attached | |
7619 | to PROGRAM. The names of shader objects that are attached to PROGRAM | |
7620 | will be returned in SHADERS. The actual number of shader names written | |
7621 | into SHADERS is returned in COUNT. If no shader objects are attached to | |
7622 | PROGRAM, COUNT is set to 0. The maximum number of shader names that may | |
7623 | be returned in SHADERS is specified by MAXCOUNT. | |
7624 | ||
7625 | If the number of names actually returned is not required (for instance, | |
7626 | if it has just been obtained by calling `glGetProgram'), a value of | |
7627 | `NULL' may be passed for count. If no shader objects are attached to | |
7628 | PROGRAM, a value of 0 will be returned in COUNT. The actual number of | |
7629 | attached shaders can be obtained by calling `glGetProgram' with the | |
7630 | value `GL_ATTACHED_SHADERS'. | |
7631 | ||
7632 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by | |
7633 | OpenGL. | |
7634 | ||
7635 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
7636 | ||
7637 | `GL_INVALID_VALUE' is generated if MAXCOUNT is less than 0. | |
7638 | ||
7639 | `GL_INVALID_OPERATION' is generated if `glGetAttachedShaders' is | |
7640 | executed between the execution of `glBegin' and the corresponding | |
7641 | execution of `glEnd'.") | |
7642 | ||
7643 | (define-gl-procedure | |
bb894c9d AW |
7644 | ((glGetAttribLocation |
7645 | (program GLuint) | |
7646 | (name *) | |
7647 | -> | |
7648 | GLint)) | |
3c9b6116 AW |
7649 | "Returns the location of an attribute variable. |
7650 | ||
7651 | PROGRAM | |
7652 | Specifies the program object to be queried. | |
7653 | ||
7654 | NAME | |
7655 | Points to a null terminated string containing the name of the | |
7656 | attribute variable whose location is to be queried. | |
7657 | ||
7658 | `glGetAttribLocation' queries the previously linked program object | |
7659 | specified by PROGRAM for the attribute variable specified by NAME and | |
7660 | returns the index of the generic vertex attribute that is bound to that | |
7661 | attribute variable. If NAME is a matrix attribute variable, the index of | |
7662 | the first column of the matrix is returned. If the named attribute | |
7663 | variable is not an active attribute in the specified program object or | |
7664 | if NAME starts with the reserved prefix \"gl_\", a value of -1 is | |
7665 | returned. | |
7666 | ||
7667 | The association between an attribute variable name and a generic | |
7668 | attribute index can be specified at any time by calling | |
7669 | `glBindAttribLocation'. Attribute bindings do not go into effect until | |
7670 | `glLinkProgram' is called. After a program object has been linked | |
7671 | successfully, the index values for attribute variables remain fixed | |
7672 | until the next link command occurs. The attribute values can only be | |
7673 | queried after a link if the link was successful. `glGetAttribLocation' | |
7674 | returns the binding that actually went into effect the last time | |
7675 | `glLinkProgram' was called for the specified program object. Attribute | |
7676 | bindings that have been specified since the last link operation are not | |
7677 | returned by `glGetAttribLocation'. | |
7678 | ||
7679 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a value generated | |
7680 | by OpenGL. | |
7681 | ||
7682 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
7683 | ||
7684 | `GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully | |
7685 | linked. | |
7686 | ||
7687 | `GL_INVALID_OPERATION' is generated if `glGetAttribLocation' is executed | |
7688 | between the execution of `glBegin' and the corresponding execution of | |
7689 | `glEnd'.") | |
7690 | ||
7691 | (define-gl-procedure | |
bb894c9d AW |
7692 | ((glGetBufferSubData |
7693 | (target GLenum) | |
7694 | (offset GLintptr) | |
7695 | (size GLsizeiptr) | |
7696 | (data *) | |
7697 | -> | |
7698 | void)) | |
3c9b6116 AW |
7699 | "Returns a subset of a buffer object's data store. |
7700 | ||
7701 | TARGET | |
7702 | Specifies the target buffer object. The symbolic constant must be | |
7703 | `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER', | |
7704 | `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'. | |
7705 | ||
7706 | OFFSET | |
7707 | Specifies the offset into the buffer object's data store from which | |
7708 | data will be returned, measured in bytes. | |
7709 | ||
7710 | SIZE | |
7711 | Specifies the size in bytes of the data store region being | |
7712 | returned. | |
7713 | ||
7714 | DATA | |
7715 | Specifies a pointer to the location where buffer object data is | |
7716 | returned. | |
7717 | ||
7718 | `glGetBufferSubData' returns some or all of the data from the buffer | |
7719 | object currently bound to TARGET. Data starting at byte offset OFFSET | |
7720 | and extending for SIZE bytes is copied from the data store to the memory | |
7721 | pointed to by DATA. An error is thrown if the buffer object is currently | |
7722 | mapped, or if OFFSET and SIZE together define a range beyond the bounds | |
7723 | of the buffer object's data store. | |
7724 | ||
7725 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER', | |
7726 | `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or | |
7727 | `GL_PIXEL_UNPACK_BUFFER'. | |
7728 | ||
7729 | `GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if | |
7730 | together they define a region of memory that extends beyond the buffer | |
7731 | object's allocated data store. | |
7732 | ||
7733 | `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0 | |
7734 | is bound to TARGET. | |
7735 | ||
7736 | `GL_INVALID_OPERATION' is generated if the buffer object being queried | |
7737 | is mapped. | |
7738 | ||
7739 | `GL_INVALID_OPERATION' is generated if `glGetBufferSubData' is executed | |
7740 | between the execution of `glBegin' and the corresponding execution of | |
7741 | `glEnd'.") | |
7742 | ||
7743 | (define-gl-procedure | |
bb894c9d AW |
7744 | ((glGetClipPlane |
7745 | (plane GLenum) | |
7746 | (equation *) | |
7747 | -> | |
7748 | void)) | |
3c9b6116 AW |
7749 | "Return the coefficients of the specified clipping plane. |
7750 | ||
7751 | PLANE | |
7752 | Specifies a clipping plane. The number of clipping planes depends | |
7753 | on the implementation, but at least six clipping planes are | |
7754 | supported. They are identified by symbolic names of the form | |
7755 | `GL_CLIP_PLANE' I where i ranges from 0 to the value of | |
7756 | `GL_MAX_CLIP_PLANES' - 1. | |
7757 | ||
7758 | EQUATION | |
7759 | Returns four double-precision values that are the coefficients of | |
7760 | the plane equation of PLANE in eye coordinates. The initial value | |
7761 | is (0, 0, 0, 0). | |
7762 | ||
7763 | `glGetClipPlane' returns in EQUATION the four coefficients of the plane | |
7764 | equation for PLANE. | |
7765 | ||
7766 | `GL_INVALID_ENUM' is generated if PLANE is not an accepted value. | |
7767 | ||
7768 | `GL_INVALID_OPERATION' is generated if `glGetClipPlane' is executed | |
7769 | between the execution of `glBegin' and the corresponding execution of | |
7770 | `glEnd'.") | |
7771 | ||
7772 | (define-gl-procedure | |
bb894c9d AW |
7773 | ((glGetColorTable |
7774 | (target GLenum) | |
7775 | (format GLenum) | |
7776 | (type GLenum) | |
7777 | (table *) | |
7778 | -> | |
7779 | void)) | |
3c9b6116 AW |
7780 | "Retrieve contents of a color lookup table. |
7781 | ||
7782 | TARGET | |
7783 | Must be `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or | |
7784 | `GL_POST_COLOR_MATRIX_COLOR_TABLE'. | |
7785 | ||
7786 | FORMAT | |
7787 | The format of the pixel data in TABLE. The possible values are | |
7788 | `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', | |
7789 | `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'. | |
7790 | ||
7791 | TYPE | |
7792 | The type of the pixel data in TABLE. Symbolic constants | |
7793 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
7794 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
7795 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
7796 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
7797 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
7798 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
7799 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
7800 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
7801 | are accepted. | |
7802 | ||
7803 | TABLE | |
7804 | Pointer to a one-dimensional array of pixel data containing the | |
7805 | contents of the color table. | |
7806 | ||
7807 | `glGetColorTable' returns in TABLE the contents of the color table | |
7808 | specified by TARGET. No pixel transfer operations are performed, but | |
7809 | pixel storage modes that are applicable to `glReadPixels' are performed. | |
7810 | ||
7811 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' | |
7812 | target (see `glBindBuffer') while a histogram table is requested, TABLE | |
7813 | is treated as a byte offset into the buffer object's data store. | |
7814 | ||
7815 | Color components that are requested in the specified FORMAT, but which | |
7816 | are not included in the internal format of the color lookup table, are | |
7817 | returned as zero. The assignments of internal color components to the | |
7818 | components requested by FORMAT are | |
7819 | ||
7820 | *Internal Component* | |
7821 | *Resulting Component* | |
7822 | ||
7823 | Red | |
7824 | Red | |
7825 | ||
7826 | Green | |
7827 | Green | |
7828 | ||
7829 | Blue | |
7830 | Blue | |
7831 | ||
7832 | Alpha | |
7833 | Alpha | |
7834 | ||
7835 | Luminance | |
7836 | Red | |
7837 | ||
7838 | Intensity | |
7839 | Red | |
7840 | ||
7841 | ||
7842 | ||
7843 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
7844 | values. | |
7845 | ||
7846 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
7847 | values. | |
7848 | ||
7849 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable | |
7850 | values. | |
7851 | ||
7852 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
7853 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
7854 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
7855 | is not `GL_RGB'. | |
7856 | ||
7857 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
7858 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
7859 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
7860 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
7861 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
7862 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
7863 | ||
7864 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
7865 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
7866 | store is currently mapped. | |
7867 | ||
7868 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
7869 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
7870 | to the buffer object such that the memory writes required would exceed | |
7871 | the data store size. | |
7872 | ||
7873 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
7874 | bound to the `GL_PIXEL_PACK_BUFFER' target and TABLE is not evenly | |
7875 | divisible into the number of bytes needed to store in memory a datum | |
7876 | indicated by TYPE. | |
7877 | ||
7878 | `GL_INVALID_OPERATION' is generated if `glGetColorTable' is executed | |
7879 | between the execution of `glBegin' and the corresponding execution of | |
7880 | `glEnd'.") | |
7881 | ||
7882 | (define-gl-procedure | |
bb894c9d AW |
7883 | ((glGetCompressedTexImage |
7884 | (target GLenum) | |
7885 | (lod GLint) | |
7886 | (img *) | |
7887 | -> | |
7888 | void)) | |
3c9b6116 AW |
7889 | "Return a compressed texture image. |
7890 | ||
7891 | TARGET | |
7892 | Specifies which texture is to be obtained. `GL_TEXTURE_1D', | |
7893 | `GL_TEXTURE_2D', and | |
7894 | `GL_TEXTURE_3D'`GL_TEXTURE_CUBE_MAP_POSITIVE_X', | |
7895 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', | |
7896 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', | |
7897 | and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted. | |
7898 | ||
7899 | LOD | |
7900 | Specifies the level-of-detail number of the desired image. Level 0 | |
7901 | is the base image level. Level N is the N th mipmap reduction | |
7902 | image. | |
7903 | ||
7904 | IMG | |
7905 | Returns the compressed texture image. | |
7906 | ||
7907 | `glGetCompressedTexImage' returns the compressed texture image | |
7908 | associated with TARGET and LOD into IMG. IMG should be an array of | |
7909 | `GL_TEXTURE_COMPRESSED_IMAGE_SIZE' bytes. TARGET specifies whether the | |
7910 | desired texture image was one specified by `glTexImage1D' | |
7911 | (`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of | |
7912 | `GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LOD | |
7913 | specifies the level-of-detail number of the desired image. | |
7914 | ||
7915 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' | |
7916 | target (see `glBindBuffer') while a texture image is requested, IMG is | |
7917 | treated as a byte offset into the buffer object's data store. | |
7918 | ||
7919 | To minimize errors, first verify that the texture is compressed by | |
7920 | calling `glGetTexLevelParameter' with argument `GL_TEXTURE_COMPRESSED'. | |
7921 | If the texture is compressed, then determine the amount of memory | |
7922 | required to store the compressed texture by calling | |
7923 | `glGetTexLevelParameter' with argument | |
7924 | `GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal | |
7925 | format of the texture by calling `glGetTexLevelParameter' with argument | |
7926 | `GL_TEXTURE_INTERNAL_FORMAT'. To store the texture for later use, | |
7927 | associate the internal format and size with the retrieved texture image. | |
7928 | These data can be used by the respective texture or subtexture loading | |
7929 | routine used for loading TARGET textures. | |
7930 | ||
7931 | `GL_INVALID_VALUE' is generated if LOD is less than zero or greater than | |
7932 | the maximum number of LODs permitted by the implementation. | |
7933 | ||
7934 | `GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is used | |
7935 | to retrieve a texture that is in an uncompressed internal format. | |
7936 | ||
7937 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
7938 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
7939 | store is currently mapped. | |
7940 | ||
7941 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
7942 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
7943 | to the buffer object such that the memory writes required would exceed | |
7944 | the data store size. | |
7945 | ||
7946 | `GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is | |
7947 | executed between the execution of `glBegin' and the corresponding | |
7948 | execution of `glEnd'.") | |
7949 | ||
7950 | (define-gl-procedure | |
bb894c9d AW |
7951 | ((glGetConvolutionFilter |
7952 | (target GLenum) | |
7953 | (format GLenum) | |
7954 | (type GLenum) | |
7955 | (image *) | |
7956 | -> | |
7957 | void)) | |
3c9b6116 AW |
7958 | "Get current 1D or 2D convolution filter kernel. |
7959 | ||
7960 | TARGET | |
7961 | The filter to be retrieved. Must be one of `GL_CONVOLUTION_1D' or | |
7962 | `GL_CONVOLUTION_2D'. | |
7963 | ||
7964 | FORMAT | |
7965 | Format of the output image. Must be one of `GL_RED', `GL_GREEN', | |
7966 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', | |
7967 | `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'. | |
7968 | ||
7969 | TYPE | |
7970 | Data type of components in the output image. Symbolic constants | |
7971 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
7972 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
7973 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
7974 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
7975 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
7976 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
7977 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
7978 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
7979 | are accepted. | |
7980 | ||
7981 | IMAGE | |
7982 | Pointer to storage for the output image. | |
7983 | ||
7984 | `glGetConvolutionFilter' returns the current 1D or 2D convolution filter | |
7985 | kernel as an image. The one- or two-dimensional image is placed in IMAGE | |
7986 | according to the specifications in FORMAT and TYPE. No pixel transfer | |
7987 | operations are performed on this image, but the relevant pixel storage | |
7988 | modes are applied. | |
7989 | ||
7990 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' | |
7991 | target (see `glBindBuffer') while a convolution filter is requested, | |
7992 | IMAGE is treated as a byte offset into the buffer object's data store. | |
7993 | ||
7994 | Color components that are present in FORMAT but not included in the | |
7995 | internal format of the filter are returned as zero. The assignments of | |
7996 | internal color components to the components of FORMAT are as follows. | |
7997 | ||
7998 | *Internal Component* | |
7999 | *Resulting Component* | |
8000 | ||
8001 | Red | |
8002 | Red | |
8003 | ||
8004 | Green | |
8005 | Green | |
8006 | ||
8007 | Blue | |
8008 | Blue | |
8009 | ||
8010 | Alpha | |
8011 | Alpha | |
8012 | ||
8013 | Luminance | |
8014 | Red | |
8015 | ||
8016 | Intensity | |
8017 | Red | |
8018 | ||
8019 | ||
8020 | ||
8021 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
8022 | values. | |
8023 | ||
8024 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
8025 | values. | |
8026 | ||
8027 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable | |
8028 | values. | |
8029 | ||
8030 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
8031 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
8032 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
8033 | is not `GL_RGB'. | |
8034 | ||
8035 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
8036 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
8037 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
8038 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
8039 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
8040 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
8041 | ||
8042 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8043 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
8044 | store is currently mapped. | |
8045 | ||
8046 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8047 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
8048 | to the buffer object such that the memory writes required would exceed | |
8049 | the data store size. | |
8050 | ||
8051 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8052 | bound to the `GL_PIXEL_PACK_BUFFER' target and IMAGE is not evenly | |
8053 | divisible into the number of bytes needed to store in memory a datum | |
8054 | indicated by TYPE. | |
8055 | ||
8056 | `GL_INVALID_OPERATION' is generated if `glGetConvolutionFilter' is | |
8057 | executed between the execution of `glBegin' and the corresponding | |
8058 | execution of `glEnd'.") | |
8059 | ||
8060 | (define-gl-procedure | |
bb894c9d | 8061 | ((glGetError -> GLenum)) |
3c9b6116 AW |
8062 | "Return error information. |
8063 | ||
8064 | `glGetError' returns the value of the error flag. Each detectable error | |
8065 | is assigned a numeric code and symbolic name. When an error occurs, the | |
8066 | error flag is set to the appropriate error code value. No other errors | |
8067 | are recorded until `glGetError' is called, the error code is returned, | |
8068 | and the flag is reset to `GL_NO_ERROR'. If a call to `glGetError' | |
8069 | returns `GL_NO_ERROR', there has been no detectable error since the last | |
8070 | call to `glGetError', or since the GL was initialized. | |
8071 | ||
8072 | To allow for distributed implementations, there may be several error | |
8073 | flags. If any single error flag has recorded an error, the value of that | |
8074 | flag is returned and that flag is reset to `GL_NO_ERROR' when | |
8075 | `glGetError' is called. If more than one flag has recorded an error, | |
8076 | `glGetError' returns and clears an arbitrary error flag value. Thus, | |
8077 | `glGetError' should always be called in a loop, until it returns | |
8078 | `GL_NO_ERROR', if all error flags are to be reset. | |
8079 | ||
8080 | Initially, all error flags are set to `GL_NO_ERROR'. | |
8081 | ||
8082 | The following errors are currently defined: | |
8083 | ||
8084 | `GL_NO_ERROR' | |
8085 | No error has been recorded. The value of this symbolic constant is | |
8086 | guaranteed to be 0. | |
8087 | ||
8088 | `GL_INVALID_ENUM' | |
8089 | An unacceptable value is specified for an enumerated argument. The | |
8090 | offending command is ignored and has no other side effect than to | |
8091 | set the error flag. | |
8092 | ||
8093 | `GL_INVALID_VALUE' | |
8094 | A numeric argument is out of range. The offending command is | |
8095 | ignored and has no other side effect than to set the error flag. | |
8096 | ||
8097 | `GL_INVALID_OPERATION' | |
8098 | The specified operation is not allowed in the current state. The | |
8099 | offending command is ignored and has no other side effect than to | |
8100 | set the error flag. | |
8101 | ||
8102 | `GL_STACK_OVERFLOW' | |
8103 | This command would cause a stack overflow. The offending command is | |
8104 | ignored and has no other side effect than to set the error flag. | |
8105 | ||
8106 | `GL_STACK_UNDERFLOW' | |
8107 | This command would cause a stack underflow. The offending command | |
8108 | is ignored and has no other side effect than to set the error flag. | |
8109 | ||
8110 | `GL_OUT_OF_MEMORY' | |
8111 | There is not enough memory left to execute the command. The state | |
8112 | of the GL is undefined, except for the state of the error flags, | |
8113 | after this error is recorded. | |
8114 | ||
8115 | `GL_TABLE_TOO_LARGE' | |
8116 | The specified table exceeds the implementation's maximum supported | |
8117 | table size. The offending command is ignored and has no other side | |
8118 | effect than to set the error flag. | |
8119 | ||
8120 | When an error flag is set, results of a GL operation are undefined only | |
8121 | if `GL_OUT_OF_MEMORY' has occurred. In all other cases, the command | |
8122 | generating the error is ignored and has no effect on the GL state or | |
8123 | frame buffer contents. If the generating command returns a value, it | |
8124 | returns 0. If `glGetError' itself generates an error, it returns 0. | |
8125 | ||
8126 | `GL_INVALID_OPERATION' is generated if `glGetError' is executed between | |
8127 | the execution of `glBegin' and the corresponding execution of `glEnd'. | |
8128 | In this case, `glGetError' returns 0.") | |
8129 | ||
8130 | (define-gl-procedure | |
bb894c9d AW |
8131 | ((glGetHistogram |
8132 | (target GLenum) | |
8133 | (reset GLboolean) | |
8134 | (format GLenum) | |
8135 | (type GLenum) | |
8136 | (values *) | |
8137 | -> | |
8138 | void)) | |
3c9b6116 AW |
8139 | "Get histogram table. |
8140 | ||
8141 | TARGET | |
8142 | Must be `GL_HISTOGRAM'. | |
8143 | ||
8144 | RESET | |
8145 | If `GL_TRUE', each component counter that is actually returned is | |
8146 | reset to zero. (Other counters are unaffected.) If `GL_FALSE', none | |
8147 | of the counters in the histogram table is modified. | |
8148 | ||
8149 | FORMAT | |
8150 | The format of values to be returned in VALUES. Must be one of | |
8151 | `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', | |
8152 | `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'. | |
8153 | ||
8154 | TYPE | |
8155 | The type of values to be returned in VALUES. Symbolic constants | |
8156 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
8157 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
8158 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
8159 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
8160 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
8161 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
8162 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
8163 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
8164 | are accepted. | |
8165 | ||
8166 | VALUES | |
8167 | A pointer to storage for the returned histogram table. | |
8168 | ||
8169 | `glGetHistogram' returns the current histogram table as a | |
8170 | one-dimensional image with the same width as the histogram. No pixel | |
8171 | transfer operations are performed on this image, but pixel storage modes | |
8172 | that are applicable to 1D images are honored. | |
8173 | ||
8174 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' | |
8175 | target (see `glBindBuffer') while a histogram table is requested, VALUES | |
8176 | is treated as a byte offset into the buffer object's data store. | |
8177 | ||
8178 | Color components that are requested in the specified FORMAT, but which | |
8179 | are not included in the internal format of the histogram, are returned | |
8180 | as zero. The assignments of internal color components to the components | |
8181 | requested by FORMAT are: | |
8182 | ||
8183 | *Internal Component* | |
8184 | *Resulting Component* | |
8185 | ||
8186 | Red | |
8187 | Red | |
8188 | ||
8189 | Green | |
8190 | Green | |
8191 | ||
8192 | Blue | |
8193 | Blue | |
8194 | ||
8195 | Alpha | |
8196 | Alpha | |
8197 | ||
8198 | Luminance | |
8199 | Red | |
8200 | ||
8201 | ||
8202 | ||
8203 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'. | |
8204 | ||
8205 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
8206 | values. | |
8207 | ||
8208 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable | |
8209 | values. | |
8210 | ||
8211 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
8212 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
8213 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
8214 | is not `GL_RGB'. | |
8215 | ||
8216 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
8217 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
8218 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
8219 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
8220 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
8221 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
8222 | ||
8223 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8224 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
8225 | store is currently mapped. | |
8226 | ||
8227 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8228 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
8229 | to the buffer object such that the memory writes required would exceed | |
8230 | the data store size. | |
8231 | ||
8232 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8233 | bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly | |
8234 | divisible into the number of bytes needed to store in memory a datum | |
8235 | indicated by TYPE. | |
8236 | ||
8237 | `GL_INVALID_OPERATION' is generated if `glGetHistogram' is executed | |
8238 | between the execution of `glBegin' and the corresponding execution of | |
8239 | `glEnd'.") | |
8240 | ||
8241 | (define-gl-procedure | |
bb894c9d AW |
8242 | ((glGetMinmax |
8243 | (target GLenum) | |
8244 | (reset GLboolean) | |
8245 | (format GLenum) | |
8246 | (types GLenum) | |
8247 | (values *) | |
8248 | -> | |
8249 | void)) | |
8250 | "Get minimum and maximum pixel values. | |
3c9b6116 | 8251 | |
bb894c9d AW |
8252 | TARGET |
8253 | Must be `GL_MINMAX'. | |
3c9b6116 | 8254 | |
bb894c9d AW |
8255 | RESET |
8256 | If `GL_TRUE', all entries in the minmax table that are actually | |
8257 | returned are reset to their initial values. (Other entries are | |
8258 | unaltered.) If `GL_FALSE', the minmax table is unaltered. | |
3c9b6116 | 8259 | |
bb894c9d AW |
8260 | FORMAT |
8261 | The format of the data to be returned in VALUES. Must be one of | |
8262 | `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', | |
8263 | `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'. | |
3c9b6116 | 8264 | |
bb894c9d AW |
8265 | TYPES |
8266 | The type of the data to be returned in VALUES. Symbolic constants | |
8267 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
8268 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
8269 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
8270 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
8271 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
8272 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
8273 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
8274 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
8275 | are accepted. | |
3c9b6116 | 8276 | |
bb894c9d AW |
8277 | VALUES |
8278 | A pointer to storage for the returned values. | |
3c9b6116 | 8279 | |
bb894c9d AW |
8280 | `glGetMinmax' returns the accumulated minimum and maximum pixel values |
8281 | (computed on a per-component basis) in a one-dimensional image of width | |
8282 | 2. The first set of return values are the minima, and the second set of | |
8283 | return values are the maxima. The format of the return values is | |
8284 | determined by FORMAT, and their type is determined by TYPES. | |
3c9b6116 | 8285 | |
bb894c9d AW |
8286 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' |
8287 | target (see `glBindBuffer') while minimum and maximum pixel values are | |
8288 | requested, VALUES is treated as a byte offset into the buffer object's | |
8289 | data store. | |
3c9b6116 | 8290 | |
bb894c9d AW |
8291 | No pixel transfer operations are performed on the return values, but |
8292 | pixel storage modes that are applicable to one-dimensional images are | |
8293 | performed. Color components that are requested in the specified FORMAT, | |
8294 | but that are not included in the internal format of the minmax table, | |
8295 | are returned as zero. The assignment of internal color components to the | |
8296 | components requested by FORMAT are as follows: | |
3c9b6116 | 8297 | |
3c9b6116 | 8298 | |
3c9b6116 | 8299 | |
bb894c9d AW |
8300 | *Internal Component* |
8301 | *Resulting Component* | |
3c9b6116 | 8302 | |
bb894c9d AW |
8303 | Red |
8304 | Red | |
3c9b6116 | 8305 | |
bb894c9d AW |
8306 | Green |
8307 | Green | |
3c9b6116 | 8308 | |
bb894c9d AW |
8309 | Blue |
8310 | Blue | |
3c9b6116 | 8311 | |
bb894c9d AW |
8312 | Alpha |
8313 | Alpha | |
3c9b6116 | 8314 | |
bb894c9d AW |
8315 | Luminance |
8316 | Red | |
3c9b6116 | 8317 | |
bb894c9d AW |
8318 | If RESET is `GL_TRUE', the minmax table entries corresponding to the |
8319 | return values are reset to their initial values. Minimum and maximum | |
8320 | values that are not returned are not modified, even if RESET is | |
8321 | `GL_TRUE'. | |
3c9b6116 | 8322 | |
bb894c9d | 8323 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'. |
3c9b6116 AW |
8324 | |
8325 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
8326 | values. | |
8327 | ||
8328 | `GL_INVALID_ENUM' is generated if TYPES is not one of the allowable | |
8329 | values. | |
8330 | ||
8331 | `GL_INVALID_OPERATION' is generated if TYPES is one of | |
8332 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
8333 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
8334 | is not `GL_RGB'. | |
8335 | ||
8336 | `GL_INVALID_OPERATION' is generated if TYPES is one of | |
8337 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
8338 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
8339 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
8340 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
8341 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
8342 | ||
8343 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8344 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
8345 | store is currently mapped. | |
8346 | ||
8347 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8348 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
8349 | to the buffer object such that the memory writes required would exceed | |
8350 | the data store size. | |
8351 | ||
8352 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8353 | bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly | |
8354 | divisible into the number of bytes needed to store in memory a datum | |
8355 | indicated by TYPE. | |
8356 | ||
8357 | `GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between | |
8358 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8359 | ||
8360 | (define-gl-procedure | |
bb894c9d | 8361 | ((glGetPolygonStipple (pattern *) -> void)) |
3c9b6116 AW |
8362 | "Return the polygon stipple pattern. |
8363 | ||
8364 | PATTERN | |
8365 | Returns the stipple pattern. The initial value is all 1's. | |
8366 | ||
8367 | `glGetPolygonStipple' returns to PATTERN a 32×32 polygon stipple | |
8368 | pattern. The pattern is packed into memory as if `glReadPixels' with | |
8369 | both HEIGHT and WIDTH of 32, TYPE of `GL_BITMAP', and FORMAT of | |
8370 | `GL_COLOR_INDEX' were called, and the stipple pattern were stored in an | |
8371 | internal 32×32 color index buffer. Unlike `glReadPixels', however, pixel | |
8372 | transfer operations (shift, offset, pixel map) are not applied to the | |
8373 | returned stipple image. | |
8374 | ||
8375 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' | |
8376 | target (see `glBindBuffer') while a polygon stipple pattern is | |
8377 | requested, PATTERN is treated as a byte offset into the buffer object's | |
8378 | data store. | |
8379 | ||
8380 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8381 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
8382 | store is currently mapped. | |
8383 | ||
8384 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
8385 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
8386 | to the buffer object such that the memory writes required would exceed | |
8387 | the data store size. | |
8388 | ||
8389 | `GL_INVALID_OPERATION' is generated if `glGetPolygonStipple' is executed | |
8390 | between the execution of `glBegin' and the corresponding execution of | |
8391 | `glEnd'.") | |
8392 | ||
8393 | (define-gl-procedure | |
bb894c9d AW |
8394 | ((glGetProgramInfoLog |
8395 | (program GLuint) | |
8396 | (maxLength GLsizei) | |
8397 | (length *) | |
8398 | (infoLog *) | |
8399 | -> | |
8400 | void)) | |
3c9b6116 AW |
8401 | "Returns the information log for a program object. |
8402 | ||
8403 | PROGRAM | |
8404 | Specifies the program object whose information log is to be | |
8405 | queried. | |
8406 | ||
8407 | MAXLENGTH | |
8408 | Specifies the size of the character buffer for storing the returned | |
8409 | information log. | |
8410 | ||
8411 | LENGTH | |
8412 | Returns the length of the string returned in INFOLOG (excluding the | |
8413 | null terminator). | |
8414 | ||
8415 | INFOLOG | |
8416 | Specifies an array of characters that is used to return the | |
8417 | information log. | |
8418 | ||
8419 | `glGetProgramInfoLog' returns the information log for the specified | |
8420 | program object. The information log for a program object is modified | |
8421 | when the program object is linked or validated. The string that is | |
8422 | returned will be null terminated. | |
8423 | ||
8424 | `glGetProgramInfoLog' returns in INFOLOG as much of the information log | |
8425 | as it can, up to a maximum of MAXLENGTH characters. The number of | |
8426 | characters actually returned, excluding the null termination character, | |
8427 | is specified by LENGTH. If the length of the returned string is not | |
8428 | required, a value of `NULL' can be passed in the LENGTH argument. The | |
8429 | size of the buffer required to store the returned information log can be | |
8430 | obtained by calling `glGetProgram' with the value `GL_INFO_LOG_LENGTH'. | |
8431 | ||
8432 | The information log for a program object is either an empty string, or a | |
8433 | string containing information about the last link operation, or a string | |
8434 | containing information about the last validation operation. It may | |
8435 | contain diagnostic messages, warning messages, and other information. | |
8436 | When a program object is created, its information log will be a string | |
8437 | of length 0. | |
8438 | ||
8439 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by | |
8440 | OpenGL. | |
8441 | ||
8442 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
8443 | ||
8444 | `GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0. | |
8445 | ||
8446 | `GL_INVALID_OPERATION' is generated if `glGetProgramInfoLog' is executed | |
8447 | between the execution of `glBegin' and the corresponding execution of | |
8448 | `glEnd'.") | |
8449 | ||
8450 | (define-gl-procedure | |
bb894c9d AW |
8451 | ((glGetSeparableFilter |
8452 | (target GLenum) | |
8453 | (format GLenum) | |
8454 | (type GLenum) | |
8455 | (row *) | |
8456 | (column *) | |
8457 | (span *) | |
8458 | -> | |
8459 | void)) | |
8460 | "Get separable convolution filter kernel images. | |
3c9b6116 | 8461 | |
bb894c9d AW |
8462 | TARGET |
8463 | The separable filter to be retrieved. Must be `GL_SEPARABLE_2D'. | |
3c9b6116 | 8464 | |
bb894c9d AW |
8465 | FORMAT |
8466 | Format of the output images. Must be one of `GL_RED', `GL_GREEN', | |
8467 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR'`GL_RGBA', `GL_BGRA', | |
8468 | `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'. | |
3c9b6116 | 8469 | |
bb894c9d AW |
8470 | TYPE |
8471 | Data type of components in the output images. Symbolic constants | |
8472 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
8473 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
8474 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
8475 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
8476 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
8477 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
8478 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
8479 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
8480 | are accepted. | |
3c9b6116 | 8481 | |
bb894c9d AW |
8482 | ROW |
8483 | Pointer to storage for the row filter image. | |
3c9b6116 | 8484 | |
bb894c9d AW |
8485 | COLUMN |
8486 | Pointer to storage for the column filter image. | |
3c9b6116 | 8487 | |
bb894c9d AW |
8488 | SPAN |
8489 | Pointer to storage for the span filter image (currently unused). | |
3c9b6116 | 8490 | |
bb894c9d AW |
8491 | `glGetSeparableFilter' returns the two one-dimensional filter kernel |
8492 | images for the current separable 2D convolution filter. The row image is | |
8493 | placed in ROW and the column image is placed in COLUMN according to the | |
8494 | specifications in FORMAT and TYPE. (In the current implementation, SPAN | |
8495 | is not affected in any way.) No pixel transfer operations are performed | |
8496 | on the images, but the relevant pixel storage modes are applied. | |
3c9b6116 | 8497 | |
bb894c9d AW |
8498 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' |
8499 | target (see `glBindBuffer') while a separable convolution filter is | |
8500 | requested, ROW, COLUMN, and SPAN are treated as a byte offset into the | |
8501 | buffer object's data store. | |
3c9b6116 | 8502 | |
bb894c9d AW |
8503 | Color components that are present in FORMAT but not included in the |
8504 | internal format of the filters are returned as zero. The assignments of | |
8505 | internal color components to the components of FORMAT are as follows: | |
3c9b6116 | 8506 | |
3c9b6116 | 8507 | |
3c9b6116 | 8508 | |
bb894c9d AW |
8509 | *Internal Component* |
8510 | *Resulting Component* | |
3c9b6116 | 8511 | |
bb894c9d AW |
8512 | Red |
8513 | Red | |
3c9b6116 | 8514 | |
bb894c9d AW |
8515 | Green |
8516 | Green | |
3c9b6116 | 8517 | |
bb894c9d AW |
8518 | Blue |
8519 | Blue | |
3c9b6116 | 8520 | |
bb894c9d AW |
8521 | Alpha |
8522 | Alpha | |
3c9b6116 | 8523 | |
bb894c9d AW |
8524 | Luminance |
8525 | Red | |
3c9b6116 | 8526 | |
bb894c9d AW |
8527 | Intensity |
8528 | Red | |
3c9b6116 | 8529 | |
3c9b6116 | 8530 | |
3c9b6116 | 8531 | |
bb894c9d | 8532 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'. |
3c9b6116 | 8533 | |
bb894c9d AW |
8534 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable |
8535 | values. | |
3c9b6116 | 8536 | |
bb894c9d AW |
8537 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable |
8538 | values. | |
3c9b6116 | 8539 | |
bb894c9d AW |
8540 | `GL_INVALID_OPERATION' is generated if TYPE is one of |
8541 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
8542 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
8543 | is not `GL_RGB'. | |
3c9b6116 | 8544 | |
bb894c9d AW |
8545 | `GL_INVALID_OPERATION' is generated if TYPE is one of |
8546 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
8547 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
8548 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
8549 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
8550 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
3c9b6116 | 8551 | |
bb894c9d AW |
8552 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
8553 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
8554 | store is currently mapped. | |
3c9b6116 | 8555 | |
bb894c9d AW |
8556 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
8557 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
8558 | to the buffer object such that the memory writes required would exceed | |
8559 | the data store size. | |
3c9b6116 | 8560 | |
bb894c9d AW |
8561 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
8562 | bound to the `GL_PIXEL_PACK_BUFFER' target and ROW or COLUMN is not | |
8563 | evenly divisible into the number of bytes needed to store in memory a | |
8564 | datum indicated by TYPE. | |
3c9b6116 | 8565 | |
bb894c9d AW |
8566 | `GL_INVALID_OPERATION' is generated if `glGetSeparableFilter' is |
8567 | executed between the execution of `glBegin' and the corresponding | |
8568 | execution of `glEnd'.") | |
3c9b6116 AW |
8569 | |
8570 | (define-gl-procedure | |
bb894c9d AW |
8571 | ((glGetShaderInfoLog |
8572 | (shader GLuint) | |
8573 | (maxLength GLsizei) | |
8574 | (length *) | |
8575 | (infoLog *) | |
8576 | -> | |
8577 | void)) | |
3c9b6116 AW |
8578 | "Returns the information log for a shader object. |
8579 | ||
8580 | SHADER | |
8581 | Specifies the shader object whose information log is to be queried. | |
8582 | ||
8583 | MAXLENGTH | |
8584 | Specifies the size of the character buffer for storing the returned | |
8585 | information log. | |
8586 | ||
8587 | LENGTH | |
8588 | Returns the length of the string returned in INFOLOG (excluding the | |
8589 | null terminator). | |
8590 | ||
8591 | INFOLOG | |
8592 | Specifies an array of characters that is used to return the | |
8593 | information log. | |
8594 | ||
8595 | `glGetShaderInfoLog' returns the information log for the specified | |
8596 | shader object. The information log for a shader object is modified when | |
8597 | the shader is compiled. The string that is returned will be null | |
8598 | terminated. | |
8599 | ||
8600 | `glGetShaderInfoLog' returns in INFOLOG as much of the information log | |
8601 | as it can, up to a maximum of MAXLENGTH characters. The number of | |
8602 | characters actually returned, excluding the null termination character, | |
8603 | is specified by LENGTH. If the length of the returned string is not | |
8604 | required, a value of `NULL' can be passed in the LENGTH argument. The | |
8605 | size of the buffer required to store the returned information log can be | |
8606 | obtained by calling `glGetShader' with the value `GL_INFO_LOG_LENGTH'. | |
8607 | ||
8608 | The information log for a shader object is a string that may contain | |
8609 | diagnostic messages, warning messages, and other information about the | |
8610 | last compile operation. When a shader object is created, its information | |
8611 | log will be a string of length 0. | |
8612 | ||
8613 | `GL_INVALID_VALUE' is generated if SHADER is not a value generated by | |
8614 | OpenGL. | |
8615 | ||
8616 | `GL_INVALID_OPERATION' is generated if SHADER is not a shader object. | |
8617 | ||
8618 | `GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0. | |
8619 | ||
8620 | `GL_INVALID_OPERATION' is generated if `glGetShaderInfoLog' is executed | |
8621 | between the execution of `glBegin' and the corresponding execution of | |
8622 | `glEnd'.") | |
8623 | ||
8624 | (define-gl-procedure | |
bb894c9d AW |
8625 | ((glGetShaderSource |
8626 | (shader GLuint) | |
8627 | (bufSize GLsizei) | |
8628 | (length *) | |
8629 | (source *) | |
8630 | -> | |
8631 | void)) | |
3c9b6116 AW |
8632 | "Returns the source code string from a shader object. |
8633 | ||
8634 | SHADER | |
8635 | Specifies the shader object to be queried. | |
8636 | ||
8637 | BUFSIZE | |
8638 | Specifies the size of the character buffer for storing the returned | |
8639 | source code string. | |
8640 | ||
8641 | LENGTH | |
8642 | Returns the length of the string returned in SOURCE (excluding the | |
8643 | null terminator). | |
8644 | ||
8645 | SOURCE | |
8646 | Specifies an array of characters that is used to return the source | |
8647 | code string. | |
8648 | ||
8649 | `glGetShaderSource' returns the concatenation of the source code strings | |
8650 | from the shader object specified by SHADER. The source code strings for | |
8651 | a shader object are the result of a previous call to `glShaderSource'. | |
8652 | The string returned by the function will be null terminated. | |
8653 | ||
8654 | `glGetShaderSource' returns in SOURCE as much of the source code string | |
8655 | as it can, up to a maximum of BUFSIZE characters. The number of | |
8656 | characters actually returned, excluding the null termination character, | |
8657 | is specified by LENGTH. If the length of the returned string is not | |
8658 | required, a value of `NULL' can be passed in the LENGTH argument. The | |
8659 | size of the buffer required to store the returned source code string can | |
8660 | be obtained by calling `glGetShader' with the value | |
8661 | `GL_SHADER_SOURCE_LENGTH'. | |
8662 | ||
8663 | `GL_INVALID_VALUE' is generated if SHADER is not a value generated by | |
8664 | OpenGL. | |
8665 | ||
bb894c9d | 8666 | `GL_INVALID_OPERATION' is generated if SHADER is not a shader object. |
3c9b6116 | 8667 | |
bb894c9d | 8668 | `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0. |
3c9b6116 | 8669 | |
bb894c9d AW |
8670 | `GL_INVALID_OPERATION' is generated if `glGetShaderSource' is executed |
8671 | between the execution of `glBegin' and the corresponding execution of | |
8672 | `glEnd'.") | |
3c9b6116 | 8673 | |
bb894c9d AW |
8674 | (define-gl-procedure |
8675 | ((glGetString (name GLenum) -> *)) | |
8676 | "Return a string describing the current GL connection. | |
3c9b6116 | 8677 | |
bb894c9d AW |
8678 | NAME |
8679 | Specifies a symbolic constant, one of `GL_VENDOR', `GL_RENDERER', | |
8680 | `GL_VERSION', `GL_SHADING_LANGUAGE_VERSION', or `GL_EXTENSIONS'. | |
3c9b6116 | 8681 | |
bb894c9d AW |
8682 | `glGetString' returns a pointer to a static string describing some |
8683 | aspect of the current GL connection. NAME can be one of the following: | |
3c9b6116 | 8684 | |
bb894c9d | 8685 | `GL_VENDOR' |
3c9b6116 | 8686 | |
3c9b6116 | 8687 | |
bb894c9d AW |
8688 | Returns the company responsible for this GL implementation. This |
8689 | name does not change from release to release. | |
3c9b6116 | 8690 | |
bb894c9d | 8691 | `GL_RENDERER' |
3c9b6116 | 8692 | |
3c9b6116 | 8693 | |
bb894c9d AW |
8694 | Returns the name of the renderer. This name is typically specific |
8695 | to a particular configuration of a hardware platform. It does not | |
8696 | change from release to release. | |
3c9b6116 | 8697 | |
bb894c9d | 8698 | `GL_VERSION' |
3c9b6116 | 8699 | |
3c9b6116 | 8700 | |
bb894c9d | 8701 | Returns a version or release number. |
3c9b6116 | 8702 | |
bb894c9d | 8703 | `GL_SHADING_LANGUAGE_VERSION' |
3c9b6116 | 8704 | |
3c9b6116 | 8705 | |
bb894c9d | 8706 | Returns a version or release number for the shading language. |
3c9b6116 | 8707 | |
bb894c9d | 8708 | `GL_EXTENSIONS' |
3c9b6116 | 8709 | |
3c9b6116 | 8710 | |
bb894c9d | 8711 | Returns a space-separated list of supported extensions to GL. |
3c9b6116 | 8712 | |
bb894c9d AW |
8713 | Because the GL does not include queries for the performance |
8714 | characteristics of an implementation, some applications are written to | |
8715 | recognize known platforms and modify their GL usage based on known | |
8716 | performance characteristics of these platforms. Strings `GL_VENDOR' and | |
8717 | `GL_RENDERER' together uniquely specify a platform. They do not change | |
8718 | from release to release and should be used by platform-recognition | |
8719 | algorithms. | |
3c9b6116 | 8720 | |
bb894c9d AW |
8721 | Some applications want to make use of features that are not part of the |
8722 | standard GL. These features may be implemented as extensions to the | |
8723 | standard GL. The `GL_EXTENSIONS' string is a space-separated list of | |
8724 | supported GL extensions. (Extension names never contain a space | |
8725 | character.) | |
3c9b6116 | 8726 | |
bb894c9d AW |
8727 | The `GL_VERSION' and `GL_SHADING_LANGUAGE_VERSION' strings begin with a |
8728 | version number. The version number uses one of these forms: | |
3c9b6116 | 8729 | |
bb894c9d | 8730 | MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER |
3c9b6116 | 8731 | |
bb894c9d AW |
8732 | Vendor-specific information may follow the version number. Its format |
8733 | depends on the implementation, but a space always separates the version | |
8734 | number and the vendor-specific information. | |
3c9b6116 | 8735 | |
bb894c9d | 8736 | All strings are null-terminated. |
3c9b6116 | 8737 | |
bb894c9d | 8738 | `GL_INVALID_ENUM' is generated if NAME is not an accepted value. |
3c9b6116 | 8739 | |
bb894c9d AW |
8740 | `GL_INVALID_OPERATION' is generated if `glGetString' is executed between |
8741 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
3c9b6116 | 8742 | |
bb894c9d AW |
8743 | (define-gl-procedure |
8744 | ((glGetTexImage | |
8745 | (target GLenum) | |
8746 | (level GLint) | |
8747 | (format GLenum) | |
8748 | (type GLenum) | |
8749 | (img *) | |
8750 | -> | |
8751 | void)) | |
8752 | "Return a texture image. | |
3c9b6116 | 8753 | |
bb894c9d AW |
8754 | TARGET |
8755 | Specifies which texture is to be obtained. `GL_TEXTURE_1D', | |
8756 | `GL_TEXTURE_2D', `GL_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X', | |
8757 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', | |
8758 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', | |
8759 | and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted. | |
3c9b6116 | 8760 | |
bb894c9d AW |
8761 | LEVEL |
8762 | Specifies the level-of-detail number of the desired image. Level 0 | |
8763 | is the base image level. Level N is the N th mipmap reduction | |
8764 | image. | |
3c9b6116 | 8765 | |
bb894c9d AW |
8766 | FORMAT |
8767 | Specifies a pixel format for the returned data. The supported | |
8768 | formats are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', | |
8769 | `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and | |
8770 | `GL_LUMINANCE_ALPHA'. | |
3c9b6116 | 8771 | |
bb894c9d AW |
8772 | TYPE |
8773 | Specifies a pixel type for the returned data. The supported types | |
8774 | are `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT', | |
8775 | `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', | |
8776 | `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5', | |
8777 | `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4', | |
8778 | `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1', | |
8779 | `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8', | |
8780 | `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and | |
8781 | `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
3c9b6116 | 8782 | |
bb894c9d AW |
8783 | IMG |
8784 | Returns the texture image. Should be a pointer to an array of the | |
8785 | type specified by TYPE. | |
3c9b6116 | 8786 | |
bb894c9d AW |
8787 | `glGetTexImage' returns a texture image into IMG. TARGET specifies |
8788 | whether the desired texture image is one specified by `glTexImage1D' | |
8789 | (`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of | |
8790 | `GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LEVEL | |
8791 | specifies the level-of-detail number of the desired image. FORMAT and | |
8792 | TYPE specify the format and type of the desired image array. See the | |
8793 | reference pages `glTexImage1D' and `glDrawPixels' for a description of | |
8794 | the acceptable values for the FORMAT and TYPE parameters, respectively. | |
3c9b6116 | 8795 | |
bb894c9d AW |
8796 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' |
8797 | target (see `glBindBuffer') while a texture image is requested, IMG is | |
8798 | treated as a byte offset into the buffer object's data store. | |
3c9b6116 | 8799 | |
bb894c9d AW |
8800 | To understand the operation of `glGetTexImage', consider the selected |
8801 | internal four-component texture image to be an RGBA color buffer the | |
8802 | size of the image. The semantics of `glGetTexImage' are then identical | |
8803 | to those of `glReadPixels', with the exception that no pixel transfer | |
8804 | operations are performed, when called with the same FORMAT and TYPE, | |
8805 | with X and Y set to 0, WIDTH set to the width of the texture image | |
8806 | (including border if one was specified), and HEIGHT set to 1 for 1D | |
8807 | images, or to the height of the texture image (including border if one | |
8808 | was specified) for 2D images. Because the internal texture image is an | |
8809 | RGBA image, pixel formats `GL_COLOR_INDEX', `GL_STENCIL_INDEX', and | |
8810 | `GL_DEPTH_COMPONENT' are not accepted, and pixel type `GL_BITMAP' is not | |
8811 | accepted. | |
3c9b6116 | 8812 | |
bb894c9d AW |
8813 | If the selected texture image does not contain four components, the |
8814 | following mappings are applied. Single-component textures are treated as | |
8815 | RGBA buffers with red set to the single-component value, green set to 0, | |
8816 | blue set to 0, and alpha set to 1. Two-component textures are treated as | |
8817 | RGBA buffers with red set to the value of component zero, alpha set to | |
8818 | the value of component one, and green and blue set to 0. Finally, | |
8819 | three-component textures are treated as RGBA buffers with red set to | |
8820 | component zero, green set to component one, blue set to component two, | |
8821 | and alpha set to 1. | |
3c9b6116 | 8822 | |
bb894c9d AW |
8823 | To determine the required size of IMG, use `glGetTexLevelParameter' to |
8824 | determine the dimensions of the internal texture image, then scale the | |
8825 | required number of pixels by the storage required for each pixel, based | |
8826 | on FORMAT and TYPE. Be sure to take the pixel storage parameters into | |
8827 | account, especially `GL_PACK_ALIGNMENT'. | |
3c9b6116 | 8828 | |
bb894c9d AW |
8829 | `GL_INVALID_ENUM' is generated if TARGET, FORMAT, or TYPE is not an |
8830 | accepted value. | |
3c9b6116 | 8831 | |
bb894c9d | 8832 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. |
3c9b6116 | 8833 | |
bb894c9d AW |
8834 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than |
8835 | LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
3c9b6116 | 8836 | |
bb894c9d AW |
8837 | `GL_INVALID_OPERATION' is returned if TYPE is one of |
8838 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
8839 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
8840 | is not `GL_RGB'. | |
3c9b6116 | 8841 | |
bb894c9d AW |
8842 | `GL_INVALID_OPERATION' is returned if TYPE is one of |
8843 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
8844 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
8845 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
8846 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV', and | |
8847 | FORMAT is neither `GL_RGBA' or `GL_BGRA'. | |
3c9b6116 | 8848 | |
bb894c9d AW |
8849 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
8850 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
8851 | store is currently mapped. | |
3c9b6116 | 8852 | |
bb894c9d AW |
8853 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
8854 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
8855 | to the buffer object such that the memory writes required would exceed | |
8856 | the data store size. | |
3c9b6116 | 8857 | |
bb894c9d AW |
8858 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
8859 | bound to the `GL_PIXEL_PACK_BUFFER' target and IMG is not evenly | |
8860 | divisible into the number of bytes needed to store in memory a datum | |
8861 | indicated by TYPE. | |
3c9b6116 | 8862 | |
bb894c9d AW |
8863 | `GL_INVALID_OPERATION' is generated if `glGetTexImage' is executed |
8864 | between the execution of `glBegin' and the corresponding execution of | |
8865 | `glEnd'.") | |
3c9b6116 | 8866 | |
bb894c9d AW |
8867 | (define-gl-procedure |
8868 | ((glGetUniformLocation | |
8869 | (program GLuint) | |
8870 | (name *) | |
8871 | -> | |
8872 | GLint)) | |
8873 | "Returns the location of a uniform variable. | |
3c9b6116 | 8874 | |
bb894c9d AW |
8875 | PROGRAM |
8876 | Specifies the program object to be queried. | |
3c9b6116 | 8877 | |
bb894c9d AW |
8878 | NAME |
8879 | Points to a null terminated string containing the name of the | |
8880 | uniform variable whose location is to be queried. | |
3c9b6116 | 8881 | |
bb894c9d AW |
8882 | `glGetUniformLocation ' returns an integer that represents the location |
8883 | of a specific uniform variable within a program object. NAME must be a | |
8884 | null terminated string that contains no white space. NAME must be an | |
8885 | active uniform variable name in PROGRAM that is not a structure, an | |
8886 | array of structures, or a subcomponent of a vector or a matrix. This | |
8887 | function returns -1 if NAME does not correspond to an active uniform | |
8888 | variable in PROGRAM or if NAME starts with the reserved prefix \"gl_\". | |
3c9b6116 | 8889 | |
bb894c9d AW |
8890 | Uniform variables that are structures or arrays of structures may be |
8891 | queried by calling `glGetUniformLocation' for each field within the | |
8892 | structure. The array element operator \"[]\" and the structure field | |
8893 | operator \".\" may be used in NAME in order to select elements within an | |
8894 | array or fields within a structure. The result of using these operators | |
8895 | is not allowed to be another structure, an array of structures, or a | |
8896 | subcomponent of a vector or a matrix. Except if the last part of NAME | |
8897 | indicates a uniform variable array, the location of the first element of | |
8898 | an array can be retrieved by using the name of the array, or by using | |
8899 | the name appended by \"[0]\". | |
3c9b6116 | 8900 | |
bb894c9d AW |
8901 | The actual locations assigned to uniform variables are not known until |
8902 | the program object is linked successfully. After linking has occurred, | |
8903 | the command `glGetUniformLocation' can be used to obtain the location of | |
8904 | a uniform variable. This location value can then be passed to | |
8905 | `glUniform' to set the value of the uniform variable or to | |
8906 | `glGetUniform' in order to query the current value of the uniform | |
8907 | variable. After a program object has been linked successfully, the index | |
8908 | values for uniform variables remain fixed until the next link command | |
8909 | occurs. Uniform variable locations and values can only be queried after | |
8910 | a link if the link was successful. | |
3c9b6116 | 8911 | |
bb894c9d AW |
8912 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by |
8913 | OpenGL. | |
3c9b6116 | 8914 | |
bb894c9d | 8915 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. |
3c9b6116 | 8916 | |
bb894c9d AW |
8917 | `GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully |
8918 | linked. | |
3c9b6116 | 8919 | |
bb894c9d AW |
8920 | `GL_INVALID_OPERATION' is generated if `glGetUniformLocation' is |
8921 | executed between the execution of `glBegin' and the corresponding | |
8922 | execution of `glEnd'.") | |
3c9b6116 AW |
8923 | |
8924 | (define-gl-procedure | |
bb894c9d | 8925 | ((glHint (target GLenum) (mode GLenum) -> void)) |
3c9b6116 AW |
8926 | "Specify implementation-specific hints. |
8927 | ||
8928 | TARGET | |
8929 | Specifies a symbolic constant indicating the behavior to be | |
8930 | controlled. `GL_FOG_HINT', `GL_GENERATE_MIPMAP_HINT', | |
8931 | `GL_LINE_SMOOTH_HINT', `GL_PERSPECTIVE_CORRECTION_HINT', | |
8932 | `GL_POINT_SMOOTH_HINT', `GL_POLYGON_SMOOTH_HINT', | |
8933 | `GL_TEXTURE_COMPRESSION_HINT', and | |
8934 | `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' are accepted. | |
8935 | ||
8936 | MODE | |
8937 | Specifies a symbolic constant indicating the desired behavior. | |
8938 | `GL_FASTEST', `GL_NICEST', and `GL_DONT_CARE' are accepted. | |
8939 | ||
8940 | Certain aspects of GL behavior, when there is room for interpretation, | |
8941 | can be controlled with hints. A hint is specified with two arguments. | |
8942 | TARGET is a symbolic constant indicating the behavior to be controlled, | |
8943 | and MODE is another symbolic constant indicating the desired behavior. | |
8944 | The initial value for each TARGET is `GL_DONT_CARE'. MODE can be one of | |
8945 | the following: | |
8946 | ||
8947 | `GL_FASTEST' | |
8948 | ||
8949 | ||
8950 | The most efficient option should be chosen. | |
8951 | ||
8952 | `GL_NICEST' | |
8953 | ||
8954 | ||
8955 | The most correct, or highest quality, option should be chosen. | |
8956 | ||
8957 | `GL_DONT_CARE' | |
8958 | ||
8959 | ||
8960 | No preference. | |
8961 | ||
8962 | Though the implementation aspects that can be hinted are well defined, | |
8963 | the interpretation of the hints depends on the implementation. The hint | |
8964 | aspects that can be specified with TARGET, along with suggested | |
8965 | semantics, are as follows: | |
8966 | ||
8967 | `GL_FOG_HINT' | |
8968 | ||
8969 | ||
8970 | Indicates the accuracy of fog calculation. If per-pixel fog | |
8971 | calculation is not efficiently supported by the GL implementation, | |
8972 | hinting `GL_DONT_CARE' or `GL_FASTEST' can result in per-vertex | |
8973 | calculation of fog effects. | |
8974 | ||
8975 | `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' | |
8976 | ||
8977 | ||
8978 | Indicates the accuracy of the derivative calculation for the GL | |
8979 | shading language fragment processing built-in functions: `dFdx', | |
8980 | `dFdy', and `fwidth'. | |
8981 | ||
8982 | `GL_GENERATE_MIPMAP_HINT' | |
8983 | ||
8984 | ||
8985 | Indicates the quality of filtering when generating mipmap images. | |
8986 | ||
8987 | `GL_LINE_SMOOTH_HINT' | |
8988 | ||
8989 | ||
8990 | Indicates the sampling quality of antialiased lines. If a larger | |
8991 | filter function is applied, hinting `GL_NICEST' can result in more | |
8992 | pixel fragments being generated during rasterization. | |
8993 | ||
8994 | `GL_PERSPECTIVE_CORRECTION_HINT' | |
8995 | ||
8996 | ||
8997 | Indicates the quality of color, texture coordinate, and fog | |
8998 | coordinate interpolation. If perspective-corrected parameter | |
8999 | interpolation is not efficiently supported by the GL | |
9000 | implementation, hinting `GL_DONT_CARE' or `GL_FASTEST' can result | |
9001 | in simple linear interpolation of colors and/or texture | |
9002 | coordinates. | |
9003 | ||
9004 | `GL_POINT_SMOOTH_HINT' | |
9005 | ||
9006 | ||
9007 | Indicates the sampling quality of antialiased points. If a larger | |
9008 | filter function is applied, hinting `GL_NICEST' can result in more | |
9009 | pixel fragments being generated during rasterization. | |
9010 | ||
9011 | `GL_POLYGON_SMOOTH_HINT' | |
9012 | ||
9013 | ||
9014 | Indicates the sampling quality of antialiased polygons. Hinting | |
9015 | `GL_NICEST' can result in more pixel fragments being generated | |
9016 | during rasterization, if a larger filter function is applied. | |
9017 | ||
9018 | `GL_TEXTURE_COMPRESSION_HINT' | |
9019 | ||
9020 | ||
9021 | Indicates the quality and performance of the compressing texture | |
9022 | images. Hinting `GL_FASTEST' indicates that texture images should | |
9023 | be compressed as quickly as possible, while `GL_NICEST' indicates | |
9024 | that texture images should be compressed with as little image | |
9025 | quality loss as possible. `GL_NICEST' should be selected if the | |
9026 | texture is to be retrieved by `glGetCompressedTexImage' for reuse. | |
9027 | ||
9028 | `GL_INVALID_ENUM' is generated if either TARGET or MODE is not an | |
9029 | accepted value. | |
9030 | ||
9031 | `GL_INVALID_OPERATION' is generated if `glHint' is executed between the | |
9032 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9033 | ||
9034 | (define-gl-procedure | |
bb894c9d AW |
9035 | ((glHistogram |
9036 | (target GLenum) | |
9037 | (width GLsizei) | |
9038 | (internalformat GLenum) | |
9039 | (sink GLboolean) | |
9040 | -> | |
9041 | void)) | |
3c9b6116 AW |
9042 | "Define histogram table. |
9043 | ||
9044 | TARGET | |
9045 | The histogram whose parameters are to be set. Must be one of | |
9046 | `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'. | |
9047 | ||
9048 | WIDTH | |
9049 | The number of entries in the histogram table. Must be a power of 2. | |
9050 | ||
9051 | INTERNALFORMAT | |
9052 | The format of entries in the histogram table. Must be one of | |
9053 | `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', | |
9054 | `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12', | |
9055 | `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
9056 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
9057 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
9058 | `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', | |
9059 | `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', | |
9060 | `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', | |
9061 | `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'. | |
9062 | ||
9063 | SINK | |
9064 | If `GL_TRUE', pixels will be consumed by the histogramming process | |
9065 | and no drawing or texture loading will take place. If `GL_FALSE', | |
9066 | pixels will proceed to the minmax process after histogramming. | |
9067 | ||
9068 | When `GL_HISTOGRAM' is enabled, RGBA color components are converted to | |
9069 | histogram table indices by clamping to the range [0,1], multiplying by | |
9070 | the width of the histogram table, and rounding to the nearest integer. | |
9071 | The table entries selected by the RGBA indices are then incremented. (If | |
9072 | the internal format of the histogram table includes luminance, then the | |
9073 | index derived from the R color component determines the luminance table | |
9074 | entry to be incremented.) If a histogram table entry is incremented | |
9075 | beyond its maximum value, then its value becomes undefined. (This is not | |
9076 | an error.) | |
9077 | ||
9078 | Histogramming is performed only for RGBA pixels (though these may be | |
9079 | specified originally as color indices and converted to RGBA by index | |
9080 | table lookup). Histogramming is enabled with `glEnable' and disabled | |
9081 | with `glDisable'. | |
9082 | ||
9083 | When TARGET is `GL_HISTOGRAM', `glHistogram' redefines the current | |
9084 | histogram table to have WIDTH entries of the format specified by | |
9085 | INTERNALFORMAT. The entries are indexed 0 through WIDTH-1 , and all | |
9086 | entries are initialized to zero. The values in the previous histogram | |
9087 | table, if any, are lost. If SINK is `GL_TRUE', then pixels are discarded | |
9088 | after histogramming; no further processing of the pixels takes place, | |
9089 | and no drawing, texture loading, or pixel readback will result. | |
9090 | ||
9091 | When TARGET is `GL_PROXY_HISTOGRAM', `glHistogram' computes all state | |
9092 | information as if the histogram table were to be redefined, but does not | |
9093 | actually define the new table. If the requested histogram table is too | |
9094 | large to be supported, then the state information will be set to zero. | |
9095 | This provides a way to determine if a histogram table with the given | |
9096 | parameters can be supported. | |
9097 | ||
9098 | ||
9099 | ||
9100 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
9101 | values. | |
9102 | ||
9103 | `GL_INVALID_VALUE' is generated if WIDTH is less than zero or is not a | |
9104 | power of 2. | |
9105 | ||
9106 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the | |
9107 | allowable values. | |
9108 | ||
9109 | `GL_TABLE_TOO_LARGE' is generated if TARGET is `GL_HISTOGRAM' and the | |
9110 | histogram table specified is too large for the implementation. | |
9111 | ||
9112 | `GL_INVALID_OPERATION' is generated if `glHistogram' is executed between | |
9113 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9114 | ||
9115 | (define-gl-procedure | |
bb894c9d | 9116 | ((glIndexMask (mask GLuint) -> void)) |
3c9b6116 AW |
9117 | "Control the writing of individual bits in the color index buffers. |
9118 | ||
9119 | MASK | |
9120 | Specifies a bit mask to enable and disable the writing of | |
9121 | individual bits in the color index buffers. Initially, the mask is | |
9122 | all 1's. | |
9123 | ||
9124 | `glIndexMask' controls the writing of individual bits in the color index | |
9125 | buffers. The least significant N bits of MASK, where N is the number of | |
9126 | bits in a color index buffer, specify a mask. Where a 1 (one) appears in | |
9127 | the mask, it's possible to write to the corresponding bit in the color | |
9128 | index buffer (or buffers). Where a 0 (zero) appears, the corresponding | |
9129 | bit is write-protected. | |
9130 | ||
9131 | This mask is used only in color index mode, and it affects only the | |
9132 | buffers currently selected for writing (see `glDrawBuffer'). Initially, | |
9133 | all bits are enabled for writing. | |
9134 | ||
9135 | `GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between | |
9136 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9137 | ||
9138 | (define-gl-procedure | |
bb894c9d AW |
9139 | ((glIndexPointer |
9140 | (type GLenum) | |
9141 | (stride GLsizei) | |
9142 | (pointer *) | |
9143 | -> | |
9144 | void)) | |
3c9b6116 AW |
9145 | "Define an array of color indexes. |
9146 | ||
9147 | TYPE | |
9148 | Specifies the data type of each color index in the array. Symbolic | |
9149 | constants `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and | |
9150 | `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'. | |
9151 | ||
9152 | STRIDE | |
9153 | Specifies the byte offset between consecutive color indexes. If | |
9154 | STRIDE is 0, the color indexes are understood to be tightly packed | |
9155 | in the array. The initial value is 0. | |
9156 | ||
9157 | POINTER | |
9158 | Specifies a pointer to the first index in the array. The initial | |
9159 | value is 0. | |
9160 | ||
9161 | `glIndexPointer' specifies the location and data format of an array of | |
9162 | color indexes to use when rendering. TYPE specifies the data type of | |
9163 | each color index and STRIDE specifies the byte stride from one color | |
9164 | index to the next, allowing vertices and attributes to be packed into a | |
9165 | single array or stored in separate arrays. | |
9166 | ||
9167 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' | |
9168 | target (see `glBindBuffer') while a color index array is specified, | |
9169 | POINTER is treated as a byte offset into the buffer object's data store. | |
9170 | Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as | |
9171 | color index vertex array client-side state | |
9172 | (`GL_INDEX_ARRAY_BUFFER_BINDING'). | |
9173 | ||
9174 | When a color index array is specified, TYPE, STRIDE, and POINTER are | |
9175 | saved as client-side state, in addition to the current vertex array | |
9176 | buffer object binding. | |
9177 | ||
9178 | To enable and disable the color index array, call `glEnableClientState' | |
9179 | and `glDisableClientState' with the argument `GL_INDEX_ARRAY'. If | |
9180 | enabled, the color index array is used when `glDrawArrays', | |
9181 | `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', | |
9182 | `glDrawRangeElements', or `glArrayElement' is called. | |
9183 | ||
9184 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
9185 | ||
9186 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
9187 | ||
9188 | (define-gl-procedure | |
bb894c9d AW |
9189 | ((glIndexi (c GLint) -> void) |
9190 | (glIndexd (c GLdouble) -> void) | |
9191 | (glIndexub (c GLubyte) -> void)) | |
3c9b6116 AW |
9192 | "Set the current color index. |
9193 | ||
9194 | C | |
9195 | Specifies the new value for the current color index. | |
9196 | ||
9197 | ||
9198 | ||
9199 | `glIndex' updates the current (single-valued) color index. It takes one | |
9200 | argument, the new value for the current color index. | |
9201 | ||
9202 | The current index is stored as a floating-point value. Integer values | |
9203 | are converted directly to floating-point values, with no special | |
9204 | mapping. The initial value is 1. | |
9205 | ||
9206 | Index values outside the representable range of the color index buffer | |
9207 | are not clamped. However, before an index is dithered (if enabled) and | |
9208 | written to the frame buffer, it is converted to fixed-point format. Any | |
9209 | bits in the integer portion of the resulting fixed-point value that do | |
9210 | not correspond to bits in the frame buffer are masked out.") | |
9211 | ||
9212 | (define-gl-procedure | |
bb894c9d | 9213 | ((glInitNames -> void)) |
3c9b6116 AW |
9214 | "Initialize the name stack. |
9215 | ||
9216 | The name stack is used during selection mode to allow sets of rendering | |
9217 | commands to be uniquely identified. It consists of an ordered set of | |
9218 | unsigned integers. `glInitNames' causes the name stack to be initialized | |
9219 | to its default empty state. | |
9220 | ||
9221 | The name stack is always empty while the render mode is not `GL_SELECT'. | |
9222 | Calls to `glInitNames' while the render mode is not `GL_SELECT' are | |
9223 | ignored. | |
9224 | ||
9225 | `GL_INVALID_OPERATION' is generated if `glInitNames' is executed between | |
9226 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9227 | ||
9228 | (define-gl-procedure | |
bb894c9d AW |
9229 | ((glInterleavedArrays |
9230 | (format GLenum) | |
9231 | (stride GLsizei) | |
9232 | (pointer *) | |
9233 | -> | |
9234 | void)) | |
3c9b6116 AW |
9235 | "Simultaneously specify and enable several interleaved arrays. |
9236 | ||
9237 | FORMAT | |
9238 | Specifies the type of array to enable. Symbolic constants `GL_V2F', | |
9239 | `GL_V3F', `GL_C4UB_V2F', `GL_C4UB_V3F', `GL_C3F_V3F', `GL_N3F_V3F', | |
9240 | `GL_C4F_N3F_V3F', `GL_T2F_V3F', `GL_T4F_V4F', `GL_T2F_C4UB_V3F', | |
9241 | `GL_T2F_C3F_V3F', `GL_T2F_N3F_V3F', `GL_T2F_C4F_N3F_V3F', and | |
9242 | `GL_T4F_C4F_N3F_V4F' are accepted. | |
9243 | ||
9244 | STRIDE | |
9245 | Specifies the offset in bytes between each aggregate array element. | |
9246 | ||
9247 | `glInterleavedArrays' lets you specify and enable individual color, | |
9248 | normal, texture and vertex arrays whose elements are part of a larger | |
9249 | aggregate array element. For some implementations, this is more | |
9250 | efficient than specifying the arrays separately. | |
9251 | ||
9252 | If STRIDE is 0, the aggregate elements are stored consecutively. | |
9253 | Otherwise, STRIDE bytes occur between the beginning of one aggregate | |
9254 | array element and the beginning of the next aggregate array element. | |
9255 | ||
9256 | FORMAT serves as a ``key'' describing the extraction of individual | |
9257 | arrays from the aggregate array. If FORMAT contains a T, then texture | |
9258 | coordinates are extracted from the interleaved array. If C is present, | |
9259 | color values are extracted. If N is present, normal coordinates are | |
9260 | extracted. Vertex coordinates are always extracted. | |
9261 | ||
9262 | The digits 2, 3, and 4 denote how many values are extracted. F indicates | |
9263 | that values are extracted as floating-point values. Colors may also be | |
9264 | extracted as 4 unsigned bytes if 4UB follows the C. If a color is | |
9265 | extracted as 4 unsigned bytes, the vertex array element which follows is | |
9266 | located at the first possible floating-point aligned address. | |
9267 | ||
9268 | `GL_INVALID_ENUM' is generated if FORMAT is not an accepted value. | |
9269 | ||
9270 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
9271 | ||
9272 | (define-gl-procedure | |
bb894c9d | 9273 | ((glIsBuffer (buffer GLuint) -> GLboolean)) |
3c9b6116 AW |
9274 | "Determine if a name corresponds to a buffer object. |
9275 | ||
9276 | BUFFER | |
9277 | Specifies a value that may be the name of a buffer object. | |
9278 | ||
9279 | `glIsBuffer' returns `GL_TRUE' if BUFFER is currently the name of a | |
9280 | buffer object. If BUFFER is zero, or is a non-zero value that is not | |
9281 | currently the name of a buffer object, or if an error occurs, | |
9282 | `glIsBuffer' returns `GL_FALSE'. | |
9283 | ||
9284 | A name returned by `glGenBuffers', but not yet associated with a buffer | |
9285 | object by calling `glBindBuffer', is not the name of a buffer object. | |
9286 | ||
9287 | `GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between | |
9288 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9289 | ||
9290 | (define-gl-procedure | |
bb894c9d | 9291 | ((glIsEnabled (cap GLenum) -> GLboolean)) |
3c9b6116 AW |
9292 | "Test whether a capability is enabled. |
9293 | ||
9294 | CAP | |
9295 | Specifies a symbolic constant indicating a GL capability. | |
9296 | ||
9297 | `glIsEnabled' returns `GL_TRUE' if CAP is an enabled capability and | |
9298 | returns `GL_FALSE' otherwise. Initially all capabilities except | |
9299 | `GL_DITHER' are disabled; `GL_DITHER' is initially enabled. | |
9300 | ||
9301 | The following capabilities are accepted for CAP: | |
9302 | ||
9303 | ||
9304 | ||
9305 | *Constant* | |
9306 | *See* | |
9307 | ||
9308 | `GL_ALPHA_TEST' | |
9309 | `glAlphaFunc' | |
9310 | ||
9311 | `GL_AUTO_NORMAL' | |
9312 | `glEvalCoord' | |
9313 | ||
9314 | `GL_BLEND' | |
9315 | `glBlendFunc', `glLogicOp' | |
9316 | ||
9317 | `GL_CLIP_PLANE'I | |
9318 | `glClipPlane' | |
9319 | ||
9320 | `GL_COLOR_ARRAY' | |
9321 | `glColorPointer' | |
9322 | ||
9323 | `GL_COLOR_LOGIC_OP' | |
9324 | `glLogicOp' | |
9325 | ||
9326 | `GL_COLOR_MATERIAL' | |
9327 | `glColorMaterial' | |
9328 | ||
9329 | `GL_COLOR_SUM' | |
9330 | `glSecondaryColor' | |
9331 | ||
9332 | `GL_COLOR_TABLE' | |
9333 | `glColorTable' | |
9334 | ||
9335 | `GL_CONVOLUTION_1D' | |
9336 | `glConvolutionFilter1D' | |
9337 | ||
9338 | `GL_CONVOLUTION_2D' | |
9339 | `glConvolutionFilter2D' | |
9340 | ||
9341 | `GL_CULL_FACE' | |
9342 | `glCullFace' | |
9343 | ||
9344 | `GL_DEPTH_TEST' | |
9345 | `glDepthFunc', `glDepthRange' | |
9346 | ||
9347 | `GL_DITHER' | |
9348 | `glEnable' | |
9349 | ||
9350 | `GL_EDGE_FLAG_ARRAY' | |
9351 | `glEdgeFlagPointer' | |
9352 | ||
9353 | `GL_FOG' | |
9354 | `glFog' | |
9355 | ||
9356 | `GL_FOG_COORD_ARRAY' | |
9357 | `glFogCoordPointer' | |
9358 | ||
9359 | `GL_HISTOGRAM' | |
9360 | `glHistogram' | |
9361 | ||
9362 | `GL_INDEX_ARRAY' | |
9363 | `glIndexPointer' | |
9364 | ||
9365 | `GL_INDEX_LOGIC_OP' | |
9366 | `glLogicOp' | |
9367 | ||
9368 | `GL_LIGHT'I | |
9369 | `glLightModel', `glLight' | |
9370 | ||
9371 | `GL_LIGHTING' | |
9372 | `glMaterial', `glLightModel', `glLight' | |
9373 | ||
9374 | `GL_LINE_SMOOTH' | |
9375 | `glLineWidth' | |
9376 | ||
9377 | `GL_LINE_STIPPLE' | |
9378 | `glLineStipple' | |
9379 | ||
9380 | `GL_MAP1_COLOR_4' | |
9381 | `glMap1' | |
9382 | ||
9383 | `GL_MAP1_INDEX' | |
9384 | `glMap1' | |
9385 | ||
9386 | `GL_MAP1_NORMAL' | |
9387 | `glMap1' | |
9388 | ||
9389 | `GL_MAP1_TEXTURE_COORD_1' | |
9390 | `glMap1' | |
9391 | ||
9392 | `GL_MAP1_TEXTURE_COORD_2' | |
9393 | `glMap1' | |
9394 | ||
9395 | `GL_MAP1_TEXTURE_COORD_3' | |
9396 | `glMap1' | |
9397 | ||
9398 | `GL_MAP1_TEXTURE_COORD_4' | |
9399 | `glMap1' | |
9400 | ||
9401 | `GL_MAP2_COLOR_4' | |
9402 | `glMap2' | |
9403 | ||
9404 | `GL_MAP2_INDEX' | |
9405 | `glMap2' | |
9406 | ||
9407 | `GL_MAP2_NORMAL' | |
9408 | `glMap2' | |
9409 | ||
9410 | `GL_MAP2_TEXTURE_COORD_1' | |
9411 | `glMap2' | |
9412 | ||
9413 | `GL_MAP2_TEXTURE_COORD_2' | |
9414 | `glMap2' | |
9415 | ||
9416 | `GL_MAP2_TEXTURE_COORD_3' | |
9417 | `glMap2' | |
9418 | ||
9419 | `GL_MAP2_TEXTURE_COORD_4' | |
9420 | `glMap2' | |
9421 | ||
9422 | `GL_MAP2_VERTEX_3' | |
9423 | `glMap2' | |
9424 | ||
9425 | `GL_MAP2_VERTEX_4' | |
9426 | `glMap2' | |
9427 | ||
9428 | `GL_MINMAX' | |
9429 | `glMinmax' | |
9430 | ||
9431 | `GL_MULTISAMPLE' | |
9432 | `glSampleCoverage' | |
9433 | ||
9434 | `GL_NORMAL_ARRAY' | |
9435 | `glNormalPointer' | |
9436 | ||
9437 | `GL_NORMALIZE' | |
9438 | `glNormal' | |
9439 | ||
9440 | `GL_POINT_SMOOTH' | |
9441 | `glPointSize' | |
9442 | ||
9443 | `GL_POINT_SPRITE' | |
9444 | `glEnable' | |
9445 | ||
9446 | `GL_POLYGON_SMOOTH' | |
9447 | `glPolygonMode' | |
9448 | ||
9449 | `GL_POLYGON_OFFSET_FILL' | |
9450 | `glPolygonOffset' | |
9451 | ||
9452 | `GL_POLYGON_OFFSET_LINE' | |
9453 | `glPolygonOffset' | |
9454 | ||
9455 | `GL_POLYGON_OFFSET_POINT' | |
9456 | `glPolygonOffset' | |
9457 | ||
9458 | `GL_POLYGON_STIPPLE' | |
9459 | `glPolygonStipple' | |
9460 | ||
9461 | `GL_POST_COLOR_MATRIX_COLOR_TABLE' | |
9462 | `glColorTable' | |
9463 | ||
9464 | `GL_POST_CONVOLUTION_COLOR_TABLE' | |
9465 | `glColorTable' | |
9466 | ||
9467 | `GL_RESCALE_NORMAL' | |
9468 | `glNormal' | |
9469 | ||
9470 | `GL_SAMPLE_ALPHA_TO_COVERAGE' | |
9471 | `glSampleCoverage' | |
9472 | ||
9473 | `GL_SAMPLE_ALPHA_TO_ONE' | |
9474 | `glSampleCoverage' | |
9475 | ||
9476 | `GL_SAMPLE_COVERAGE' | |
9477 | `glSampleCoverage' | |
9478 | ||
9479 | `GL_SCISSOR_TEST' | |
9480 | `glScissor' | |
9481 | ||
9482 | `GL_SECONDARY_COLOR_ARRAY' | |
9483 | `glSecondaryColorPointer' | |
9484 | ||
9485 | `GL_SEPARABLE_2D' | |
9486 | `glSeparableFilter2D' | |
9487 | ||
9488 | `GL_STENCIL_TEST' | |
9489 | `glStencilFunc', `glStencilOp' | |
9490 | ||
9491 | `GL_TEXTURE_1D' | |
9492 | `glTexImage1D' | |
9493 | ||
9494 | `GL_TEXTURE_2D' | |
9495 | `glTexImage2D' | |
9496 | ||
9497 | `GL_TEXTURE_3D' | |
9498 | `glTexImage3D' | |
9499 | ||
9500 | `GL_TEXTURE_COORD_ARRAY' | |
9501 | `glTexCoordPointer' | |
9502 | ||
9503 | `GL_TEXTURE_CUBE_MAP' | |
9504 | `glTexImage2D' | |
9505 | ||
9506 | `GL_TEXTURE_GEN_Q' | |
9507 | `glTexGen' | |
9508 | ||
9509 | `GL_TEXTURE_GEN_R' | |
9510 | `glTexGen' | |
9511 | ||
9512 | `GL_TEXTURE_GEN_S' | |
9513 | `glTexGen' | |
9514 | ||
9515 | `GL_TEXTURE_GEN_T' | |
9516 | `glTexGen' | |
9517 | ||
9518 | `GL_VERTEX_ARRAY' | |
9519 | `glVertexPointer' | |
9520 | ||
9521 | `GL_VERTEX_PROGRAM_POINT_SIZE' | |
9522 | `glEnable' | |
9523 | ||
9524 | `GL_VERTEX_PROGRAM_TWO_SIDE' | |
9525 | `glEnable' | |
9526 | ||
9527 | ||
9528 | ||
9529 | `GL_INVALID_ENUM' is generated if CAP is not an accepted value. | |
9530 | ||
9531 | `GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between | |
9532 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9533 | ||
9534 | (define-gl-procedure | |
bb894c9d | 9535 | ((glIsList (list GLuint) -> GLboolean)) |
3c9b6116 AW |
9536 | "Determine if a name corresponds to a display list. |
9537 | ||
9538 | LIST | |
9539 | Specifies a potential display list name. | |
9540 | ||
9541 | `glIsList' returns `GL_TRUE' if LIST is the name of a display list and | |
9542 | returns `GL_FALSE' if it is not, or if an error occurs. | |
9543 | ||
9544 | A name returned by `glGenLists', but not yet associated with a display | |
9545 | list by calling `glNewList', is not the name of a display list. | |
9546 | ||
9547 | `GL_INVALID_OPERATION' is generated if `glIsList' is executed between | |
9548 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9549 | ||
9550 | (define-gl-procedure | |
bb894c9d | 9551 | ((glIsProgram (program GLuint) -> GLboolean)) |
3c9b6116 AW |
9552 | "Determines if a name corresponds to a program object. |
9553 | ||
9554 | PROGRAM | |
9555 | Specifies a potential program object. | |
9556 | ||
9557 | `glIsProgram' returns `GL_TRUE' if PROGRAM is the name of a program | |
9558 | object previously created with `glCreateProgram' and not yet deleted | |
9559 | with `glDeleteProgram'. If PROGRAM is zero or a non-zero value that is | |
9560 | not the name of a program object, or if an error occurs, `glIsProgram' | |
9561 | returns `GL_FALSE'. | |
9562 | ||
9563 | `GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between | |
9564 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9565 | ||
9566 | (define-gl-procedure | |
bb894c9d | 9567 | ((glIsQuery (id GLuint) -> GLboolean)) |
3c9b6116 AW |
9568 | "Determine if a name corresponds to a query object. |
9569 | ||
9570 | ID | |
9571 | Specifies a value that may be the name of a query object. | |
9572 | ||
9573 | `glIsQuery' returns `GL_TRUE' if ID is currently the name of a query | |
9574 | object. If ID is zero, or is a non-zero value that is not currently the | |
9575 | name of a query object, or if an error occurs, `glIsQuery' returns | |
9576 | `GL_FALSE'. | |
9577 | ||
9578 | A name returned by `glGenQueries', but not yet associated with a query | |
9579 | object by calling `glBeginQuery', is not the name of a query object. | |
9580 | ||
9581 | `GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between | |
9582 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9583 | ||
9584 | (define-gl-procedure | |
bb894c9d | 9585 | ((glIsShader (shader GLuint) -> GLboolean)) |
3c9b6116 AW |
9586 | "Determines if a name corresponds to a shader object. |
9587 | ||
9588 | SHADER | |
9589 | Specifies a potential shader object. | |
9590 | ||
9591 | `glIsShader' returns `GL_TRUE' if SHADER is the name of a shader object | |
9592 | previously created with `glCreateShader' and not yet deleted with | |
9593 | `glDeleteShader'. If SHADER is zero or a non-zero value that is not the | |
9594 | name of a shader object, or if an error occurs, `glIsShader ' returns | |
9595 | `GL_FALSE'. | |
9596 | ||
9597 | `GL_INVALID_OPERATION' is generated if `glIsShader' is executed between | |
9598 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9599 | ||
9600 | (define-gl-procedure | |
bb894c9d | 9601 | ((glIsTexture (texture GLuint) -> GLboolean)) |
3c9b6116 AW |
9602 | "Determine if a name corresponds to a texture. |
9603 | ||
9604 | TEXTURE | |
9605 | Specifies a value that may be the name of a texture. | |
9606 | ||
9607 | `glIsTexture' returns `GL_TRUE' if TEXTURE is currently the name of a | |
9608 | texture. If TEXTURE is zero, or is a non-zero value that is not | |
9609 | currently the name of a texture, or if an error occurs, `glIsTexture' | |
9610 | returns `GL_FALSE'. | |
9611 | ||
9612 | A name returned by `glGenTextures', but not yet associated with a | |
9613 | texture by calling `glBindTexture', is not the name of a texture. | |
9614 | ||
9615 | `GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between | |
9616 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9617 | ||
9618 | (define-gl-procedure | |
bb894c9d AW |
9619 | ((glLightModelf |
9620 | (pname GLenum) | |
9621 | (param GLfloat) | |
9622 | -> | |
9623 | void) | |
9624 | (glLightModeli | |
9625 | (pname GLenum) | |
9626 | (param GLint) | |
9627 | -> | |
9628 | void)) | |
3c9b6116 AW |
9629 | "Set the lighting model parameters. |
9630 | ||
9631 | PNAME | |
9632 | Specifies a single-valued lighting model parameter. | |
9633 | `GL_LIGHT_MODEL_LOCAL_VIEWER', `GL_LIGHT_MODEL_COLOR_CONTROL', and | |
9634 | `GL_LIGHT_MODEL_TWO_SIDE' are accepted. | |
9635 | ||
9636 | PARAM | |
9637 | Specifies the value that PARAM will be set to. | |
9638 | ||
9639 | `glLightModel' sets the lighting model parameter. PNAME names a | |
9640 | parameter and PARAMS gives the new value. There are three lighting model | |
9641 | parameters: | |
9642 | ||
9643 | `GL_LIGHT_MODEL_AMBIENT' | |
9644 | ||
9645 | ||
9646 | PARAMS contains four integer or floating-point values that specify | |
9647 | the ambient RGBA intensity of the entire scene. Integer values are | |
9648 | mapped linearly such that the most positive representable value | |
9649 | maps to 1.0, and the most negative representable value maps to -1.0 | |
9650 | . Floating-point values are mapped directly. Neither integer nor | |
9651 | floating-point values are clamped. The initial ambient scene | |
9652 | intensity is (0.2, 0.2, 0.2, 1.0). | |
9653 | ||
9654 | `GL_LIGHT_MODEL_COLOR_CONTROL' | |
9655 | ||
9656 | ||
9657 | PARAMS must be either `GL_SEPARATE_SPECULAR_COLOR' or | |
9658 | `GL_SINGLE_COLOR'. `GL_SINGLE_COLOR' specifies that a single color | |
9659 | is generated from the lighting computation for a vertex. | |
9660 | `GL_SEPARATE_SPECULAR_COLOR' specifies that the specular color | |
9661 | computation of lighting be stored separately from the remainder of | |
9662 | the lighting computation. The specular color is summed into the | |
9663 | generated fragment's color after the application of texture mapping | |
9664 | (if enabled). The initial value is `GL_SINGLE_COLOR'. | |
9665 | ||
9666 | `GL_LIGHT_MODEL_LOCAL_VIEWER' | |
9667 | ||
9668 | ||
9669 | PARAMS is a single integer or floating-point value that specifies | |
9670 | how specular reflection angles are computed. If PARAMS is 0 (or | |
9671 | 0.0), specular reflection angles take the view direction to be | |
9672 | parallel to and in the direction of the -Z axis, regardless of the | |
9673 | location of the vertex in eye coordinates. Otherwise, specular | |
9674 | reflections are computed from the origin of the eye coordinate | |
9675 | system. The initial value is 0. | |
9676 | ||
9677 | `GL_LIGHT_MODEL_TWO_SIDE' | |
9678 | ||
9679 | ||
9680 | PARAMS is a single integer or floating-point value that specifies | |
9681 | whether one- or two-sided lighting calculations are done for | |
9682 | polygons. It has no effect on the lighting calculations for points, | |
9683 | lines, or bitmaps. If PARAMS is 0 (or 0.0), one-sided lighting is | |
9684 | specified, and only the FRONT material parameters are used in the | |
9685 | lighting equation. Otherwise, two-sided lighting is specified. In | |
9686 | this case, vertices of back-facing polygons are lighted using the | |
9687 | BACK material parameters and have their normals reversed before the | |
9688 | lighting equation is evaluated. Vertices of front-facing polygons | |
9689 | are always lighted using the FRONT material parameters, with no | |
9690 | change to their normals. The initial value is 0. | |
9691 | ||
9692 | In RGBA mode, the lighted color of a vertex is the sum of the material | |
9693 | emission intensity, the product of the material ambient reflectance and | |
9694 | the lighting model full-scene ambient intensity, and the contribution of | |
9695 | each enabled light source. Each light source contributes the sum of | |
9696 | three terms: ambient, diffuse, and specular. The ambient light source | |
9697 | contribution is the product of the material ambient reflectance and the | |
9698 | light's ambient intensity. The diffuse light source contribution is the | |
9699 | product of the material diffuse reflectance, the light's diffuse | |
9700 | intensity, and the dot product of the vertex's normal with the | |
9701 | normalized vector from the vertex to the light source. The specular | |
9702 | light source contribution is the product of the material specular | |
9703 | reflectance, the light's specular intensity, and the dot product of the | |
9704 | normalized vertex-to-eye and vertex-to-light vectors, raised to the | |
9705 | power of the shininess of the material. All three light source | |
9706 | contributions are attenuated equally based on the distance from the | |
9707 | vertex to the light source and on light source direction, spread | |
9708 | exponent, and spread cutoff angle. All dot products are replaced with 0 | |
9709 | if they evaluate to a negative value. | |
9710 | ||
9711 | The alpha component of the resulting lighted color is set to the alpha | |
9712 | value of the material diffuse reflectance. | |
9713 | ||
9714 | In color index mode, the value of the lighted index of a vertex ranges | |
9715 | from the ambient to the specular values passed to `glMaterial' using | |
9716 | `GL_COLOR_INDEXES'. Diffuse and specular coefficients, computed with a | |
9717 | (.30, .59, .11) weighting of the lights' colors, the shininess of the | |
9718 | material, and the same reflection and attenuation equations as in the | |
9719 | RGBA case, determine how much above ambient the resulting index is. | |
9720 | ||
9721 | `GL_INVALID_ENUM' is generated if PNAME is not an accepted value. | |
9722 | ||
9723 | `GL_INVALID_ENUM' is generated if PNAME is | |
9724 | `GL_LIGHT_MODEL_COLOR_CONTROL' and PARAMS is not one of | |
9725 | `GL_SINGLE_COLOR' or `GL_SEPARATE_SPECULAR_COLOR'. | |
9726 | ||
9727 | `GL_INVALID_OPERATION' is generated if `glLightModel' is executed | |
9728 | between the execution of `glBegin' and the corresponding execution of | |
9729 | `glEnd'.") | |
9730 | ||
9731 | (define-gl-procedure | |
bb894c9d AW |
9732 | ((glLightf |
9733 | (light GLenum) | |
9734 | (pname GLenum) | |
9735 | (param GLfloat) | |
9736 | -> | |
9737 | void) | |
9738 | (glLighti | |
9739 | (light GLenum) | |
9740 | (pname GLenum) | |
9741 | (param GLint) | |
9742 | -> | |
9743 | void)) | |
3c9b6116 AW |
9744 | "Set light source parameters. |
9745 | ||
9746 | LIGHT | |
9747 | Specifies a light. The number of lights depends on the | |
9748 | implementation, but at least eight lights are supported. They are | |
9749 | identified by symbolic names of the form `GL_LIGHT' I , where i | |
9750 | ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. | |
9751 | ||
9752 | PNAME | |
9753 | Specifies a single-valued light source parameter for LIGHT. | |
9754 | `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF', `GL_CONSTANT_ATTENUATION', | |
9755 | `GL_LINEAR_ATTENUATION', and `GL_QUADRATIC_ATTENUATION' are | |
9756 | accepted. | |
9757 | ||
9758 | PARAM | |
9759 | Specifies the value that parameter PNAME of light source LIGHT will | |
9760 | be set to. | |
9761 | ||
9762 | `glLight' sets the values of individual light source parameters. LIGHT | |
9763 | names the light and is a symbolic name of the form `GL_LIGHT'I , where i | |
9764 | ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. PNAME specifies one | |
9765 | of ten light source parameters, again by symbolic name. PARAMS is either | |
9766 | a single value or a pointer to an array that contains the new values. | |
9767 | ||
9768 | To enable and disable lighting calculation, call `glEnable' and | |
9769 | `glDisable' with argument `GL_LIGHTING'. Lighting is initially disabled. | |
9770 | When it is enabled, light sources that are enabled contribute to the | |
9771 | lighting calculation. Light source I is enabled and disabled using | |
9772 | `glEnable' and `glDisable' with argument `GL_LIGHT'I . | |
9773 | ||
9774 | The ten light parameters are as follows: | |
9775 | ||
9776 | `GL_AMBIENT' | |
9777 | PARAMS contains four integer or floating-point values that specify | |
9778 | the ambient RGBA intensity of the light. Integer values are mapped | |
9779 | linearly such that the most positive representable value maps to | |
9780 | 1.0, and the most negative representable value maps to -1.0 . | |
9781 | Floating-point values are mapped directly. Neither integer nor | |
9782 | floating-point values are clamped. The initial ambient light | |
9783 | intensity is (0, 0, 0, 1). | |
9784 | ||
9785 | `GL_DIFFUSE' | |
9786 | PARAMS contains four integer or floating-point values that specify | |
9787 | the diffuse RGBA intensity of the light. Integer values are mapped | |
9788 | linearly such that the most positive representable value maps to | |
9789 | 1.0, and the most negative representable value maps to -1.0 . | |
9790 | Floating-point values are mapped directly. Neither integer nor | |
9791 | floating-point values are clamped. The initial value for | |
9792 | `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is | |
9793 | (0, 0, 0, 1). | |
9794 | ||
9795 | `GL_SPECULAR' | |
9796 | PARAMS contains four integer or floating-point values that specify | |
9797 | the specular RGBA intensity of the light. Integer values are mapped | |
9798 | linearly such that the most positive representable value maps to | |
9799 | 1.0, and the most negative representable value maps to -1.0 . | |
9800 | Floating-point values are mapped directly. Neither integer nor | |
9801 | floating-point values are clamped. The initial value for | |
9802 | `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is | |
9803 | (0, 0, 0, 1). | |
9804 | ||
9805 | `GL_POSITION' | |
9806 | PARAMS contains four integer or floating-point values that specify | |
9807 | the position of the light in homogeneous object coordinates. Both | |
9808 | integer and floating-point values are mapped directly. Neither | |
9809 | integer nor floating-point values are clamped. | |
9810 | ||
9811 | The position is transformed by the modelview matrix when `glLight' | |
9812 | is called (just as if it were a point), and it is stored in eye | |
9813 | coordinates. If the W component of the position is 0, the light is | |
9814 | treated as a directional source. Diffuse and specular lighting | |
9815 | calculations take the light's direction, but not its actual | |
9816 | position, into account, and attenuation is disabled. Otherwise, | |
9817 | diffuse and specular lighting calculations are based on the actual | |
9818 | location of the light in eye coordinates, and attenuation is | |
9819 | enabled. The initial position is (0, 0, 1, 0); thus, the initial | |
9820 | light source is directional, parallel to, and in the direction of | |
9821 | the -Z axis. | |
9822 | ||
9823 | `GL_SPOT_DIRECTION' | |
9824 | PARAMS contains three integer or floating-point values that specify | |
9825 | the direction of the light in homogeneous object coordinates. Both | |
9826 | integer and floating-point values are mapped directly. Neither | |
9827 | integer nor floating-point values are clamped. | |
9828 | ||
9829 | The spot direction is transformed by the upper 3x3 of the modelview | |
9830 | matrix when `glLight' is called, and it is stored in eye | |
9831 | coordinates. It is significant only when `GL_SPOT_CUTOFF' is not | |
9832 | 180, which it is initially. The initial direction is (0,0-1) . | |
9833 | ||
9834 | `GL_SPOT_EXPONENT' | |
9835 | PARAMS is a single integer or floating-point value that specifies | |
9836 | the intensity distribution of the light. Integer and floating-point | |
9837 | values are mapped directly. Only values in the range [0,128] are | |
9838 | accepted. | |
9839 | ||
9840 | Effective light intensity is attenuated by the cosine of the angle | |
9841 | between the direction of the light and the direction from the light | |
9842 | to the vertex being lighted, raised to the power of the spot | |
9843 | exponent. Thus, higher spot exponents result in a more focused | |
9844 | light source, regardless of the spot cutoff angle (see | |
9845 | `GL_SPOT_CUTOFF', next paragraph). The initial spot exponent is 0, | |
9846 | resulting in uniform light distribution. | |
9847 | ||
9848 | `GL_SPOT_CUTOFF' | |
9849 | PARAMS is a single integer or floating-point value that specifies | |
9850 | the maximum spread angle of a light source. Integer and | |
9851 | floating-point values are mapped directly. Only values in the range | |
9852 | [0,90] and the special value 180 are accepted. If the angle between | |
9853 | the direction of the light and the direction from the light to the | |
9854 | vertex being lighted is greater than the spot cutoff angle, the | |
9855 | light is completely masked. Otherwise, its intensity is controlled | |
9856 | by the spot exponent and the attenuation factors. The initial spot | |
9857 | cutoff is 180, resulting in uniform light distribution. | |
9858 | ||
9859 | `GL_CONSTANT_ATTENUATION' | |
9860 | `GL_LINEAR_ATTENUATION' | |
9861 | `GL_QUADRATIC_ATTENUATION' | |
9862 | PARAMS is a single integer or floating-point value that specifies | |
9863 | one of the three light attenuation factors. Integer and | |
9864 | floating-point values are mapped directly. Only nonnegative values | |
9865 | are accepted. If the light is positional, rather than directional, | |
9866 | its intensity is attenuated by the reciprocal of the sum of the | |
9867 | constant factor, the linear factor times the distance between the | |
9868 | light and the vertex being lighted, and the quadratic factor times | |
9869 | the square of the same distance. The initial attenuation factors | |
9870 | are (1, 0, 0), resulting in no attenuation. | |
9871 | ||
9872 | `GL_INVALID_ENUM' is generated if either LIGHT or PNAME is not an | |
9873 | accepted value. | |
9874 | ||
9875 | `GL_INVALID_VALUE' is generated if a spot exponent value is specified | |
9876 | outside the range [0,128] , or if spot cutoff is specified outside the | |
9877 | range [0,90] (except for the special value 180), or if a negative | |
9878 | attenuation factor is specified. | |
9879 | ||
9880 | `GL_INVALID_OPERATION' is generated if `glLight' is executed between the | |
9881 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9882 | ||
9883 | (define-gl-procedure | |
bb894c9d AW |
9884 | ((glLineStipple |
9885 | (factor GLint) | |
9886 | (pattern GLushort) | |
9887 | -> | |
9888 | void)) | |
3c9b6116 AW |
9889 | "Specify the line stipple pattern. |
9890 | ||
9891 | FACTOR | |
9892 | Specifies a multiplier for each bit in the line stipple pattern. If | |
9893 | FACTOR is 3, for example, each bit in the pattern is used three | |
9894 | times before the next bit in the pattern is used. FACTOR is clamped | |
9895 | to the range [1, 256] and defaults to 1. | |
9896 | ||
9897 | PATTERN | |
9898 | Specifies a 16-bit integer whose bit pattern determines which | |
9899 | fragments of a line will be drawn when the line is rasterized. Bit | |
9900 | zero is used first; the default pattern is all 1's. | |
9901 | ||
9902 | Line stippling masks out certain fragments produced by rasterization; | |
9903 | those fragments will not be drawn. The masking is achieved by using | |
9904 | three parameters: the 16-bit line stipple pattern PATTERN, the repeat | |
9905 | count FACTOR, and an integer stipple counter S . | |
9906 | ||
9907 | Counter S is reset to 0 whenever `glBegin' is called and before each | |
9908 | line segment of a `glBegin'(`GL_LINES')/`glEnd' sequence is generated. | |
9909 | It is incremented after each fragment of a unit width aliased line | |
9910 | segment is generated or after each I fragments of an I width line | |
9911 | segment are generated. The I fragments associated with count S are | |
9912 | masked out if | |
9913 | ||
9914 | PATTERN bit (S/FACTOR,)%16 | |
9915 | ||
9916 | is 0, otherwise these fragments are sent to the frame buffer. Bit zero | |
9917 | of PATTERN is the least significant bit. | |
9918 | ||
9919 | Antialiased lines are treated as a sequence of 1×WIDTH rectangles for | |
9920 | purposes of stippling. Whether rectangle S is rasterized or not depends | |
9921 | on the fragment rule described for aliased lines, counting rectangles | |
9922 | rather than groups of fragments. | |
9923 | ||
9924 | To enable and disable line stippling, call `glEnable' and `glDisable' | |
9925 | with argument `GL_LINE_STIPPLE'. When enabled, the line stipple pattern | |
9926 | is applied as described above. When disabled, it is as if the pattern | |
9927 | were all 1's. Initially, line stippling is disabled. | |
9928 | ||
9929 | `GL_INVALID_OPERATION' is generated if `glLineStipple' is executed | |
9930 | between the execution of `glBegin' and the corresponding execution of | |
9931 | `glEnd'.") | |
9932 | ||
9933 | (define-gl-procedure | |
bb894c9d | 9934 | ((glLineWidth (width GLfloat) -> void)) |
3c9b6116 AW |
9935 | "Specify the width of rasterized lines. |
9936 | ||
9937 | WIDTH | |
9938 | Specifies the width of rasterized lines. The initial value is 1. | |
9939 | ||
9940 | `glLineWidth' specifies the rasterized width of both aliased and | |
9941 | antialiased lines. Using a line width other than 1 has different | |
9942 | effects, depending on whether line antialiasing is enabled. To enable | |
9943 | and disable line antialiasing, call `glEnable' and `glDisable' with | |
9944 | argument `GL_LINE_SMOOTH'. Line antialiasing is initially disabled. | |
9945 | ||
9946 | If line antialiasing is disabled, the actual width is determined by | |
9947 | rounding the supplied width to the nearest integer. (If the rounding | |
9948 | results in the value 0, it is as if the line width were 1.) If | |
9949 | ∣ΔX,∣>=∣ΔY,∣ , I pixels are filled in each column that is rasterized, | |
9950 | where I is the rounded value of WIDTH. Otherwise, I pixels are filled in | |
9951 | each row that is rasterized. | |
9952 | ||
9953 | If antialiasing is enabled, line rasterization produces a fragment for | |
9954 | each pixel square that intersects the region lying within the rectangle | |
9955 | having width equal to the current line width, length equal to the actual | |
9956 | length of the line, and centered on the mathematical line segment. The | |
9957 | coverage value for each fragment is the window coordinate area of the | |
9958 | intersection of the rectangular region with the corresponding pixel | |
9959 | square. This value is saved and used in the final rasterization step. | |
9960 | ||
9961 | Not all widths can be supported when line antialiasing is enabled. If an | |
9962 | unsupported width is requested, the nearest supported width is used. | |
9963 | Only width 1 is guaranteed to be supported; others depend on the | |
9964 | implementation. Likewise, there is a range for aliased line widths as | |
9965 | well. To query the range of supported widths and the size difference | |
9966 | between supported widths within the range, call `glGet' with arguments | |
9967 | `GL_ALIASED_LINE_WIDTH_RANGE', `GL_SMOOTH_LINE_WIDTH_RANGE', and | |
9968 | `GL_SMOOTH_LINE_WIDTH_GRANULARITY'. | |
9969 | ||
9970 | `GL_INVALID_VALUE' is generated if WIDTH is less than or equal to 0. | |
9971 | ||
9972 | `GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between | |
9973 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
9974 | ||
9975 | (define-gl-procedure | |
bb894c9d | 9976 | ((glLinkProgram (program GLuint) -> void)) |
3c9b6116 AW |
9977 | "Links a program object. |
9978 | ||
9979 | PROGRAM | |
9980 | Specifies the handle of the program object to be linked. | |
9981 | ||
9982 | `glLinkProgram' links the program object specified by PROGRAM. If any | |
9983 | shader objects of type `GL_VERTEX_SHADER' are attached to PROGRAM, they | |
9984 | will be used to create an executable that will run on the programmable | |
9985 | vertex processor. If any shader objects of type `GL_FRAGMENT_SHADER' are | |
9986 | attached to PROGRAM, they will be used to create an executable that will | |
9987 | run on the programmable fragment processor. | |
9988 | ||
9989 | The status of the link operation will be stored as part of the program | |
9990 | object's state. This value will be set to `GL_TRUE' if the program | |
9991 | object was linked without errors and is ready for use, and `GL_FALSE' | |
9992 | otherwise. It can be queried by calling `glGetProgram' with arguments | |
9993 | PROGRAM and `GL_LINK_STATUS'. | |
9994 | ||
9995 | As a result of a successful link operation, all active user-defined | |
9996 | uniform variables belonging to PROGRAM will be initialized to 0, and | |
9997 | each of the program object's active uniform variables will be assigned a | |
9998 | location that can be queried by calling `glGetUniformLocation'. Also, | |
9999 | any active user-defined attribute variables that have not been bound to | |
10000 | a generic vertex attribute index will be bound to one at this time. | |
10001 | ||
10002 | Linking of a program object can fail for a number of reasons as | |
10003 | specified in the OPENGL SHADING LANGUAGE SPECIFICATION. The following | |
10004 | lists some of the conditions that will cause a link error. | |
10005 | ||
10006 | * The storage limit for uniform variables has been exceeded. | |
10007 | ||
10008 | * The number of active uniform variables supported by the | |
10009 | implementation has been exceeded. | |
10010 | ||
10011 | * The `main' function is missing for the vertex shader or the | |
10012 | fragment shader. | |
10013 | ||
10014 | * A varying variable actually used in the fragment shader is not | |
10015 | declared in the same way (or is not declared at all) in the vertex | |
10016 | shader. | |
10017 | ||
10018 | * A reference to a function or variable name is unresolved. | |
10019 | ||
10020 | * A shared global is declared with two different types or two | |
10021 | different initial values. | |
10022 | ||
10023 | * One or more of the attached shader objects has not been | |
10024 | successfully compiled. | |
10025 | ||
10026 | * Binding a generic attribute matrix caused some rows of the matrix | |
10027 | to fall outside the allowed maximum of `GL_MAX_VERTEX_ATTRIBS'. | |
10028 | ||
10029 | * Not enough contiguous vertex attribute slots could be found to bind | |
10030 | attribute matrices. | |
10031 | ||
10032 | When a program object has been successfully linked, the program object | |
10033 | can be made part of current state by calling `glUseProgram'. Whether or | |
10034 | not the link operation was successful, the program object's information | |
10035 | log will be overwritten. The information log can be retrieved by calling | |
10036 | `glGetProgramInfoLog'. | |
10037 | ||
10038 | `glLinkProgram' will also install the generated executables as part of | |
10039 | the current rendering state if the link operation was successful and the | |
10040 | specified program object is already currently in use as a result of a | |
10041 | previous call to `glUseProgram'. If the program object currently in use | |
10042 | is relinked unsuccessfully, its link status will be set to `GL_FALSE' , | |
10043 | but the executables and associated state will remain part of the current | |
10044 | state until a subsequent call to `glUseProgram' removes it from use. | |
10045 | After it is removed from use, it cannot be made part of current state | |
10046 | until it has been successfully relinked. | |
10047 | ||
10048 | If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but does | |
10049 | not contain shader objects of type `GL_FRAGMENT_SHADER', the vertex | |
10050 | shader will be linked against the implicit interface for fixed | |
10051 | functionality fragment processing. Similarly, if PROGRAM contains shader | |
10052 | objects of type `GL_FRAGMENT_SHADER' but it does not contain shader | |
10053 | objects of type `GL_VERTEX_SHADER', the fragment shader will be linked | |
10054 | against the implicit interface for fixed functionality vertex | |
10055 | processing. | |
10056 | ||
10057 | The program object's information log is updated and the program is | |
10058 | generated at the time of the link operation. After the link operation, | |
10059 | applications are free to modify attached shader objects, compile | |
10060 | attached shader objects, detach shader objects, delete shader objects, | |
10061 | and attach additional shader objects. None of these operations affects | |
10062 | the information log or the program that is part of the program object. | |
10063 | ||
10064 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by | |
10065 | OpenGL. | |
10066 | ||
10067 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
10068 | ||
10069 | `GL_INVALID_OPERATION' is generated if `glLinkProgram' is executed | |
10070 | between the execution of `glBegin' and the corresponding execution of | |
10071 | `glEnd'.") | |
10072 | ||
10073 | (define-gl-procedure | |
bb894c9d | 10074 | ((glListBase (base GLuint) -> void)) |
3c9b6116 AW |
10075 | "Set the display-list base for . |
10076 | ||
10077 | BASE | |
10078 | Specifies an integer offset that will be added to `glCallLists' | |
10079 | offsets to generate display-list names. The initial value is 0. | |
10080 | ||
10081 | `glCallLists' specifies an array of offsets. Display-list names are | |
10082 | generated by adding BASE to each offset. Names that reference valid | |
10083 | display lists are executed; the others are ignored. | |
10084 | ||
10085 | `GL_INVALID_OPERATION' is generated if `glListBase' is executed between | |
10086 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
10087 | ||
10088 | (define-gl-procedure | |
bb894c9d | 10089 | ((glLoadIdentity -> void)) |
3c9b6116 AW |
10090 | "Replace the current matrix with the identity matrix. |
10091 | ||
10092 | `glLoadIdentity' replaces the current matrix with the identity matrix. | |
10093 | It is semantically equivalent to calling `glLoadMatrix' with the | |
10094 | identity matrix | |
10095 | ||
10096 | ||
10097 | ||
10098 | ((1 0 0 0), (0 1 0 0), (0 0 1 0), (0 0 0 1),,) | |
10099 | ||
10100 | ||
10101 | ||
10102 | but in some cases it is more efficient. | |
10103 | ||
10104 | `GL_INVALID_OPERATION' is generated if `glLoadIdentity' is executed | |
10105 | between the execution of `glBegin' and the corresponding execution of | |
10106 | `glEnd'.") | |
10107 | ||
10108 | (define-gl-procedure | |
bb894c9d | 10109 | ((glLoadMatrixd (m *) -> void)) |
3c9b6116 AW |
10110 | "Replace the current matrix with the specified matrix. |
10111 | ||
10112 | M | |
10113 | Specifies a pointer to 16 consecutive values, which are used as the | |
10114 | elements of a 4×4 column-major matrix. | |
10115 | ||
10116 | `glLoadMatrix' replaces the current matrix with the one whose elements | |
10117 | are specified by M. The current matrix is the projection matrix, | |
10118 | modelview matrix, or texture matrix, depending on the current matrix | |
10119 | mode (see `glMatrixMode'). | |
10120 | ||
10121 | The current matrix, M, defines a transformation of coordinates. For | |
10122 | instance, assume M refers to the modelview matrix. If | |
10123 | V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a | |
10124 | vertex, and M points to an array of 16 single- or double-precision | |
10125 | floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview | |
10126 | transformation M\u2061(V,) does the following: | |
10127 | ||
10128 | M\u2061(V,)=((M\u2061[0,] M\u2061[4,] M\u2061[8,] M\u2061[12,]), (M\u2061[1,] M\u2061[5,] M\u2061[9,] M\u2061[13,]), | |
10129 | (M\u2061[2,] M\u2061[6,] M\u2061[10,] M\u2061[14,]), (M\u2061[3,] M\u2061[7,] M\u2061[11,] | |
10130 | M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),) | |
10131 | ||
10132 | ||
10133 | ||
10134 | Projection and texture transformations are similarly defined. | |
10135 | ||
10136 | `GL_INVALID_OPERATION' is generated if `glLoadMatrix' is executed | |
10137 | between the execution of `glBegin' and the corresponding execution of | |
10138 | `glEnd'.") | |
10139 | ||
10140 | (define-gl-procedure | |
bb894c9d | 10141 | ((glLoadName (name GLuint) -> void)) |
3c9b6116 AW |
10142 | "Load a name onto the name stack. |
10143 | ||
10144 | NAME | |
10145 | Specifies a name that will replace the top value on the name stack. | |
10146 | ||
10147 | The name stack is used during selection mode to allow sets of rendering | |
10148 | commands to be uniquely identified. It consists of an ordered set of | |
10149 | unsigned integers and is initially empty. | |
10150 | ||
10151 | `glLoadName' causes NAME to replace the value on the top of the name | |
10152 | stack. | |
10153 | ||
10154 | The name stack is always empty while the render mode is not `GL_SELECT'. | |
10155 | Calls to `glLoadName' while the render mode is not `GL_SELECT' are | |
10156 | ignored. | |
10157 | ||
10158 | `GL_INVALID_OPERATION' is generated if `glLoadName' is called while the | |
10159 | name stack is empty. | |
10160 | ||
10161 | `GL_INVALID_OPERATION' is generated if `glLoadName' is executed between | |
10162 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
10163 | ||
10164 | (define-gl-procedure | |
bb894c9d | 10165 | ((glLoadTransposeMatrixd (m *) -> void)) |
3c9b6116 AW |
10166 | "Replace the current matrix with the specified row-major ordered matrix. |
10167 | ||
10168 | M | |
10169 | Specifies a pointer to 16 consecutive values, which are used as the | |
10170 | elements of a 4×4 row-major matrix. | |
10171 | ||
10172 | `glLoadTransposeMatrix' replaces the current matrix with the one whose | |
10173 | elements are specified by M. The current matrix is the projection | |
10174 | matrix, modelview matrix, or texture matrix, depending on the current | |
10175 | matrix mode (see `glMatrixMode'). | |
10176 | ||
10177 | The current matrix, M, defines a transformation of coordinates. For | |
10178 | instance, assume M refers to the modelview matrix. If | |
10179 | V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a | |
10180 | vertex, and M points to an array of 16 single- or double-precision | |
10181 | floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview | |
10182 | transformation M\u2061(V,) does the following: | |
10183 | ||
10184 | M\u2061(V,)=((M\u2061[0,] M\u2061[1,] M\u2061[2,] M\u2061[3,]), (M\u2061[4,] M\u2061[5,] M\u2061[6,] M\u2061[7,]), | |
10185 | (M\u2061[8,] M\u2061[9,] M\u2061[10,] M\u2061[11,]), (M\u2061[12,] M\u2061[13,] M\u2061[14,] | |
10186 | M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),) | |
10187 | ||
10188 | ||
10189 | ||
10190 | Projection and texture transformations are similarly defined. | |
10191 | ||
10192 | Calling `glLoadTransposeMatrix' with matrix M is identical in operation | |
10193 | to `glLoadMatrix' with M^T , where T represents the transpose. | |
10194 | ||
10195 | `GL_INVALID_OPERATION' is generated if `glLoadTransposeMatrix' is | |
10196 | executed between the execution of `glBegin' and the corresponding | |
10197 | execution of `glEnd'.") | |
10198 | ||
10199 | (define-gl-procedure | |
bb894c9d | 10200 | ((glLogicOp (opcode GLenum) -> void)) |
3c9b6116 AW |
10201 | "Specify a logical pixel operation for color index rendering. |
10202 | ||
10203 | OPCODE | |
10204 | Specifies a symbolic constant that selects a logical operation. The | |
10205 | following symbols are accepted: `GL_CLEAR', `GL_SET', `GL_COPY', | |
10206 | `GL_COPY_INVERTED', `GL_NOOP', `GL_INVERT', `GL_AND', `GL_NAND', | |
10207 | `GL_OR', `GL_NOR', `GL_XOR', `GL_EQUIV', `GL_AND_REVERSE', | |
10208 | `GL_AND_INVERTED', `GL_OR_REVERSE', and `GL_OR_INVERTED'. The | |
10209 | initial value is `GL_COPY'. | |
10210 | ||
10211 | `glLogicOp' specifies a logical operation that, when enabled, is applied | |
10212 | between the incoming color index or RGBA color and the color index or | |
10213 | RGBA color at the corresponding location in the frame buffer. To enable | |
10214 | or disable the logical operation, call `glEnable' and `glDisable' using | |
10215 | the symbolic constant `GL_COLOR_LOGIC_OP' for RGBA mode or | |
10216 | `GL_INDEX_LOGIC_OP' for color index mode. The initial value is disabled | |
10217 | for both operations. | |
10218 | ||
10219 | ||
10220 | ||
10221 | *Opcode* | |
10222 | *Resulting Operation* | |
10223 | ||
10224 | `GL_CLEAR' | |
10225 | 0 | |
10226 | ||
10227 | `GL_SET' | |
10228 | 1 | |
10229 | ||
10230 | `GL_COPY' | |
10231 | s | |
10232 | ||
10233 | `GL_COPY_INVERTED' | |
10234 | ~s | |
10235 | ||
10236 | `GL_NOOP' | |
10237 | d | |
10238 | ||
10239 | `GL_INVERT' | |
10240 | ~d | |
10241 | ||
10242 | `GL_AND' | |
10243 | s & d | |
10244 | ||
10245 | `GL_NAND' | |
10246 | ~(s & d) | |
10247 | ||
10248 | `GL_OR' | |
10249 | s | d | |
10250 | ||
10251 | `GL_NOR' | |
10252 | ~(s | d) | |
10253 | ||
10254 | `GL_XOR' | |
10255 | s ^ d | |
10256 | ||
10257 | `GL_EQUIV' | |
10258 | ~(s ^ d) | |
10259 | ||
10260 | `GL_AND_REVERSE' | |
10261 | s & ~d | |
10262 | ||
10263 | `GL_AND_INVERTED' | |
10264 | ~s & d | |
10265 | ||
10266 | `GL_OR_REVERSE' | |
10267 | s | ~d | |
10268 | ||
10269 | `GL_OR_INVERTED' | |
10270 | ~s | d | |
10271 | ||
10272 | OPCODE is a symbolic constant chosen from the list above. In the | |
10273 | explanation of the logical operations, S represents the incoming color | |
10274 | index and D represents the index in the frame buffer. Standard | |
10275 | C-language operators are used. As these bitwise operators suggest, the | |
10276 | logical operation is applied independently to each bit pair of the | |
10277 | source and destination indices or colors. | |
10278 | ||
10279 | `GL_INVALID_ENUM' is generated if OPCODE is not an accepted value. | |
10280 | ||
10281 | `GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between | |
10282 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
10283 | ||
10284 | (define-gl-procedure | |
bb894c9d AW |
10285 | ((glMap1d |
10286 | (target GLenum) | |
10287 | (u1 GLdouble) | |
10288 | (u2 GLdouble) | |
10289 | (stride GLint) | |
10290 | (order GLint) | |
10291 | (points *) | |
10292 | -> | |
10293 | void)) | |
3c9b6116 AW |
10294 | "Define a one-dimensional evaluator. |
10295 | ||
10296 | TARGET | |
10297 | Specifies the kind of values that are generated by the evaluator. | |
10298 | Symbolic constants `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4', | |
10299 | `GL_MAP1_INDEX', `GL_MAP1_COLOR_4', `GL_MAP1_NORMAL', | |
10300 | `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2', | |
10301 | `GL_MAP1_TEXTURE_COORD_3', and `GL_MAP1_TEXTURE_COORD_4' are | |
10302 | accepted. | |
10303 | ||
10304 | U1 | |
10305 | U2 | |
10306 | ||
10307 | Specify a linear mapping of U , as presented to `glEvalCoord1', to | |
10308 | U^ , the variable that is evaluated by the equations specified by | |
10309 | this command. | |
10310 | ||
10311 | STRIDE | |
10312 | Specifies the number of floats or doubles between the beginning of | |
10313 | one control point and the beginning of the next one in the data | |
10314 | structure referenced in POINTS. This allows control points to be | |
10315 | embedded in arbitrary data structures. The only constraint is that | |
10316 | the values for a particular control point must occupy contiguous | |
10317 | memory locations. | |
10318 | ||
10319 | ORDER | |
10320 | Specifies the number of control points. Must be positive. | |
10321 | ||
10322 | POINTS | |
10323 | Specifies a pointer to the array of control points. | |
10324 | ||
10325 | Evaluators provide a way to use polynomial or rational polynomial | |
10326 | mapping to produce vertices, normals, texture coordinates, and colors. | |
10327 | The values produced by an evaluator are sent to further stages of GL | |
10328 | processing just as if they had been presented using `glVertex', | |
10329 | `glNormal', `glTexCoord', and `glColor' commands, except that the | |
10330 | generated values do not update the current normal, texture coordinates, | |
10331 | or color. | |
10332 | ||
10333 | All polynomial or rational polynomial splines of any degree (up to the | |
10334 | maximum degree supported by the GL implementation) can be described | |
10335 | using evaluators. These include almost all splines used in computer | |
10336 | graphics: B-splines, Bezier curves, Hermite splines, and so on. | |
10337 | ||
10338 | Evaluators define curves based on Bernstein polynomials. Define P\u2061(U^,) | |
10339 | as | |
10340 | ||
10341 | P\u2061(U^,)=ΣI=0NB_I,^N\u2061(U^,)\u2062R_I | |
10342 | ||
10343 | ||
10344 | ||
10345 | where R_I is a control point and B_I,^N\u2061(U^,) is the I th Bernstein | |
10346 | polynomial of degree N (ORDER = N+1 ): | |
10347 | ||
10348 | B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,, | |
10349 | ||
10350 | Recall that | |
10351 | ||
10352 | 0^0==1 and ((N), (0),,)==1 | |
10353 | ||
10354 | `glMap1' is used to define the basis and to specify what kind of values | |
10355 | are produced. Once defined, a map can be enabled and disabled by calling | |
10356 | `glEnable' and `glDisable' with the map name, one of the nine predefined | |
10357 | values for TARGET described below. `glEvalCoord1' evaluates the | |
10358 | one-dimensional maps that are enabled. When `glEvalCoord1' presents a | |
10359 | value U , the Bernstein functions are evaluated using U^ , where | |
10360 | U^=U-U1,/U2-U1, | |
10361 | ||
10362 | TARGET is a symbolic constant that indicates what kind of control points | |
10363 | are provided in POINTS, and what output is generated when the map is | |
10364 | evaluated. It can assume one of nine predefined values: | |
10365 | ||
10366 | `GL_MAP1_VERTEX_3' | |
10367 | Each control point is three floating-point values representing X , | |
10368 | Y , and Z . Internal `glVertex3' commands are generated when the | |
10369 | map is evaluated. | |
10370 | ||
10371 | `GL_MAP1_VERTEX_4' | |
10372 | Each control point is four floating-point values representing X , Y | |
10373 | , Z , and W . Internal `glVertex4' commands are generated when the | |
10374 | map is evaluated. | |
10375 | ||
10376 | `GL_MAP1_INDEX' | |
10377 | Each control point is a single floating-point value representing a | |
10378 | color index. Internal `glIndex' commands are generated when the map | |
10379 | is evaluated but the current index is not updated with the value of | |
10380 | these `glIndex' commands. | |
10381 | ||
10382 | `GL_MAP1_COLOR_4' | |
10383 | Each control point is four floating-point values representing red, | |
10384 | green, blue, and alpha. Internal `glColor4' commands are generated | |
10385 | when the map is evaluated but the current color is not updated with | |
10386 | the value of these `glColor4' commands. | |
10387 | ||
10388 | `GL_MAP1_NORMAL' | |
10389 | Each control point is three floating-point values representing the | |
10390 | X , Y , and Z components of a normal vector. Internal `glNormal' | |
10391 | commands are generated when the map is evaluated but the current | |
10392 | normal is not updated with the value of these `glNormal' commands. | |
10393 | ||
10394 | `GL_MAP1_TEXTURE_COORD_1' | |
10395 | Each control point is a single floating-point value representing | |
10396 | the S texture coordinate. Internal `glTexCoord1' commands are | |
10397 | generated when the map is evaluated but the current texture | |
10398 | coordinates are not updated with the value of these `glTexCoord' | |
10399 | commands. | |
10400 | ||
10401 | `GL_MAP1_TEXTURE_COORD_2' | |
10402 | Each control point is two floating-point values representing the S | |
10403 | and T texture coordinates. Internal `glTexCoord2' commands are | |
10404 | generated when the map is evaluated but the current texture | |
10405 | coordinates are not updated with the value of these `glTexCoord' | |
10406 | commands. | |
10407 | ||
10408 | `GL_MAP1_TEXTURE_COORD_3' | |
10409 | Each control point is three floating-point values representing the | |
10410 | S , T , and R texture coordinates. Internal `glTexCoord3' commands | |
10411 | are generated when the map is evaluated but the current texture | |
10412 | coordinates are not updated with the value of these `glTexCoord' | |
10413 | commands. | |
10414 | ||
10415 | `GL_MAP1_TEXTURE_COORD_4' | |
10416 | Each control point is four floating-point values representing the S | |
10417 | , T , R , and Q texture coordinates. Internal `glTexCoord4' | |
10418 | commands are generated when the map is evaluated but the current | |
10419 | texture coordinates are not updated with the value of these | |
10420 | `glTexCoord' commands. | |
10421 | ||
10422 | STRIDE, ORDER, and POINTS define the array addressing for accessing the | |
10423 | control points. POINTS is the location of the first control point, which | |
10424 | occupies one, two, three, or four contiguous memory locations, depending | |
10425 | on which map is being defined. ORDER is the number of control points in | |
10426 | the array. STRIDE specifies how many float or double locations to | |
10427 | advance the internal memory pointer to reach the next control point. | |
10428 | ||
10429 | `GL_INVALID_ENUM' is generated if TARGET is not an accepted value. | |
10430 | ||
10431 | `GL_INVALID_VALUE' is generated if U1 is equal to U2. | |
10432 | ||
10433 | `GL_INVALID_VALUE' is generated if STRIDE is less than the number of | |
10434 | values in a control point. | |
10435 | ||
10436 | `GL_INVALID_VALUE' is generated if ORDER is less than 1 or greater than | |
10437 | the return value of `GL_MAX_EVAL_ORDER'. | |
10438 | ||
10439 | `GL_INVALID_OPERATION' is generated if `glMap1' is executed between the | |
10440 | execution of `glBegin' and the corresponding execution of `glEnd'. | |
10441 | ||
10442 | `GL_INVALID_OPERATION' is generated if `glMap1' is called and the value | |
10443 | of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.") | |
10444 | ||
10445 | (define-gl-procedure | |
bb894c9d AW |
10446 | ((glMap2d |
10447 | (target GLenum) | |
10448 | (u1 GLdouble) | |
10449 | (u2 GLdouble) | |
10450 | (ustride GLint) | |
10451 | (uorder GLint) | |
10452 | (v1 GLdouble) | |
10453 | (v2 GLdouble) | |
10454 | (vstride GLint) | |
10455 | (vorder GLint) | |
10456 | (points *) | |
10457 | -> | |
10458 | void)) | |
3c9b6116 AW |
10459 | "Define a two-dimensional evaluator. |
10460 | ||
10461 | TARGET | |
10462 | Specifies the kind of values that are generated by the evaluator. | |
10463 | Symbolic constants `GL_MAP2_VERTEX_3', `GL_MAP2_VERTEX_4', | |
10464 | `GL_MAP2_INDEX', `GL_MAP2_COLOR_4', `GL_MAP2_NORMAL', | |
10465 | `GL_MAP2_TEXTURE_COORD_1', `GL_MAP2_TEXTURE_COORD_2', | |
10466 | `GL_MAP2_TEXTURE_COORD_3', and `GL_MAP2_TEXTURE_COORD_4' are | |
10467 | accepted. | |
10468 | ||
10469 | U1 | |
10470 | U2 | |
10471 | ||
10472 | Specify a linear mapping of U , as presented to `glEvalCoord2', to | |
10473 | U^ , one of the two variables that are evaluated by the equations | |
10474 | specified by this command. Initially, U1 is 0 and U2 is 1. | |
10475 | ||
10476 | USTRIDE | |
10477 | Specifies the number of floats or doubles between the beginning of | |
10478 | control point R_IJ and the beginning of control point R_(I+1,)\u2062J, , | |
10479 | where I and J are the U and V control point indices, respectively. | |
10480 | This allows control points to be embedded in arbitrary data | |
10481 | structures. The only constraint is that the values for a particular | |
10482 | control point must occupy contiguous memory locations. The initial | |
10483 | value of USTRIDE is 0. | |
10484 | ||
10485 | UORDER | |
10486 | Specifies the dimension of the control point array in the U axis. | |
10487 | Must be positive. The initial value is 1. | |
10488 | ||
10489 | V1 | |
10490 | V2 | |
10491 | ||
10492 | Specify a linear mapping of V , as presented to `glEvalCoord2', to | |
10493 | V^ , one of the two variables that are evaluated by the equations | |
10494 | specified by this command. Initially, V1 is 0 and V2 is 1. | |
10495 | ||
10496 | VSTRIDE | |
10497 | Specifies the number of floats or doubles between the beginning of | |
10498 | control point R_IJ and the beginning of control point R_I\u2061(J+1,), , | |
10499 | where I and J are the U and V control point indices, respectively. | |
10500 | This allows control points to be embedded in arbitrary data | |
10501 | structures. The only constraint is that the values for a particular | |
10502 | control point must occupy contiguous memory locations. The initial | |
10503 | value of VSTRIDE is 0. | |
10504 | ||
10505 | VORDER | |
10506 | Specifies the dimension of the control point array in the V axis. | |
10507 | Must be positive. The initial value is 1. | |
10508 | ||
10509 | POINTS | |
10510 | Specifies a pointer to the array of control points. | |
10511 | ||
10512 | Evaluators provide a way to use polynomial or rational polynomial | |
10513 | mapping to produce vertices, normals, texture coordinates, and colors. | |
10514 | The values produced by an evaluator are sent on to further stages of GL | |
10515 | processing just as if they had been presented using `glVertex', | |
10516 | `glNormal', `glTexCoord', and `glColor' commands, except that the | |
10517 | generated values do not update the current normal, texture coordinates, | |
10518 | or color. | |
10519 | ||
10520 | All polynomial or rational polynomial splines of any degree (up to the | |
10521 | maximum degree supported by the GL implementation) can be described | |
10522 | using evaluators. These include almost all surfaces used in computer | |
10523 | graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces, | |
10524 | and so on. | |
10525 | ||
10526 | Evaluators define surfaces based on bivariate Bernstein polynomials. | |
10527 | Define P\u2061(U^,V^) as | |
10528 | ||
10529 | P\u2061(U^,V^)=ΣI=0NΣJ=0MB_I,^N\u2061(U^,)\u2062B_J,^M\u2061(V^,)\u2062R_IJ | |
10530 | ||
10531 | ||
10532 | ||
10533 | where R_IJ is a control point, B_I,^N\u2061(U^,) is the I th Bernstein | |
10534 | polynomial of degree N (UORDER = N+1 ) | |
10535 | ||
10536 | B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,, | |
10537 | ||
10538 | and B_J,^M\u2061(V^,) is the J th Bernstein polynomial of degree M (VORDER = | |
10539 | M+1 ) | |
10540 | ||
10541 | B_J,^M\u2061(V^,)=((M), (J),,)\u2062V^,^J\u2062(1-V^,)^M-J,, | |
10542 | ||
10543 | Recall that 0^0==1 and ((N), (0),,)==1 | |
10544 | ||
10545 | `glMap2' is used to define the basis and to specify what kind of values | |
10546 | are produced. Once defined, a map can be enabled and disabled by calling | |
10547 | `glEnable' and `glDisable' with the map name, one of the nine predefined | |
10548 | values for TARGET, described below. When `glEvalCoord2' presents values | |
10549 | U and V , the bivariate Bernstein polynomials are evaluated using U^ and | |
10550 | V^ , where | |
10551 | ||
10552 | U^=U-U1,/U2-U1, | |
10553 | ||
10554 | V^=V-V1,/V2-V1, | |
10555 | ||
10556 | TARGET is a symbolic constant that indicates what kind of control points | |
10557 | are provided in POINTS, and what output is generated when the map is | |
10558 | evaluated. It can assume one of nine predefined values: | |
10559 | ||
10560 | `GL_MAP2_VERTEX_3' | |
10561 | Each control point is three floating-point values representing X , | |
10562 | Y , and Z . Internal `glVertex3' commands are generated when the | |
10563 | map is evaluated. | |
10564 | ||
10565 | `GL_MAP2_VERTEX_4' | |
10566 | Each control point is four floating-point values representing X , Y | |
10567 | , Z , and W . Internal `glVertex4' commands are generated when the | |
10568 | map is evaluated. | |
10569 | ||
10570 | `GL_MAP2_INDEX' | |
10571 | Each control point is a single floating-point value representing a | |
10572 | color index. Internal `glIndex' commands are generated when the map | |
10573 | is evaluated but the current index is not updated with the value of | |
10574 | these `glIndex' commands. | |
10575 | ||
10576 | `GL_MAP2_COLOR_4' | |
10577 | Each control point is four floating-point values representing red, | |
10578 | green, blue, and alpha. Internal `glColor4' commands are generated | |
10579 | when the map is evaluated but the current color is not updated with | |
10580 | the value of these `glColor4' commands. | |
10581 | ||
10582 | `GL_MAP2_NORMAL' | |
10583 | Each control point is three floating-point values representing the | |
10584 | X , Y , and Z components of a normal vector. Internal `glNormal' | |
10585 | commands are generated when the map is evaluated but the current | |
10586 | normal is not updated with the value of these `glNormal' commands. | |
10587 | ||
10588 | `GL_MAP2_TEXTURE_COORD_1' | |
10589 | Each control point is a single floating-point value representing | |
10590 | the S texture coordinate. Internal `glTexCoord1' commands are | |
10591 | generated when the map is evaluated but the current texture | |
10592 | coordinates are not updated with the value of these `glTexCoord' | |
10593 | commands. | |
10594 | ||
10595 | `GL_MAP2_TEXTURE_COORD_2' | |
10596 | Each control point is two floating-point values representing the S | |
10597 | and T texture coordinates. Internal `glTexCoord2' commands are | |
10598 | generated when the map is evaluated but the current texture | |
10599 | coordinates are not updated with the value of these `glTexCoord' | |
10600 | commands. | |
10601 | ||
10602 | `GL_MAP2_TEXTURE_COORD_3' | |
10603 | Each control point is three floating-point values representing the | |
10604 | S , T , and R texture coordinates. Internal `glTexCoord3' commands | |
10605 | are generated when the map is evaluated but the current texture | |
10606 | coordinates are not updated with the value of these `glTexCoord' | |
10607 | commands. | |
10608 | ||
10609 | `GL_MAP2_TEXTURE_COORD_4' | |
10610 | Each control point is four floating-point values representing the S | |
10611 | , T , R , and Q texture coordinates. Internal `glTexCoord4' | |
10612 | commands are generated when the map is evaluated but the current | |
10613 | texture coordinates are not updated with the value of these | |
10614 | `glTexCoord' commands. | |
10615 | ||
10616 | USTRIDE, UORDER, VSTRIDE, VORDER, and POINTS define the array addressing | |
10617 | for accessing the control points. POINTS is the location of the first | |
10618 | control point, which occupies one, two, three, or four contiguous memory | |
10619 | locations, depending on which map is being defined. There are | |
10620 | UORDER×VORDER control points in the array. USTRIDE specifies how many | |
10621 | float or double locations are skipped to advance the internal memory | |
10622 | pointer from control point R_I\u2062J, to control point R_(I+1,)\u2062J, . VSTRIDE | |
10623 | specifies how many float or double locations are skipped to advance the | |
10624 | internal memory pointer from control point R_I\u2062J, to control point | |
10625 | R_I\u2061(J+1,), . | |
10626 | ||
10627 | `GL_INVALID_ENUM' is generated if TARGET is not an accepted value. | |
10628 | ||
10629 | `GL_INVALID_VALUE' is generated if U1 is equal to U2, or if V1 is equal | |
10630 | to V2. | |
10631 | ||
10632 | `GL_INVALID_VALUE' is generated if either USTRIDE or VSTRIDE is less | |
10633 | than the number of values in a control point. | |
10634 | ||
10635 | `GL_INVALID_VALUE' is generated if either UORDER or VORDER is less than | |
10636 | 1 or greater than the return value of `GL_MAX_EVAL_ORDER'. | |
10637 | ||
10638 | `GL_INVALID_OPERATION' is generated if `glMap2' is executed between the | |
10639 | execution of `glBegin' and the corresponding execution of `glEnd'. | |
10640 | ||
10641 | `GL_INVALID_OPERATION' is generated if `glMap2' is called and the value | |
10642 | of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.") | |
10643 | ||
10644 | (define-gl-procedure | |
bb894c9d AW |
10645 | ((glMapBuffer |
10646 | (target GLenum) | |
10647 | (access GLenum) | |
10648 | -> | |
10649 | *) | |
10650 | (glUnmapBuffer (target GLenum) -> GLboolean)) | |
3c9b6116 AW |
10651 | "Map a buffer object's data store. |
10652 | ||
10653 | TARGET | |
10654 | Specifies the target buffer object being mapped. The symbolic | |
10655 | constant must be `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER', | |
10656 | `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'. | |
10657 | ||
10658 | ACCESS | |
10659 | Specifies the access policy, indicating whether it will be possible | |
10660 | to read from, write to, or both read from and write to the buffer | |
10661 | object's mapped data store. The symbolic constant must be | |
10662 | `GL_READ_ONLY', `GL_WRITE_ONLY', or `GL_READ_WRITE'. | |
10663 | ||
10664 | `glMapBuffer' maps to the client's address space the entire data store | |
10665 | of the buffer object currently bound to TARGET. The data can then be | |
10666 | directly read and/or written relative to the returned pointer, depending | |
10667 | on the specified ACCESS policy. If the GL is unable to map the buffer | |
10668 | object's data store, `glMapBuffer' generates an error and returns | |
10669 | `NULL'. This may occur for system-specific reasons, such as low virtual | |
10670 | memory availability. | |
10671 | ||
10672 | If a mapped data store is accessed in a way inconsistent with the | |
10673 | specified ACCESS policy, no error is generated, but performance may be | |
10674 | negatively impacted and system errors, including program termination, | |
10675 | may result. Unlike the USAGE parameter of `glBufferData', ACCESS is not | |
10676 | a hint, and does in fact constrain the usage of the mapped data store on | |
10677 | some GL implementations. In order to achieve the highest performance | |
10678 | available, a buffer object's data store should be used in ways | |
10679 | consistent with both its specified USAGE and ACCESS parameters. | |
10680 | ||
10681 | A mapped data store must be unmapped with `glUnmapBuffer' before its | |
10682 | buffer object is used. Otherwise an error will be generated by any GL | |
10683 | command that attempts to dereference the buffer object's data store. | |
10684 | When a data store is unmapped, the pointer to its data store becomes | |
10685 | invalid. `glUnmapBuffer' returns `GL_TRUE' unless the data store | |
10686 | contents have become corrupt during the time the data store was mapped. | |
10687 | This can occur for system-specific reasons that affect the availability | |
10688 | of graphics memory, such as screen mode changes. In such situations, | |
10689 | `GL_FALSE' is returned and the data store contents are undefined. An | |
10690 | application must detect this rare condition and reinitialize the data | |
10691 | store. | |
10692 | ||
10693 | A buffer object's mapped data store is automatically unmapped when the | |
10694 | buffer object is deleted or its data store is recreated with | |
10695 | `glBufferData'. | |
10696 | ||
10697 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER', | |
10698 | `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or | |
10699 | `GL_PIXEL_UNPACK_BUFFER'. | |
10700 | ||
10701 | `GL_INVALID_ENUM' is generated if ACCESS is not `GL_READ_ONLY', | |
10702 | `GL_WRITE_ONLY', or `GL_READ_WRITE'. | |
10703 | ||
10704 | `GL_OUT_OF_MEMORY' is generated when `glMapBuffer' is executed if the GL | |
10705 | is unable to map the buffer object's data store. This may occur for a | |
10706 | variety of system-specific reasons, such as the absence of sufficient | |
10707 | remaining virtual memory. | |
10708 | ||
10709 | `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0 | |
10710 | is bound to TARGET. | |
10711 | ||
10712 | `GL_INVALID_OPERATION' is generated if `glMapBuffer' is executed for a | |
10713 | buffer object whose data store is already mapped. | |
10714 | ||
10715 | `GL_INVALID_OPERATION' is generated if `glUnmapBuffer' is executed for a | |
10716 | buffer object whose data store is not currently mapped. | |
10717 | ||
10718 | `GL_INVALID_OPERATION' is generated if `glMapBuffer' or `glUnmapBuffer' | |
10719 | is executed between the execution of `glBegin' and the corresponding | |
10720 | execution of `glEnd'.") | |
10721 | ||
10722 | (define-gl-procedure | |
bb894c9d AW |
10723 | ((glMapGrid1d |
10724 | (un GLint) | |
10725 | (u1 GLdouble) | |
10726 | (u2 GLdouble) | |
10727 | -> | |
10728 | void) | |
10729 | (glMapGrid2d | |
10730 | (un GLint) | |
10731 | (u1 GLdouble) | |
10732 | (u2 GLdouble) | |
10733 | (vn GLint) | |
10734 | (v1 GLdouble) | |
10735 | (v2 GLdouble) | |
10736 | -> | |
10737 | void)) | |
3c9b6116 AW |
10738 | "Define a one- or two-dimensional mesh. |
10739 | ||
10740 | UN | |
10741 | Specifies the number of partitions in the grid range interval [U1, | |
10742 | U2]. Must be positive. | |
10743 | ||
10744 | U1 | |
10745 | U2 | |
10746 | ||
10747 | Specify the mappings for integer grid domain values I=0 and I=UN . | |
10748 | ||
10749 | VN | |
10750 | Specifies the number of partitions in the grid range interval [V1, | |
10751 | V2] (`glMapGrid2' only). | |
10752 | ||
10753 | V1 | |
10754 | V2 | |
10755 | ||
10756 | Specify the mappings for integer grid domain values J=0 and J=VN | |
10757 | (`glMapGrid2' only). | |
10758 | ||
10759 | `glMapGrid' and `glEvalMesh' are used together to efficiently generate | |
10760 | and evaluate a series of evenly-spaced map domain values. `glEvalMesh' | |
10761 | steps through the integer domain of a one- or two-dimensional grid, | |
10762 | whose range is the domain of the evaluation maps specified by `glMap1' | |
10763 | and `glMap2'. | |
10764 | ||
10765 | `glMapGrid1' and `glMapGrid2' specify the linear grid mappings between | |
10766 | the I (or I and J ) integer grid coordinates, to the U (or U and V ) | |
10767 | floating-point evaluation map coordinates. See `glMap1' and `glMap2' for | |
10768 | details of how U and V coordinates are evaluated. | |
10769 | ||
10770 | `glMapGrid1' specifies a single linear mapping such that integer grid | |
10771 | coordinate 0 maps exactly to U1, and integer grid coordinate UN maps | |
10772 | exactly to U2. All other integer grid coordinates I are mapped so that | |
10773 | ||
10774 | U=I\u2061(U2-U1,)/UN+U1 | |
10775 | ||
10776 | `glMapGrid2' specifies two such linear mappings. One maps integer grid | |
10777 | coordinate I=0 exactly to U1, and integer grid coordinate I=UN exactly | |
10778 | to U2. The other maps integer grid coordinate J=0 exactly to V1, and | |
10779 | integer grid coordinate J=VN exactly to V2. Other integer grid | |
10780 | coordinates I and J are mapped such that | |
10781 | ||
10782 | U=I\u2061(U2-U1,)/UN+U1 | |
10783 | ||
10784 | V=J\u2061(V2-V1,)/VN+V1 | |
10785 | ||
10786 | The mappings specified by `glMapGrid' are used identically by | |
10787 | `glEvalMesh' and `glEvalPoint'. | |
10788 | ||
10789 | `GL_INVALID_VALUE' is generated if either UN or VN is not positive. | |
10790 | ||
10791 | `GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between | |
10792 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
10793 | ||
10794 | (define-gl-procedure | |
bb894c9d AW |
10795 | ((glMaterialf |
10796 | (face GLenum) | |
10797 | (pname GLenum) | |
10798 | (param GLfloat) | |
10799 | -> | |
10800 | void) | |
10801 | (glMateriali | |
10802 | (face GLenum) | |
10803 | (pname GLenum) | |
10804 | (param GLint) | |
10805 | -> | |
10806 | void)) | |
3c9b6116 AW |
10807 | "Specify material parameters for the lighting model. |
10808 | ||
10809 | FACE | |
10810 | Specifies which face or faces are being updated. Must be one of | |
10811 | `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'. | |
10812 | ||
10813 | PNAME | |
10814 | Specifies the single-valued material parameter of the face or faces | |
10815 | that is being updated. Must be `GL_SHININESS'. | |
10816 | ||
10817 | PARAM | |
10818 | Specifies the value that parameter `GL_SHININESS' will be set to. | |
10819 | ||
10820 | `glMaterial' assigns values to material parameters. There are two | |
10821 | matched sets of material parameters. One, the FRONT-FACING set, is used | |
10822 | to shade points, lines, bitmaps, and all polygons (when two-sided | |
10823 | lighting is disabled), or just front-facing polygons (when two-sided | |
10824 | lighting is enabled). The other set, BACK-FACING, is used to shade | |
10825 | back-facing polygons only when two-sided lighting is enabled. Refer to | |
10826 | the `glLightModel' reference page for details concerning one- and | |
10827 | two-sided lighting calculations. | |
10828 | ||
10829 | `glMaterial' takes three arguments. The first, FACE, specifies whether | |
10830 | the `GL_FRONT' materials, the `GL_BACK' materials, or both | |
10831 | `GL_FRONT_AND_BACK' materials will be modified. The second, PNAME, | |
10832 | specifies which of several parameters in one or both sets will be | |
10833 | modified. The third, PARAMS, specifies what value or values will be | |
10834 | assigned to the specified parameter. | |
10835 | ||
10836 | Material parameters are used in the lighting equation that is optionally | |
10837 | applied to each vertex. The equation is discussed in the `glLightModel' | |
10838 | reference page. The parameters that can be specified using `glMaterial', | |
10839 | and their interpretations by the lighting equation, are as follows: | |
10840 | ||
10841 | `GL_AMBIENT' | |
10842 | PARAMS contains four integer or floating-point values that specify | |
10843 | the ambient RGBA reflectance of the material. Integer values are | |
10844 | mapped linearly such that the most positive representable value | |
10845 | maps to 1.0, and the most negative representable value maps to -1.0 | |
10846 | . Floating-point values are mapped directly. Neither integer nor | |
10847 | floating-point values are clamped. The initial ambient reflectance | |
10848 | for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0). | |
10849 | ||
10850 | `GL_DIFFUSE' | |
10851 | PARAMS contains four integer or floating-point values that specify | |
10852 | the diffuse RGBA reflectance of the material. Integer values are | |
10853 | mapped linearly such that the most positive representable value | |
10854 | maps to 1.0, and the most negative representable value maps to -1.0 | |
10855 | . Floating-point values are mapped directly. Neither integer nor | |
10856 | floating-point values are clamped. The initial diffuse reflectance | |
10857 | for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0). | |
10858 | ||
10859 | `GL_SPECULAR' | |
10860 | PARAMS contains four integer or floating-point values that specify | |
10861 | the specular RGBA reflectance of the material. Integer values are | |
10862 | mapped linearly such that the most positive representable value | |
10863 | maps to 1.0, and the most negative representable value maps to -1.0 | |
10864 | . Floating-point values are mapped directly. Neither integer nor | |
10865 | floating-point values are clamped. The initial specular reflectance | |
10866 | for both front- and back-facing materials is (0, 0, 0, 1). | |
10867 | ||
10868 | `GL_EMISSION' | |
10869 | PARAMS contains four integer or floating-point values that specify | |
10870 | the RGBA emitted light intensity of the material. Integer values | |
10871 | are mapped linearly such that the most positive representable value | |
10872 | maps to 1.0, and the most negative representable value maps to -1.0 | |
10873 | . Floating-point values are mapped directly. Neither integer nor | |
10874 | floating-point values are clamped. The initial emission intensity | |
10875 | for both front- and back-facing materials is (0, 0, 0, 1). | |
10876 | ||
10877 | `GL_SHININESS' | |
10878 | PARAMS is a single integer or floating-point value that specifies | |
10879 | the RGBA specular exponent of the material. Integer and | |
10880 | floating-point values are mapped directly. Only values in the range | |
10881 | [0,128] are accepted. The initial specular exponent for both front- | |
10882 | and back-facing materials is 0. | |
10883 | ||
10884 | `GL_AMBIENT_AND_DIFFUSE' | |
10885 | Equivalent to calling `glMaterial' twice with the same parameter | |
10886 | values, once with `GL_AMBIENT' and once with `GL_DIFFUSE'. | |
10887 | ||
10888 | `GL_COLOR_INDEXES' | |
10889 | PARAMS contains three integer or floating-point values specifying | |
10890 | the color indices for ambient, diffuse, and specular lighting. | |
10891 | These three values, and `GL_SHININESS', are the only material | |
10892 | values used by the color index mode lighting equation. Refer to the | |
10893 | `glLightModel' reference page for a discussion of color index | |
10894 | lighting. | |
10895 | ||
10896 | `GL_INVALID_ENUM' is generated if either FACE or PNAME is not an | |
10897 | accepted value. | |
10898 | ||
10899 | `GL_INVALID_VALUE' is generated if a specular exponent outside the range | |
10900 | [0,128] is specified.") | |
10901 | ||
10902 | (define-gl-procedure | |
bb894c9d | 10903 | ((glMatrixMode (mode GLenum) -> void)) |
3c9b6116 AW |
10904 | "Specify which matrix is the current matrix. |
10905 | ||
10906 | MODE | |
10907 | Specifies which matrix stack is the target for subsequent matrix | |
10908 | operations. Three values are accepted: `GL_MODELVIEW', | |
10909 | `GL_PROJECTION', and `GL_TEXTURE'. The initial value is | |
10910 | `GL_MODELVIEW'. Additionally, if the `ARB_imaging' extension is | |
10911 | supported, `GL_COLOR' is also accepted. | |
10912 | ||
10913 | `glMatrixMode' sets the current matrix mode. MODE can assume one of four | |
10914 | values: | |
10915 | ||
10916 | `GL_MODELVIEW' | |
10917 | Applies subsequent matrix operations to the modelview matrix stack. | |
10918 | ||
10919 | `GL_PROJECTION' | |
10920 | Applies subsequent matrix operations to the projection matrix | |
10921 | stack. | |
10922 | ||
10923 | `GL_TEXTURE' | |
10924 | Applies subsequent matrix operations to the texture matrix stack. | |
10925 | ||
10926 | `GL_COLOR' | |
10927 | Applies subsequent matrix operations to the color matrix stack. | |
10928 | ||
10929 | To find out which matrix stack is currently the target of all matrix | |
10930 | operations, call `glGet' with argument `GL_MATRIX_MODE'. The initial | |
10931 | value is `GL_MODELVIEW'. | |
10932 | ||
10933 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
10934 | ||
10935 | `GL_INVALID_OPERATION' is generated if `glMatrixMode' is executed | |
10936 | between the execution of `glBegin' and the corresponding execution of | |
10937 | `glEnd'.") | |
10938 | ||
10939 | (define-gl-procedure | |
bb894c9d AW |
10940 | ((glMinmax |
10941 | (target GLenum) | |
10942 | (internalformat GLenum) | |
10943 | (sink GLboolean) | |
10944 | -> | |
10945 | void)) | |
3c9b6116 AW |
10946 | "Define minmax table. |
10947 | ||
10948 | TARGET | |
10949 | The minmax table whose parameters are to be set. Must be | |
10950 | `GL_MINMAX'. | |
10951 | ||
10952 | INTERNALFORMAT | |
10953 | The format of entries in the minmax table. Must be one of | |
10954 | `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', | |
10955 | `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12', | |
10956 | `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
10957 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
10958 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
10959 | `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', | |
10960 | `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', | |
10961 | `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', | |
10962 | `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'. | |
10963 | ||
10964 | SINK | |
10965 | If `GL_TRUE', pixels will be consumed by the minmax process and no | |
10966 | drawing or texture loading will take place. If `GL_FALSE', pixels | |
10967 | will proceed to the final conversion process after minmax. | |
10968 | ||
10969 | When `GL_MINMAX' is enabled, the RGBA components of incoming pixels are | |
10970 | compared to the minimum and maximum values for each component, which are | |
10971 | stored in the two-element minmax table. (The first element stores the | |
10972 | minima, and the second element stores the maxima.) If a pixel component | |
10973 | is greater than the corresponding component in the maximum element, then | |
10974 | the maximum element is updated with the pixel component value. If a | |
10975 | pixel component is less than the corresponding component in the minimum | |
10976 | element, then the minimum element is updated with the pixel component | |
10977 | value. (In both cases, if the internal format of the minmax table | |
10978 | includes luminance, then the R color component of incoming pixels is | |
10979 | used for comparison.) The contents of the minmax table may be retrieved | |
10980 | at a later time by calling `glGetMinmax'. The minmax operation is | |
10981 | enabled or disabled by calling `glEnable' or `glDisable', respectively, | |
10982 | with an argument of `GL_MINMAX'. | |
10983 | ||
10984 | `glMinmax' redefines the current minmax table to have entries of the | |
10985 | format specified by INTERNALFORMAT. The maximum element is initialized | |
10986 | with the smallest possible component values, and the minimum element is | |
10987 | initialized with the largest possible component values. The values in | |
10988 | the previous minmax table, if any, are lost. If SINK is `GL_TRUE', then | |
10989 | pixels are discarded after minmax; no further processing of the pixels | |
10990 | takes place, and no drawing, texture loading, or pixel readback will | |
10991 | result. | |
10992 | ||
10993 | ||
10994 | ||
10995 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
10996 | values. | |
10997 | ||
10998 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the | |
10999 | allowable values. | |
11000 | ||
11001 | `GL_INVALID_OPERATION' is generated if `glMinmax' is executed between | |
11002 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
11003 | ||
11004 | (define-gl-procedure | |
bb894c9d AW |
11005 | ((glMultiDrawArrays |
11006 | (mode GLenum) | |
11007 | (first *) | |
11008 | (count *) | |
11009 | (primcount GLsizei) | |
11010 | -> | |
11011 | void)) | |
3c9b6116 AW |
11012 | "Render multiple sets of primitives from array data. |
11013 | ||
11014 | MODE | |
11015 | Specifies what kind of primitives to render. Symbolic constants | |
11016 | `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES', | |
11017 | `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES', | |
11018 | `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted. | |
11019 | ||
11020 | FIRST | |
11021 | Points to an array of starting indices in the enabled arrays. | |
11022 | ||
11023 | COUNT | |
11024 | Points to an array of the number of indices to be rendered. | |
11025 | ||
11026 | PRIMCOUNT | |
11027 | Specifies the size of the first and count | |
11028 | ||
11029 | `glMultiDrawArrays' specifies multiple sets of geometric primitives with | |
11030 | very few subroutine calls. Instead of calling a GL procedure to pass | |
11031 | each individual vertex, normal, texture coordinate, edge flag, or color, | |
11032 | you can prespecify separate arrays of vertices, normals, and colors and | |
11033 | use them to construct a sequence of primitives with a single call to | |
11034 | `glMultiDrawArrays'. | |
11035 | ||
11036 | `glMultiDrawArrays' behaves identically to `glDrawArrays' except that | |
11037 | PRIMCOUNT separate ranges of elements are specified instead. | |
11038 | ||
11039 | When `glMultiDrawArrays' is called, it uses COUNT sequential elements | |
11040 | from each enabled array to construct a sequence of geometric primitives, | |
11041 | beginning with element FIRST. MODE specifies what kind of primitives are | |
11042 | constructed, and how the array elements construct those primitives. If | |
11043 | `GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated. | |
11044 | ||
11045 | Vertex attributes that are modified by `glMultiDrawArrays' have an | |
11046 | unspecified value after `glMultiDrawArrays' returns. For example, if | |
11047 | `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined | |
11048 | after `glMultiDrawArrays' executes. Attributes that aren't modified | |
11049 | remain well defined. | |
11050 | ||
11051 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
11052 | ||
11053 | `GL_INVALID_VALUE' is generated if PRIMCOUNT is negative. | |
11054 | ||
11055 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
11056 | bound to an enabled array and the buffer object's data store is | |
11057 | currently mapped. | |
11058 | ||
11059 | `GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed | |
11060 | between the execution of `glBegin' and the corresponding `glEnd'.") | |
11061 | ||
11062 | (define-gl-procedure | |
bb894c9d AW |
11063 | ((glMultiDrawElements |
11064 | (mode GLenum) | |
11065 | (count *) | |
11066 | (type GLenum) | |
11067 | (indices *) | |
11068 | (primcount GLsizei) | |
11069 | -> | |
11070 | void)) | |
3c9b6116 AW |
11071 | "Render multiple sets of primitives by specifying indices of array data |
11072 | elements. | |
11073 | ||
11074 | MODE | |
11075 | Specifies what kind of primitives to render. Symbolic constants | |
11076 | `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES', | |
11077 | `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES', | |
11078 | `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted. | |
11079 | ||
11080 | COUNT | |
11081 | Points to an array of the elements counts. | |
11082 | ||
11083 | TYPE | |
11084 | Specifies the type of the values in INDICES. Must be one of | |
11085 | `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'. | |
11086 | ||
11087 | INDICES | |
11088 | Specifies a pointer to the location where the indices are stored. | |
11089 | ||
11090 | PRIMCOUNT | |
11091 | Specifies the size of the COUNT array. | |
11092 | ||
11093 | `glMultiDrawElements' specifies multiple sets of geometric primitives | |
11094 | with very few subroutine calls. Instead of calling a GL function to pass | |
11095 | each individual vertex, normal, texture coordinate, edge flag, or color, | |
11096 | you can prespecify separate arrays of vertices, normals, and so on, and | |
11097 | use them to construct a sequence of primitives with a single call to | |
11098 | `glMultiDrawElements'. | |
11099 | ||
11100 | `glMultiDrawElements' is identical in operation to `glDrawElements' | |
11101 | except that PRIMCOUNT separate lists of elements are specified. | |
11102 | ||
11103 | Vertex attributes that are modified by `glMultiDrawElements' have an | |
11104 | unspecified value after `glMultiDrawElements' returns. For example, if | |
11105 | `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined | |
11106 | after `glMultiDrawElements' executes. Attributes that aren't modified | |
11107 | maintain their previous values. | |
11108 | ||
11109 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
11110 | ||
11111 | `GL_INVALID_VALUE' is generated if PRIMCOUNT is negative. | |
11112 | ||
11113 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
11114 | bound to an enabled array or the element array and the buffer object's | |
11115 | data store is currently mapped. | |
11116 | ||
11117 | `GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed | |
11118 | between the execution of `glBegin' and the corresponding `glEnd'.") | |
11119 | ||
11120 | (define-gl-procedure | |
bb894c9d AW |
11121 | ((glMultiTexCoord1i |
11122 | (target GLenum) | |
11123 | (s GLint) | |
11124 | -> | |
11125 | void) | |
11126 | (glMultiTexCoord1d | |
11127 | (target GLenum) | |
11128 | (s GLdouble) | |
11129 | -> | |
11130 | void) | |
11131 | (glMultiTexCoord2i | |
11132 | (target GLenum) | |
11133 | (s GLint) | |
11134 | (t GLint) | |
11135 | -> | |
11136 | void) | |
11137 | (glMultiTexCoord2d | |
11138 | (target GLenum) | |
11139 | (s GLdouble) | |
11140 | (t GLdouble) | |
11141 | -> | |
11142 | void) | |
11143 | (glMultiTexCoord3i | |
11144 | (target GLenum) | |
11145 | (s GLint) | |
11146 | (t GLint) | |
11147 | (r GLint) | |
11148 | -> | |
11149 | void) | |
11150 | (glMultiTexCoord3d | |
11151 | (target GLenum) | |
11152 | (s GLdouble) | |
11153 | (t GLdouble) | |
11154 | (r GLdouble) | |
11155 | -> | |
11156 | void) | |
11157 | (glMultiTexCoord4i | |
11158 | (target GLenum) | |
11159 | (s GLint) | |
11160 | (t GLint) | |
11161 | (r GLint) | |
11162 | (q GLint) | |
11163 | -> | |
11164 | void) | |
11165 | (glMultiTexCoord4d | |
11166 | (target GLenum) | |
11167 | (s GLdouble) | |
11168 | (t GLdouble) | |
11169 | (r GLdouble) | |
11170 | (q GLdouble) | |
11171 | -> | |
11172 | void)) | |
3c9b6116 AW |
11173 | "Set the current texture coordinates. |
11174 | ||
11175 | TARGET | |
11176 | Specifies the texture unit whose coordinates should be modified. | |
11177 | The number of texture units is implementation dependent, but must | |
11178 | be at least two. Symbolic constant must be one of `GL_TEXTURE' I , | |
11179 | where i ranges from 0 to `GL_MAX_TEXTURE_COORDS' - 1, which is an | |
11180 | implementation-dependent value. | |
11181 | ||
11182 | S | |
11183 | T | |
11184 | ||
11185 | R | |
11186 | ||
11187 | Q | |
11188 | ||
11189 | Specify S, T, R, and Q texture coordinates for TARGET texture unit. | |
11190 | Not all parameters are present in all forms of the command. | |
11191 | ||
11192 | `glMultiTexCoord' specifies texture coordinates in one, two, three, or | |
11193 | four dimensions. `glMultiTexCoord1' sets the current texture coordinates | |
11194 | to (S,001) ; a call to `glMultiTexCoord2' sets them to (S,T01) . | |
11195 | Similarly, `glMultiTexCoord3' specifies the texture coordinates as | |
11196 | (S,TR1) , and `glMultiTexCoord4' defines all four components explicitly | |
11197 | as (S,TRQ) . | |
11198 | ||
11199 | The current texture coordinates are part of the data that is associated | |
11200 | with each vertex and with the current raster position. Initially, the | |
11201 | values for (S,TRQ) are (0,001) .") | |
11202 | ||
11203 | (define-gl-procedure | |
bb894c9d | 11204 | ((glMultMatrixd (m *) -> void)) |
3c9b6116 AW |
11205 | "Multiply the current matrix with the specified matrix. |
11206 | ||
11207 | M | |
11208 | Points to 16 consecutive values that are used as the elements of a | |
11209 | 4×4 column-major matrix. | |
11210 | ||
11211 | `glMultMatrix' multiplies the current matrix with the one specified | |
11212 | using M, and replaces the current matrix with the product. | |
11213 | ||
11214 | The current matrix is determined by the current matrix mode (see | |
11215 | `glMatrixMode'). It is either the projection matrix, modelview matrix, | |
11216 | or the texture matrix. | |
11217 | ||
11218 | `GL_INVALID_OPERATION' is generated if `glMultMatrix' is executed | |
11219 | between the execution of `glBegin' and the corresponding execution of | |
11220 | `glEnd'.") | |
11221 | ||
11222 | (define-gl-procedure | |
bb894c9d | 11223 | ((glMultTransposeMatrixd (m *) -> void)) |
3c9b6116 AW |
11224 | "Multiply the current matrix with the specified row-major ordered matrix. |
11225 | ||
11226 | M | |
11227 | Points to 16 consecutive values that are used as the elements of a | |
11228 | 4×4 row-major matrix. | |
11229 | ||
11230 | `glMultTransposeMatrix' multiplies the current matrix with the one | |
11231 | specified using M, and replaces the current matrix with the product. | |
11232 | ||
11233 | The current matrix is determined by the current matrix mode (see | |
11234 | `glMatrixMode'). It is either the projection matrix, modelview matrix, | |
11235 | or the texture matrix. | |
11236 | ||
11237 | `GL_INVALID_OPERATION' is generated if `glMultTransposeMatrix' is | |
11238 | executed between the execution of `glBegin' and the corresponding | |
11239 | execution of `glEnd'.") | |
11240 | ||
11241 | (define-gl-procedure | |
bb894c9d AW |
11242 | ((glNewList (list GLuint) (mode GLenum) -> void) |
11243 | (glEndList -> void)) | |
3c9b6116 AW |
11244 | "Create or replace a display list. |
11245 | ||
11246 | LIST | |
11247 | Specifies the display-list name. | |
11248 | ||
11249 | MODE | |
11250 | Specifies the compilation mode, which can be `GL_COMPILE' or | |
11251 | `GL_COMPILE_AND_EXECUTE'. | |
11252 | ||
11253 | Display lists are groups of GL commands that have been stored for | |
11254 | subsequent execution. Display lists are created with `glNewList'. All | |
11255 | subsequent commands are placed in the display list, in the order issued, | |
11256 | until `glEndList' is called. | |
11257 | ||
11258 | `glNewList' has two arguments. The first argument, LIST, is a positive | |
11259 | integer that becomes the unique name for the display list. Names can be | |
11260 | created and reserved with `glGenLists' and tested for uniqueness with | |
11261 | `glIsList'. The second argument, MODE, is a symbolic constant that can | |
11262 | assume one of two values: | |
11263 | ||
11264 | `GL_COMPILE' | |
11265 | Commands are merely compiled. | |
11266 | ||
11267 | `GL_COMPILE_AND_EXECUTE' | |
11268 | Commands are executed as they are compiled into the display list. | |
11269 | ||
11270 | Certain commands are not compiled into the display list but are executed | |
11271 | immediately, regardless of the display-list mode. These commands are | |
11272 | `glAreTexturesResident', `glColorPointer', `glDeleteLists', | |
11273 | `glDeleteTextures', `glDisableClientState', `glEdgeFlagPointer', | |
11274 | `glEnableClientState', `glFeedbackBuffer', `glFinish', `glFlush', | |
11275 | `glGenLists', `glGenTextures', `glIndexPointer', `glInterleavedArrays', | |
11276 | `glIsEnabled', `glIsList', `glIsTexture', `glNormalPointer', | |
11277 | `glPopClientAttrib', `glPixelStore', `glPushClientAttrib', | |
11278 | `glReadPixels', `glRenderMode', `glSelectBuffer', `glTexCoordPointer', | |
11279 | `glVertexPointer', and all of the `glGet' commands. | |
11280 | ||
11281 | Similarly, `glTexImage1D', `glTexImage2D', and `glTexImage3D' are | |
11282 | executed immediately and not compiled into the display list when their | |
11283 | first argument is `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_1D', or | |
11284 | `GL_PROXY_TEXTURE_3D', respectively. | |
11285 | ||
11286 | When the `ARB_imaging' extension is supported, `glHistogram' executes | |
11287 | immediately when its argument is `GL_PROXY_HISTOGRAM'. Similarly, | |
11288 | `glColorTable' executes immediately when its first argument is | |
11289 | `GL_PROXY_COLOR_TABLE', `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or | |
11290 | `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'. | |
11291 | ||
11292 | For OpenGL versions 1.3 and greater, or when the `ARB_multitexture' | |
11293 | extension is supported, `glClientActiveTexture' is not compiled into | |
11294 | display lists, but executed immediately. | |
11295 | ||
11296 | When `glEndList' is encountered, the display-list definition is | |
11297 | completed by associating the list with the unique name LIST (specified | |
11298 | in the `glNewList' command). If a display list with name LIST already | |
11299 | exists, it is replaced only when `glEndList' is called. | |
11300 | ||
11301 | `GL_INVALID_VALUE' is generated if LIST is 0. | |
11302 | ||
11303 | `GL_INVALID_ENUM' is generated if MODE is not an accepted value. | |
11304 | ||
11305 | `GL_INVALID_OPERATION' is generated if `glEndList' is called without a | |
11306 | preceding `glNewList', or if `glNewList' is called while a display list | |
11307 | is being defined. | |
11308 | ||
11309 | `GL_INVALID_OPERATION' is generated if `glNewList' or `glEndList' is | |
11310 | executed between the execution of `glBegin' and the corresponding | |
11311 | execution of `glEnd'. | |
11312 | ||
11313 | `GL_OUT_OF_MEMORY' is generated if there is insufficient memory to | |
11314 | compile the display list. If the GL version is 1.1 or greater, no change | |
11315 | is made to the previous contents of the display list, if any, and no | |
11316 | other change is made to the GL state. (It is as if no attempt had been | |
11317 | made to create the new display list.)") | |
11318 | ||
11319 | (define-gl-procedure | |
bb894c9d AW |
11320 | ((glNormalPointer |
11321 | (type GLenum) | |
11322 | (stride GLsizei) | |
11323 | (pointer *) | |
11324 | -> | |
11325 | void)) | |
3c9b6116 AW |
11326 | "Define an array of normals. |
11327 | ||
11328 | TYPE | |
11329 | Specifies the data type of each coordinate in the array. Symbolic | |
11330 | constants `GL_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and | |
11331 | `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'. | |
11332 | ||
11333 | STRIDE | |
11334 | Specifies the byte offset between consecutive normals. If STRIDE is | |
11335 | 0, the normals are understood to be tightly packed in the array. | |
11336 | The initial value is 0. | |
11337 | ||
11338 | POINTER | |
11339 | Specifies a pointer to the first coordinate of the first normal in | |
11340 | the array. The initial value is 0. | |
11341 | ||
11342 | `glNormalPointer' specifies the location and data format of an array of | |
11343 | normals to use when rendering. TYPE specifies the data type of each | |
11344 | normal coordinate, and STRIDE specifies the byte stride from one normal | |
11345 | to the next, allowing vertices and attributes to be packed into a single | |
11346 | array or stored in separate arrays. (Single-array storage may be more | |
11347 | efficient on some implementations; see `glInterleavedArrays'.) | |
11348 | ||
11349 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' | |
11350 | target (see `glBindBuffer') while a normal array is specified, POINTER | |
11351 | is treated as a byte offset into the buffer object's data store. Also, | |
11352 | the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as normal | |
11353 | vertex array client-side state (`GL_NORMAL_ARRAY_BUFFER_BINDING'). | |
11354 | ||
11355 | When a normal array is specified, TYPE, STRIDE, and POINTER are saved as | |
11356 | client-side state, in addition to the current vertex array buffer object | |
11357 | binding. | |
11358 | ||
11359 | To enable and disable the normal array, call `glEnableClientState' and | |
11360 | `glDisableClientState' with the argument `GL_NORMAL_ARRAY'. If enabled, | |
11361 | the normal array is used when `glDrawArrays', `glMultiDrawArrays', | |
11362 | `glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or | |
11363 | `glArrayElement' is called. | |
11364 | ||
11365 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
11366 | ||
11367 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
11368 | ||
11369 | (define-gl-procedure | |
bb894c9d AW |
11370 | ((glNormal3d |
11371 | (nx GLdouble) | |
11372 | (ny GLdouble) | |
11373 | (nz GLdouble) | |
11374 | -> | |
11375 | void) | |
11376 | (glNormal3i | |
11377 | (nx GLint) | |
11378 | (ny GLint) | |
11379 | (nz GLint) | |
11380 | -> | |
11381 | void)) | |
3c9b6116 AW |
11382 | "Set the current normal vector. |
11383 | ||
11384 | NX | |
11385 | NY | |
11386 | ||
11387 | NZ | |
11388 | ||
11389 | Specify the X , Y , and Z coordinates of the new current normal. | |
11390 | The initial value of the current normal is the unit vector, (0, 0, | |
11391 | 1). | |
11392 | ||
11393 | ||
11394 | ||
11395 | The current normal is set to the given coordinates whenever `glNormal' | |
11396 | is issued. Byte, short, or integer arguments are converted to | |
11397 | floating-point format with a linear mapping that maps the most positive | |
11398 | representable integer value to 1.0 and the most negative representable | |
11399 | integer value to -1.0 . | |
11400 | ||
11401 | Normals specified with `glNormal' need not have unit length. If | |
11402 | `GL_NORMALIZE' is enabled, then normals of any length specified with | |
11403 | `glNormal' are normalized after transformation. If `GL_RESCALE_NORMAL' | |
11404 | is enabled, normals are scaled by a scaling factor derived from the | |
11405 | modelview matrix. `GL_RESCALE_NORMAL' requires that the originally | |
11406 | specified normals were of unit length, and that the modelview matrix | |
11407 | contain only uniform scales for proper results. To enable and disable | |
11408 | normalization, call `glEnable' and `glDisable' with either | |
11409 | `GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially | |
11410 | disabled.") | |
11411 | ||
11412 | (define-gl-procedure | |
bb894c9d AW |
11413 | ((glOrtho |
11414 | (left GLdouble) | |
11415 | (right GLdouble) | |
11416 | (bottom GLdouble) | |
11417 | (top GLdouble) | |
11418 | (nearVal GLdouble) | |
11419 | (farVal GLdouble) | |
11420 | -> | |
11421 | void)) | |
3c9b6116 AW |
11422 | "Multiply the current matrix with an orthographic matrix. |
11423 | ||
11424 | LEFT | |
11425 | RIGHT | |
11426 | ||
11427 | Specify the coordinates for the left and right vertical clipping | |
11428 | planes. | |
11429 | ||
11430 | BOTTOM | |
11431 | TOP | |
11432 | ||
11433 | Specify the coordinates for the bottom and top horizontal clipping | |
11434 | planes. | |
11435 | ||
11436 | NEARVAL | |
11437 | FARVAL | |
11438 | ||
11439 | Specify the distances to the nearer and farther depth clipping | |
11440 | planes. These values are negative if the plane is to be behind the | |
11441 | viewer. | |
11442 | ||
11443 | `glOrtho' describes a transformation that produces a parallel | |
11444 | projection. The current matrix (see `glMatrixMode') is multiplied by | |
11445 | this matrix and the result replaces the current matrix, as if | |
11446 | `glMultMatrix' were called with the following matrix as its argument: | |
11447 | ||
11448 | ((2/RIGHT-LEFT,, 0 0 T_X,), (0 2/TOP-BOTTOM,, 0 T_Y,), (0 0 | |
11449 | -2/FARVAL-NEARVAL,, T_Z,), (0 0 0 1),) | |
11450 | ||
11451 | where T_X=-RIGHT+LEFT,/RIGHT-LEFT,, T_Y=-TOP+BOTTOM,/TOP-BOTTOM,, | |
11452 | T_Z=-FARVAL+NEARVAL,/FARVAL-NEARVAL,, | |
11453 | ||
11454 | Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL) | |
11455 | and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane | |
11456 | that are mapped to the lower left and upper right corners of the window, | |
11457 | respectively, assuming that the eye is located at (0, 0, 0). -FARVAL | |
11458 | specifies the location of the far clipping plane. Both NEARVAL and | |
11459 | FARVAL can be either positive or negative. | |
11460 | ||
11461 | Use `glPushMatrix' and `glPopMatrix' to save and restore the current | |
11462 | matrix stack. | |
11463 | ||
11464 | `GL_INVALID_VALUE' is generated if LEFT = RIGHT, or BOTTOM = TOP, or | |
11465 | NEAR = FAR. | |
11466 | ||
11467 | `GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the | |
11468 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
11469 | ||
11470 | (define-gl-procedure | |
bb894c9d | 11471 | ((glPassThrough (token GLfloat) -> void)) |
3c9b6116 AW |
11472 | "Place a marker in the feedback buffer. |
11473 | ||
11474 | TOKEN | |
11475 | Specifies a marker value to be placed in the feedback buffer | |
11476 | following a `GL_PASS_THROUGH_TOKEN'. | |
11477 | ||
11478 | ||
11479 | ||
11480 | Feedback is a GL render mode. The mode is selected by calling | |
11481 | `glRenderMode' with `GL_FEEDBACK'. When the GL is in feedback mode, no | |
11482 | pixels are produced by rasterization. Instead, information about | |
11483 | primitives that would have been rasterized is fed back to the | |
11484 | application using the GL. See the `glFeedbackBuffer' reference page for | |
11485 | a description of the feedback buffer and the values in it. | |
11486 | ||
11487 | `glPassThrough' inserts a user-defined marker in the feedback buffer | |
11488 | when it is executed in feedback mode. TOKEN is returned as if it were a | |
11489 | primitive; it is indicated with its own unique identifying value: | |
11490 | `GL_PASS_THROUGH_TOKEN'. The order of `glPassThrough' commands with | |
11491 | respect to the specification of graphics primitives is maintained. | |
11492 | ||
11493 | `GL_INVALID_OPERATION' is generated if `glPassThrough' is executed | |
11494 | between the execution of `glBegin' and the corresponding execution of | |
11495 | `glEnd'.") | |
11496 | ||
11497 | (define-gl-procedure | |
bb894c9d AW |
11498 | ((glPixelStoref |
11499 | (pname GLenum) | |
11500 | (param GLfloat) | |
11501 | -> | |
11502 | void) | |
11503 | (glPixelStorei | |
11504 | (pname GLenum) | |
11505 | (param GLint) | |
11506 | -> | |
11507 | void)) | |
3c9b6116 AW |
11508 | "Set pixel storage modes. |
11509 | ||
11510 | PNAME | |
11511 | Specifies the symbolic name of the parameter to be set. Six values | |
11512 | affect the packing of pixel data into memory: `GL_PACK_SWAP_BYTES', | |
11513 | `GL_PACK_LSB_FIRST', `GL_PACK_ROW_LENGTH', `GL_PACK_IMAGE_HEIGHT', | |
11514 | `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', `GL_PACK_SKIP_IMAGES', | |
11515 | and `GL_PACK_ALIGNMENT'. Six more affect the unpacking of pixel | |
11516 | data FROM memory: `GL_UNPACK_SWAP_BYTES', `GL_UNPACK_LSB_FIRST', | |
11517 | `GL_UNPACK_ROW_LENGTH', `GL_UNPACK_IMAGE_HEIGHT', | |
11518 | `GL_UNPACK_SKIP_PIXELS', `GL_UNPACK_SKIP_ROWS', | |
11519 | `GL_UNPACK_SKIP_IMAGES', and `GL_UNPACK_ALIGNMENT'. | |
11520 | ||
11521 | PARAM | |
11522 | Specifies the value that PNAME is set to. | |
11523 | ||
11524 | `glPixelStore' sets pixel storage modes that affect the operation of | |
11525 | subsequent `glDrawPixels' and `glReadPixels' as well as the unpacking of | |
11526 | polygon stipple patterns (see `glPolygonStipple'), bitmaps (see | |
11527 | `glBitmap'), texture patterns (see `glTexImage1D', `glTexImage2D', | |
11528 | `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', | |
11529 | `glTexSubImage3D'). Additionally, if the `ARB_imaging' extension is | |
11530 | supported, pixel storage modes affect convolution filters (see | |
11531 | `glConvolutionFilter1D', `glConvolutionFilter2D', and | |
11532 | `glSeparableFilter2D', color table (see `glColorTable', and | |
11533 | `glColorSubTable', and unpacking histogram (See `glHistogram'), and | |
11534 | minmax (See `glMinmax') data. | |
11535 | ||
11536 | PNAME is a symbolic constant indicating the parameter to be set, and | |
11537 | PARAM is the new value. Six of the twelve storage parameters affect how | |
11538 | pixel data is returned to client memory. They are as follows: | |
11539 | ||
11540 | `GL_PACK_SWAP_BYTES' | |
11541 | If true, byte ordering for multibyte color components, depth | |
11542 | components, color indices, or stencil indices is reversed. That is, | |
11543 | if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 , | |
11544 | it is stored in memory as B_3 , B_2 , B_1 , B_0 if | |
11545 | `GL_PACK_SWAP_BYTES' is true. `GL_PACK_SWAP_BYTES' has no effect on | |
11546 | the memory order of components within a pixel, only on the order of | |
11547 | bytes within components or indices. For example, the three | |
11548 | components of a `GL_RGB' format pixel are always stored with red | |
11549 | first, green second, and blue third, regardless of the value of | |
11550 | `GL_PACK_SWAP_BYTES'. | |
11551 | ||
11552 | `GL_PACK_LSB_FIRST' | |
11553 | If true, bits are ordered within a byte from least significant to | |
11554 | most significant; otherwise, the first bit in each byte is the most | |
11555 | significant one. This parameter is significant for bitmap data | |
11556 | only. | |
11557 | ||
11558 | `GL_PACK_ROW_LENGTH' | |
11559 | If greater than 0, `GL_PACK_ROW_LENGTH' defines the number of | |
11560 | pixels in a row. If the first pixel of a row is placed at location | |
11561 | P in memory, then the location of the first pixel of the next row | |
11562 | is obtained by skipping | |
11563 | ||
11564 | K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A), | |
11565 | ||
11566 | components or indices, where N is the number of components or | |
11567 | indices in a pixel, L is the number of pixels in a row | |
11568 | (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument | |
11569 | to the pixel routine otherwise), A is the value of | |
11570 | `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single | |
11571 | component (if A<S , then it is as if A=S ). In the case of 1-bit | |
11572 | values, the location of the next row is obtained by skipping | |
11573 | ||
11574 | K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉ | |
11575 | ||
11576 | components or indices. | |
11577 | ||
11578 | The word COMPONENT in this description refers to the nonindex | |
11579 | values red, green, blue, alpha, and depth. Storage format `GL_RGB', | |
11580 | for example, has three components per pixel: first red, then green, | |
11581 | and finally blue. | |
11582 | ||
11583 | `GL_PACK_IMAGE_HEIGHT' | |
11584 | If greater than 0, `GL_PACK_IMAGE_HEIGHT' defines the number of | |
11585 | pixels in an image three-dimensional texture volume, where | |
11586 | ``image'' is defined by all pixels sharing the same third dimension | |
11587 | index. If the first pixel of a row is placed at location P in | |
11588 | memory, then the location of the first pixel of the next row is | |
11589 | obtained by skipping | |
11590 | ||
11591 | K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A), | |
11592 | ||
11593 | components or indices, where N is the number of components or | |
11594 | indices in a pixel, L is the number of pixels in a row | |
11595 | (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument | |
11596 | to `glTexImage3D' otherwise), H is the number of rows in a pixel | |
11597 | image (`GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT | |
11598 | argument to the `glTexImage3D' routine otherwise), A is the value | |
11599 | of `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single | |
11600 | component (if A<S , then it is as if A=S ). | |
11601 | ||
11602 | The word COMPONENT in this description refers to the nonindex | |
11603 | values red, green, blue, alpha, and depth. Storage format `GL_RGB', | |
11604 | for example, has three components per pixel: first red, then green, | |
11605 | and finally blue. | |
11606 | ||
11607 | `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', and `GL_PACK_SKIP_IMAGES' | |
11608 | These values are provided as a convenience to the programmer; they | |
11609 | provide no functionality that cannot be duplicated simply by | |
11610 | incrementing the pointer passed to `glReadPixels'. Setting | |
11611 | `GL_PACK_SKIP_PIXELS' to I is equivalent to incrementing the | |
11612 | pointer by I\u2062N components or indices, where N is the number of | |
11613 | components or indices in each pixel. Setting `GL_PACK_SKIP_ROWS' to | |
11614 | J is equivalent to incrementing the pointer by J\u2062M components or | |
11615 | indices, where M is the number of components or indices per row, as | |
11616 | just computed in the `GL_PACK_ROW_LENGTH' section. Setting | |
11617 | `GL_PACK_SKIP_IMAGES' to K is equivalent to incrementing the | |
11618 | pointer by K\u2062P , where P is the number of components or indices per | |
11619 | image, as computed in the `GL_PACK_IMAGE_HEIGHT' section. | |
11620 | ||
11621 | `GL_PACK_ALIGNMENT' | |
11622 | Specifies the alignment requirements for the start of each pixel | |
11623 | row in memory. The allowable values are 1 (byte-alignment), 2 (rows | |
11624 | aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows | |
11625 | start on double-word boundaries). | |
11626 | ||
11627 | The other six of the twelve storage parameters affect how pixel data is | |
11628 | read from client memory. These values are significant for | |
11629 | `glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D', | |
11630 | `glTexSubImage1D', `glTexSubImage2D', `glTexSubImage3D', `glBitmap', and | |
11631 | `glPolygonStipple'. | |
11632 | ||
11633 | Additionally, if the `ARB_imaging' extension is supported, | |
11634 | `glColorTable', `glColorSubTable', `glConvolutionFilter1D', | |
11635 | `glConvolutionFilter2D', and `glSeparableFilter2D'. They are as follows: | |
11636 | ||
11637 | `GL_UNPACK_SWAP_BYTES' | |
11638 | If true, byte ordering for multibyte color components, depth | |
11639 | components, color indices, or stencil indices is reversed. That is, | |
11640 | if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 , | |
11641 | it is taken from memory as B_3 , B_2 , B_1 , B_0 if | |
11642 | `GL_UNPACK_SWAP_BYTES' is true. `GL_UNPACK_SWAP_BYTES' has no | |
11643 | effect on the memory order of components within a pixel, only on | |
11644 | the order of bytes within components or indices. For example, the | |
11645 | three components of a `GL_RGB' format pixel are always stored with | |
11646 | red first, green second, and blue third, regardless of the value of | |
11647 | `GL_UNPACK_SWAP_BYTES'. | |
11648 | ||
11649 | `GL_UNPACK_LSB_FIRST' | |
11650 | If true, bits are ordered within a byte from least significant to | |
11651 | most significant; otherwise, the first bit in each byte is the most | |
11652 | significant one. This is relevant only for bitmap data. | |
11653 | ||
11654 | `GL_UNPACK_ROW_LENGTH' | |
11655 | If greater than 0, `GL_UNPACK_ROW_LENGTH' defines the number of | |
11656 | pixels in a row. If the first pixel of a row is placed at location | |
11657 | P in memory, then the location of the first pixel of the next row | |
11658 | is obtained by skipping | |
11659 | ||
11660 | K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A), | |
11661 | ||
11662 | components or indices, where N is the number of components or | |
11663 | indices in a pixel, L is the number of pixels in a row | |
11664 | (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument | |
11665 | to the pixel routine otherwise), A is the value of | |
11666 | `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single | |
11667 | component (if A<S , then it is as if A=S ). In the case of 1-bit | |
11668 | values, the location of the next row is obtained by skipping | |
11669 | ||
11670 | K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉ | |
11671 | ||
11672 | components or indices. | |
11673 | ||
11674 | The word COMPONENT in this description refers to the nonindex | |
11675 | values red, green, blue, alpha, and depth. Storage format `GL_RGB', | |
11676 | for example, has three components per pixel: first red, then green, | |
11677 | and finally blue. | |
11678 | ||
11679 | `GL_UNPACK_IMAGE_HEIGHT' | |
11680 | If greater than 0, `GL_UNPACK_IMAGE_HEIGHT' defines the number of | |
11681 | pixels in an image of a three-dimensional texture volume. Where | |
11682 | ``image'' is defined by all pixel sharing the same third dimension | |
11683 | index. If the first pixel of a row is placed at location P in | |
11684 | memory, then the location of the first pixel of the next row is | |
11685 | obtained by skipping | |
11686 | ||
11687 | K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A), | |
11688 | ||
11689 | components or indices, where N is the number of components or | |
11690 | indices in a pixel, L is the number of pixels in a row | |
11691 | (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument | |
11692 | to `glTexImage3D' otherwise), H is the number of rows in an image | |
11693 | (`GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT | |
11694 | argument to `glTexImage3D' otherwise), A is the value of | |
11695 | `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single | |
11696 | component (if A<S , then it is as if A=S ). | |
11697 | ||
11698 | The word COMPONENT in this description refers to the nonindex | |
11699 | values red, green, blue, alpha, and depth. Storage format `GL_RGB', | |
11700 | for example, has three components per pixel: first red, then green, | |
11701 | and finally blue. | |
11702 | ||
11703 | `GL_UNPACK_SKIP_PIXELS' and `GL_UNPACK_SKIP_ROWS' | |
11704 | These values are provided as a convenience to the programmer; they | |
11705 | provide no functionality that cannot be duplicated by incrementing | |
11706 | the pointer passed to `glDrawPixels', `glTexImage1D', | |
11707 | `glTexImage2D', `glTexSubImage1D', `glTexSubImage2D', `glBitmap', | |
11708 | or `glPolygonStipple'. Setting `GL_UNPACK_SKIP_PIXELS' to I is | |
11709 | equivalent to incrementing the pointer by I\u2062N components or | |
11710 | indices, where N is the number of components or indices in each | |
11711 | pixel. Setting `GL_UNPACK_SKIP_ROWS' to J is equivalent to | |
11712 | incrementing the pointer by J\u2062K components or indices, where K is | |
11713 | the number of components or indices per row, as just computed in | |
11714 | the `GL_UNPACK_ROW_LENGTH' section. | |
11715 | ||
11716 | `GL_UNPACK_ALIGNMENT' | |
11717 | Specifies the alignment requirements for the start of each pixel | |
11718 | row in memory. The allowable values are 1 (byte-alignment), 2 (rows | |
11719 | aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows | |
11720 | start on double-word boundaries). | |
11721 | ||
11722 | The following table gives the type, initial value, and range of valid | |
11723 | values for each storage parameter that can be set with `glPixelStore'. | |
11724 | ||
11725 | ||
11726 | ||
11727 | *PNAME* | |
11728 | *Type*, *Initial Value*, *Valid Range* | |
11729 | ||
11730 | `GL_PACK_SWAP_BYTES' | |
11731 | boolean , false , true or false | |
11732 | ||
11733 | `GL_PACK_LSB_FIRST' | |
11734 | boolean , false , true or false | |
11735 | ||
11736 | `GL_PACK_ROW_LENGTH' | |
11737 | integer , 0 , [0,∞) | |
11738 | ||
11739 | `GL_PACK_IMAGE_HEIGHT' | |
11740 | integer , 0 , [0,∞) | |
11741 | ||
11742 | `GL_PACK_SKIP_ROWS' | |
11743 | integer , 0 , [0,∞) | |
11744 | ||
11745 | `GL_PACK_SKIP_PIXELS' | |
11746 | integer , 0 , [0,∞) | |
11747 | ||
11748 | `GL_PACK_SKIP_IMAGES' | |
11749 | integer , 0 , [0,∞) | |
11750 | ||
11751 | `GL_PACK_ALIGNMENT' | |
11752 | integer , 4 , 1, 2, 4, or 8 | |
11753 | ||
11754 | `GL_UNPACK_SWAP_BYTES' | |
11755 | boolean , false , true or false | |
11756 | ||
11757 | `GL_UNPACK_LSB_FIRST' | |
11758 | boolean , false , true or false | |
11759 | ||
11760 | `GL_UNPACK_ROW_LENGTH' | |
11761 | integer , 0 , [0,∞) | |
11762 | ||
11763 | `GL_UNPACK_IMAGE_HEIGHT' | |
11764 | integer , 0 , [0,∞) | |
11765 | ||
11766 | `GL_UNPACK_SKIP_ROWS' | |
11767 | integer , 0 , [0,∞) | |
11768 | ||
11769 | `GL_UNPACK_SKIP_PIXELS' | |
11770 | integer , 0 , [0,∞) | |
11771 | ||
11772 | `GL_UNPACK_SKIP_IMAGES' | |
11773 | integer , 0 , [0,∞) | |
11774 | ||
11775 | `GL_UNPACK_ALIGNMENT' | |
11776 | integer , 4 , 1, 2, 4, or 8 | |
11777 | ||
11778 | `glPixelStoref' can be used to set any pixel store parameter. If the | |
11779 | parameter type is boolean, then if PARAM is 0, the parameter is false; | |
11780 | otherwise it is set to true. If PNAME is a integer type parameter, PARAM | |
11781 | is rounded to the nearest integer. | |
11782 | ||
11783 | Likewise, `glPixelStorei' can also be used to set any of the pixel store | |
11784 | parameters. Boolean parameters are set to false if PARAM is 0 and true | |
11785 | otherwise. | |
11786 | ||
11787 | `GL_INVALID_ENUM' is generated if PNAME is not an accepted value. | |
11788 | ||
11789 | `GL_INVALID_VALUE' is generated if a negative row length, pixel skip, or | |
11790 | row skip value is specified, or if alignment is specified as other than | |
11791 | 1, 2, 4, or 8. | |
11792 | ||
11793 | `GL_INVALID_OPERATION' is generated if `glPixelStore' is executed | |
11794 | between the execution of `glBegin' and the corresponding execution of | |
11795 | `glEnd'.") | |
11796 | ||
11797 | (define-gl-procedure | |
bb894c9d AW |
11798 | ((glPixelTransferf |
11799 | (pname GLenum) | |
11800 | (param GLfloat) | |
11801 | -> | |
11802 | void) | |
11803 | (glPixelTransferi | |
11804 | (pname GLenum) | |
11805 | (param GLint) | |
11806 | -> | |
11807 | void)) | |
3c9b6116 AW |
11808 | "Set pixel transfer modes. |
11809 | ||
11810 | PNAME | |
11811 | Specifies the symbolic name of the pixel transfer parameter to be | |
11812 | set. Must be one of the following: `GL_MAP_COLOR', | |
11813 | `GL_MAP_STENCIL', `GL_INDEX_SHIFT', `GL_INDEX_OFFSET', | |
11814 | `GL_RED_SCALE', `GL_RED_BIAS', `GL_GREEN_SCALE', `GL_GREEN_BIAS', | |
11815 | `GL_BLUE_SCALE', `GL_BLUE_BIAS', `GL_ALPHA_SCALE', `GL_ALPHA_BIAS', | |
11816 | `GL_DEPTH_SCALE', or `GL_DEPTH_BIAS'. | |
11817 | ||
11818 | Additionally, if the `ARB_imaging' extension is supported, the | |
11819 | following symbolic names are accepted: | |
11820 | `GL_POST_COLOR_MATRIX_RED_SCALE', | |
11821 | `GL_POST_COLOR_MATRIX_GREEN_SCALE', | |
11822 | `GL_POST_COLOR_MATRIX_BLUE_SCALE', | |
11823 | `GL_POST_COLOR_MATRIX_ALPHA_SCALE', | |
11824 | `GL_POST_COLOR_MATRIX_RED_BIAS', `GL_POST_COLOR_MATRIX_GREEN_BIAS', | |
11825 | `GL_POST_COLOR_MATRIX_BLUE_BIAS', | |
11826 | `GL_POST_COLOR_MATRIX_ALPHA_BIAS', `GL_POST_CONVOLUTION_RED_SCALE', | |
11827 | `GL_POST_CONVOLUTION_GREEN_SCALE', | |
11828 | `GL_POST_CONVOLUTION_BLUE_SCALE', | |
11829 | `GL_POST_CONVOLUTION_ALPHA_SCALE', `GL_POST_CONVOLUTION_RED_BIAS', | |
11830 | `GL_POST_CONVOLUTION_GREEN_BIAS', `GL_POST_CONVOLUTION_BLUE_BIAS', | |
11831 | and `GL_POST_CONVOLUTION_ALPHA_BIAS'. | |
11832 | ||
11833 | PARAM | |
11834 | Specifies the value that PNAME is set to. | |
11835 | ||
11836 | `glPixelTransfer' sets pixel transfer modes that affect the operation of | |
11837 | subsequent `glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D', | |
11838 | `glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', | |
11839 | `glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D', | |
11840 | `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and | |
11841 | `glTexSubImage3D' commands. Additionally, if the `ARB_imaging' subset is | |
11842 | supported, the routines `glColorTable', `glColorSubTable', | |
11843 | `glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram', | |
11844 | `glMinmax', and `glSeparableFilter2D' are also affected. The algorithms | |
11845 | that are specified by pixel transfer modes operate on pixels after they | |
11846 | are read from the frame buffer (`glCopyPixels'`glCopyTexImage1D', | |
11847 | `glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D', | |
11848 | `glCopyTexSubImage3D', and `glReadPixels'), or unpacked from client | |
11849 | memory (`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D', | |
11850 | `glTexSubImage1D', `glTexSubImage2D', and `glTexSubImage3D'). Pixel | |
11851 | transfer operations happen in the same order, and in the same manner, | |
11852 | regardless of the command that resulted in the pixel operation. Pixel | |
11853 | storage modes (see `glPixelStore') control the unpacking of pixels being | |
11854 | read from client memory and the packing of pixels being written back | |
11855 | into client memory. | |
11856 | ||
11857 | Pixel transfer operations handle four fundamental pixel types: COLOR, | |
11858 | COLOR INDEX, DEPTH, and STENCIL. COLOR pixels consist of four | |
11859 | floating-point values with unspecified mantissa and exponent sizes, | |
11860 | scaled such that 0 represents zero intensity and 1 represents full | |
11861 | intensity. COLOR INDICES comprise a single fixed-point value, with | |
11862 | unspecified precision to the right of the binary point. DEPTH pixels | |
11863 | comprise a single floating-point value, with unspecified mantissa and | |
11864 | exponent sizes, scaled such that 0.0 represents the minimum depth buffer | |
11865 | value, and 1.0 represents the maximum depth buffer value. Finally, | |
11866 | STENCIL pixels comprise a single fixed-point value, with unspecified | |
11867 | precision to the right of the binary point. | |
11868 | ||
11869 | The pixel transfer operations performed on the four basic pixel types | |
11870 | are as follows: | |
11871 | ||
11872 | COLOR | |
11873 | Each of the four color components is multiplied by a scale factor, | |
11874 | then added to a bias factor. That is, the red component is | |
11875 | multiplied by `GL_RED_SCALE', then added to `GL_RED_BIAS'; the | |
11876 | green component is multiplied by `GL_GREEN_SCALE', then added to | |
11877 | `GL_GREEN_BIAS'; the blue component is multiplied by | |
11878 | `GL_BLUE_SCALE', then added to `GL_BLUE_BIAS'; and the alpha | |
11879 | component is multiplied by `GL_ALPHA_SCALE', then added to | |
11880 | `GL_ALPHA_BIAS'. After all four color components are scaled and | |
11881 | biased, each is clamped to the range [0,1] . All color, scale, and | |
11882 | bias values are specified with `glPixelTransfer'. | |
11883 | ||
11884 | If `GL_MAP_COLOR' is true, each color component is scaled by the | |
11885 | size of the corresponding color-to-color map, then replaced by the | |
11886 | contents of that map indexed by the scaled component. That is, the | |
11887 | red component is scaled by `GL_PIXEL_MAP_R_TO_R_SIZE', then | |
11888 | replaced by the contents of `GL_PIXEL_MAP_R_TO_R' indexed by | |
11889 | itself. The green component is scaled by | |
11890 | `GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of | |
11891 | `GL_PIXEL_MAP_G_TO_G' indexed by itself. The blue component is | |
11892 | scaled by `GL_PIXEL_MAP_B_TO_B_SIZE', then replaced by the contents | |
11893 | of `GL_PIXEL_MAP_B_TO_B' indexed by itself. And the alpha component | |
11894 | is scaled by `GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the | |
11895 | contents of `GL_PIXEL_MAP_A_TO_A' indexed by itself. All components | |
11896 | taken from the maps are then clamped to the range [0,1] . | |
11897 | `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of | |
11898 | the various maps are specified with `glPixelMap'. | |
11899 | ||
11900 | If the `ARB_imaging' extension is supported, each of the four color | |
11901 | components may be scaled and biased after transformation by the | |
11902 | color matrix. That is, the red component is multiplied by | |
11903 | `GL_POST_COLOR_MATRIX_RED_SCALE', then added to | |
11904 | `GL_POST_COLOR_MATRIX_RED_BIAS'; the green component is multiplied | |
11905 | by `GL_POST_COLOR_MATRIX_GREEN_SCALE', then added to | |
11906 | `GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied | |
11907 | by `GL_POST_COLOR_MATRIX_BLUE_SCALE', then added to | |
11908 | `GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is | |
11909 | multiplied by `GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to | |
11910 | `GL_POST_COLOR_MATRIX_ALPHA_BIAS'. After all four color components | |
11911 | are scaled and biased, each is clamped to the range [0,1] . | |
11912 | ||
11913 | Similarly, if the `ARB_imaging' extension is supported, each of the | |
11914 | four color components may be scaled and biased after processing by | |
11915 | the enabled convolution filter. That is, the red component is | |
11916 | multiplied by `GL_POST_CONVOLUTION_RED_SCALE', then added to | |
11917 | `GL_POST_CONVOLUTION_RED_BIAS'; the green component is multiplied | |
11918 | by `GL_POST_CONVOLUTION_GREEN_SCALE', then added to | |
11919 | `GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied | |
11920 | by `GL_POST_CONVOLUTION_BLUE_SCALE', then added to | |
11921 | `GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is | |
11922 | multiplied by `GL_POST_CONVOLUTION_ALPHA_SCALE', then added to | |
11923 | `GL_POST_CONVOLUTION_ALPHA_BIAS'. After all four color components | |
11924 | are scaled and biased, each is clamped to the range [0,1] . | |
11925 | ||
11926 | COLOR INDEX | |
11927 | Each color index is shifted left by `GL_INDEX_SHIFT' bits; any bits | |
11928 | beyond the number of fraction bits carried by the fixed-point index | |
11929 | are filled with zeros. If `GL_INDEX_SHIFT' is negative, the shift | |
11930 | is to the right, again zero filled. Then `GL_INDEX_OFFSET' is added | |
11931 | to the index. `GL_INDEX_SHIFT' and `GL_INDEX_OFFSET' are specified | |
11932 | with `glPixelTransfer'. | |
11933 | ||
11934 | From this point, operation diverges depending on the required | |
11935 | format of the resulting pixels. If the resulting pixels are to be | |
11936 | written to a color index buffer, or if they are being read back to | |
11937 | client memory in `GL_COLOR_INDEX' format, the pixels continue to be | |
11938 | treated as indices. If `GL_MAP_COLOR' is true, each index is masked | |
11939 | by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by | |
11940 | the contents of `GL_PIXEL_MAP_I_TO_I' indexed by the masked value. | |
11941 | `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of | |
11942 | the index map is specified with `glPixelMap'. | |
11943 | ||
11944 | If the resulting pixels are to be written to an RGBA color buffer, | |
11945 | or if they are read back to client memory in a format other than | |
11946 | `GL_COLOR_INDEX', the pixels are converted from indices to colors | |
11947 | by referencing the four maps `GL_PIXEL_MAP_I_TO_R', | |
11948 | `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and | |
11949 | `GL_PIXEL_MAP_I_TO_A'. Before being dereferenced, the index is | |
11950 | masked by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_R_SIZE' for the red | |
11951 | map, `GL_PIXEL_MAP_I_TO_G_SIZE' for the green map, | |
11952 | `GL_PIXEL_MAP_I_TO_B_SIZE' for the blue map, and | |
11953 | `GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components taken | |
11954 | from the maps are then clamped to the range [0,1] . The contents of | |
11955 | the four maps is specified with `glPixelMap'. | |
11956 | ||
11957 | DEPTH | |
11958 | Each depth value is multiplied by `GL_DEPTH_SCALE', added to | |
11959 | `GL_DEPTH_BIAS', then clamped to the range [0,1] . | |
11960 | ||
11961 | STENCIL | |
11962 | Each index is shifted `GL_INDEX_SHIFT' bits just as a color index | |
11963 | is, then added to `GL_INDEX_OFFSET'. If `GL_MAP_STENCIL' is true, | |
11964 | each index is masked by 2^N-1 , where N is | |
11965 | `GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by the contents of | |
11966 | `GL_PIXEL_MAP_S_TO_S' indexed by the masked value. | |
11967 | ||
11968 | The following table gives the type, initial value, and range of valid | |
11969 | values for each of the pixel transfer parameters that are set with | |
11970 | `glPixelTransfer'. | |
11971 | ||
11972 | ||
11973 | ||
11974 | *PNAME* | |
11975 | *Type*, *Initial Value*, *Valid Range* | |
11976 | ||
11977 | `GL_MAP_COLOR' | |
11978 | boolean , false , true/false | |
11979 | ||
11980 | `GL_MAP_STENCIL' | |
11981 | boolean , false , true/false | |
11982 | ||
11983 | `GL_INDEX_SHIFT' | |
11984 | integer , 0 , (-∞,∞) | |
11985 | ||
11986 | `GL_INDEX_OFFSET' | |
11987 | integer , 0 , (-∞,∞) | |
11988 | ||
11989 | `GL_RED_SCALE' | |
11990 | float , 1 , (-∞,∞) | |
11991 | ||
11992 | `GL_GREEN_SCALE' | |
11993 | float , 1 , (-∞,∞) | |
11994 | ||
11995 | `GL_BLUE_SCALE' | |
11996 | float , 1 , (-∞,∞) | |
11997 | ||
11998 | `GL_ALPHA_SCALE' | |
11999 | float , 1 , (-∞,∞) | |
12000 | ||
12001 | `GL_DEPTH_SCALE' | |
12002 | float , 1 , (-∞,∞) | |
12003 | ||
12004 | `GL_RED_BIAS' | |
12005 | float , 0 , (-∞,∞) | |
12006 | ||
12007 | `GL_GREEN_BIAS' | |
12008 | float , 0 , (-∞,∞) | |
12009 | ||
12010 | `GL_BLUE_BIAS' | |
12011 | float , 0 , (-∞,∞) | |
12012 | ||
12013 | `GL_ALPHA_BIAS' | |
12014 | float , 0 , (-∞,∞) | |
12015 | ||
12016 | `GL_DEPTH_BIAS' | |
12017 | float , 0 , (-∞,∞) | |
12018 | ||
12019 | `GL_POST_COLOR_MATRIX_RED_SCALE' | |
12020 | float , 1 , (-∞,∞) | |
12021 | ||
12022 | `GL_POST_COLOR_MATRIX_GREEN_SCALE' | |
12023 | float , 1 , (-∞,∞) | |
12024 | ||
12025 | `GL_POST_COLOR_MATRIX_BLUE_SCALE' | |
12026 | float , 1 , (-∞,∞) | |
12027 | ||
12028 | `GL_POST_COLOR_MATRIX_ALPHA_SCALE' | |
12029 | float , 1 , (-∞,∞) | |
12030 | ||
12031 | `GL_POST_COLOR_MATRIX_RED_BIAS' | |
12032 | float , 0 , (-∞,∞) | |
12033 | ||
12034 | `GL_POST_COLOR_MATRIX_GREEN_BIAS' | |
12035 | float , 0 , (-∞,∞) | |
12036 | ||
12037 | `GL_POST_COLOR_MATRIX_BLUE_BIAS' | |
12038 | float , 0 , (-∞,∞) | |
12039 | ||
12040 | `GL_POST_COLOR_MATRIX_ALPHA_BIAS' | |
12041 | float , 0 , (-∞,∞) | |
12042 | ||
12043 | `GL_POST_CONVOLUTION_RED_SCALE' | |
12044 | float , 1 , (-∞,∞) | |
12045 | ||
12046 | `GL_POST_CONVOLUTION_GREEN_SCALE' | |
12047 | float , 1 , (-∞,∞) | |
12048 | ||
12049 | `GL_POST_CONVOLUTION_BLUE_SCALE' | |
12050 | float , 1 , (-∞,∞) | |
12051 | ||
12052 | `GL_POST_CONVOLUTION_ALPHA_SCALE' | |
12053 | float , 1 , (-∞,∞) | |
12054 | ||
12055 | `GL_POST_CONVOLUTION_RED_BIAS' | |
12056 | float , 0 , (-∞,∞) | |
12057 | ||
12058 | `GL_POST_CONVOLUTION_GREEN_BIAS' | |
12059 | float , 0 , (-∞,∞) | |
12060 | ||
12061 | `GL_POST_CONVOLUTION_BLUE_BIAS' | |
12062 | float , 0 , (-∞,∞) | |
12063 | ||
12064 | `GL_POST_CONVOLUTION_ALPHA_BIAS' | |
12065 | float , 0 , (-∞,∞) | |
12066 | ||
12067 | `glPixelTransferf' can be used to set any pixel transfer parameter. If | |
12068 | the parameter type is boolean, 0 implies false and any other value | |
12069 | implies true. If PNAME is an integer parameter, PARAM is rounded to the | |
12070 | nearest integer. | |
12071 | ||
12072 | Likewise, `glPixelTransferi' can be used to set any of the pixel | |
12073 | transfer parameters. Boolean parameters are set to false if PARAM is 0 | |
12074 | and to true otherwise. PARAM is converted to floating point before being | |
12075 | assigned to real-valued parameters. | |
12076 | ||
12077 | `GL_INVALID_ENUM' is generated if PNAME is not an accepted value. | |
12078 | ||
12079 | `GL_INVALID_OPERATION' is generated if `glPixelTransfer' is executed | |
12080 | between the execution of `glBegin' and the corresponding execution of | |
12081 | `glEnd'.") | |
12082 | ||
12083 | (define-gl-procedure | |
bb894c9d AW |
12084 | ((glPixelZoom |
12085 | (xfactor GLfloat) | |
12086 | (yfactor GLfloat) | |
12087 | -> | |
12088 | void)) | |
3c9b6116 AW |
12089 | "Specify the pixel zoom factors. |
12090 | ||
12091 | XFACTOR | |
12092 | YFACTOR | |
12093 | ||
12094 | Specify the X and Y zoom factors for pixel write operations. | |
12095 | ||
12096 | `glPixelZoom' specifies values for the X and Y zoom factors. During the | |
12097 | execution of `glDrawPixels' or `glCopyPixels', if (XR , YR ) is the | |
12098 | current raster position, and a given element is in the M th row and N th | |
12099 | column of the pixel rectangle, then pixels whose centers are in the | |
12100 | rectangle with corners at | |
12101 | ||
12102 | (XR+N·XFACTOR , YR+M·YFACTOR ) | |
12103 | ||
12104 | (XR+(N+1,)·XFACTOR , YR+(M+1,)·YFACTOR ) | |
12105 | ||
12106 | are candidates for replacement. Any pixel whose center lies on the | |
12107 | bottom or left edge of this rectangular region is also modified. | |
12108 | ||
12109 | Pixel zoom factors are not limited to positive values. Negative zoom | |
12110 | factors reflect the resulting image about the current raster position. | |
12111 | ||
12112 | `GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between | |
12113 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
12114 | ||
12115 | (define-gl-procedure | |
bb894c9d AW |
12116 | ((glPointParameterf |
12117 | (pname GLenum) | |
12118 | (param GLfloat) | |
12119 | -> | |
12120 | void) | |
12121 | (glPointParameteri | |
12122 | (pname GLenum) | |
12123 | (param GLint) | |
12124 | -> | |
12125 | void)) | |
3c9b6116 AW |
12126 | "Specify point parameters. |
12127 | ||
12128 | PNAME | |
12129 | Specifies a single-valued point parameter. `GL_POINT_SIZE_MIN', | |
12130 | `GL_POINT_SIZE_MAX', `GL_POINT_FADE_THRESHOLD_SIZE', and | |
12131 | `GL_POINT_SPRITE_COORD_ORIGIN' are accepted. | |
12132 | ||
12133 | PARAM | |
12134 | Specifies the value that PNAME will be set to. | |
12135 | ||
12136 | The following values are accepted for PNAME: | |
12137 | ||
12138 | `GL_POINT_SIZE_MIN' | |
12139 | ||
12140 | ||
12141 | PARAMS is a single floating-point value that specifies the minimum | |
12142 | point size. The default value is 0.0. | |
12143 | ||
12144 | `GL_POINT_SIZE_MAX' | |
12145 | ||
12146 | ||
12147 | PARAMS is a single floating-point value that specifies the maximum | |
12148 | point size. The default value is 1.0. | |
12149 | ||
12150 | `GL_POINT_FADE_THRESHOLD_SIZE' | |
12151 | ||
12152 | ||
12153 | PARAMS is a single floating-point value that specifies the | |
12154 | threshold value to which point sizes are clamped if they exceed the | |
12155 | specified value. The default value is 1.0. | |
12156 | ||
12157 | `GL_POINT_DISTANCE_ATTENUATION' | |
12158 | ||
12159 | ||
12160 | PARAMS is an array of three floating-point values that specify the | |
12161 | coefficients used for scaling the computed point size. The default | |
12162 | values are (1,00) . | |
12163 | ||
12164 | `GL_POINT_SPRITE_COORD_ORIGIN' | |
12165 | ||
12166 | ||
12167 | PARAMS is a single enum specifying the point sprite texture | |
12168 | coordinate origin, either `GL_LOWER_LEFT' or `GL_UPPER_LEFT'. The | |
12169 | default value is `GL_UPPER_LEFT'. | |
12170 | ||
12171 | `GL_INVALID_VALUE' is generated If the value specified for | |
12172 | `GL_POINT_SIZE_MIN', `GL_POINT_SIZE_MAX', or | |
12173 | `GL_POINT_FADE_THRESHOLD_SIZE' is less than zero. | |
12174 | ||
12175 | `GL_INVALID_ENUM' is generated If the value specified for | |
12176 | `GL_POINT_SPRITE_COORD_ORIGIN' is not `GL_LOWER_LEFT' or | |
12177 | `GL_UPPER_LEFT'. | |
12178 | ||
12179 | If the value for `GL_POINT_SIZE_MIN' is greater than | |
12180 | `GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no | |
12181 | error is generated.") | |
12182 | ||
12183 | (define-gl-procedure | |
bb894c9d | 12184 | ((glPointSize (size GLfloat) -> void)) |
3c9b6116 AW |
12185 | "Specify the diameter of rasterized points. |
12186 | ||
12187 | SIZE | |
12188 | Specifies the diameter of rasterized points. The initial value is | |
12189 | 1. | |
12190 | ||
12191 | `glPointSize' specifies the rasterized diameter of both aliased and | |
12192 | antialiased points. Using a point size other than 1 has different | |
12193 | effects, depending on whether point antialiasing is enabled. To enable | |
12194 | and disable point antialiasing, call `glEnable' and `glDisable' with | |
12195 | argument `GL_POINT_SMOOTH'. Point antialiasing is initially disabled. | |
12196 | ||
12197 | The specified point size is multiplied with a distance attenuation | |
12198 | factor and clamped to the specified point size range, and further | |
12199 | clamped to the implementation-dependent point size range to produce the | |
12200 | derived point size using | |
12201 | ||
12202 | POINTSIZE=CLAMP\u2062(SIZE×√(1/A+B×D+C×D^2,,,),,) | |
12203 | ||
12204 | where D is the eye-coordinate distance from the eye to the vertex, and A | |
12205 | , B , and C are the distance attenuation coefficients (see | |
12206 | `glPointParameter'). | |
12207 | ||
12208 | If multisampling is disabled, the computed point size is used as the | |
12209 | point's width. | |
12210 | ||
12211 | If multisampling is enabled, the point may be faded by modifying the | |
12212 | point alpha value (see `glSampleCoverage') instead of allowing the point | |
12213 | width to go below a given threshold (see `glPointParameter'). In this | |
12214 | case, the width is further modified in the following manner: | |
12215 | ||
12216 | POINTWIDTH={(POINTSIZE), (THRESHOLD)\u2062(POINTSIZE>=THRESHOLD), | |
12217 | (OTHERWISE), | |
12218 | ||
12219 | The point alpha value is modified by computing: | |
12220 | ||
12221 | POINTALPHA={(1), ((POINTSIZE/THRESHOLD,)^2)\u2062(POINTSIZE>=THRESHOLD), | |
12222 | (OTHERWISE), | |
12223 | ||
12224 | If point antialiasing is disabled, the actual size is determined by | |
12225 | rounding the supplied size to the nearest integer. (If the rounding | |
12226 | results in the value 0, it is as if the point size were 1.) If the | |
12227 | rounded size is odd, then the center point (X , Y ) of the pixel | |
12228 | fragment that represents the point is computed as | |
12229 | ||
12230 | (⌊X_W,⌋+.5,⌊Y_W,⌋+.5) | |
12231 | ||
12232 | where W subscripts indicate window coordinates. All pixels that lie | |
12233 | within the square grid of the rounded size centered at (X , Y ) make up | |
12234 | the fragment. If the size is even, the center point is | |
12235 | ||
12236 | (⌊X_W+.5,⌋,⌊Y_W+.5,⌋) | |
12237 | ||
12238 | and the rasterized fragment's centers are the half-integer window | |
12239 | coordinates within the square of the rounded size centered at (X,Y) . | |
12240 | All pixel fragments produced in rasterizing a nonantialiased point are | |
12241 | assigned the same associated data, that of the vertex corresponding to | |
12242 | the point. | |
12243 | ||
12244 | If antialiasing is enabled, then point rasterization produces a fragment | |
12245 | for each pixel square that intersects the region lying within the circle | |
12246 | having diameter equal to the current point size and centered at the | |
12247 | point's (X_W,Y_W) . The coverage value for each fragment is the window | |
12248 | coordinate area of the intersection of the circular region with the | |
12249 | corresponding pixel square. This value is saved and used in the final | |
12250 | rasterization step. The data associated with each fragment is the data | |
12251 | associated with the point being rasterized. | |
12252 | ||
12253 | Not all sizes are supported when point antialiasing is enabled. If an | |
12254 | unsupported size is requested, the nearest supported size is used. Only | |
12255 | size 1 is guaranteed to be supported; others depend on the | |
12256 | implementation. To query the range of supported sizes and the size | |
12257 | difference between supported sizes within the range, call `glGet' with | |
12258 | arguments `GL_SMOOTH_POINT_SIZE_RANGE' and | |
12259 | `GL_SMOOTH_POINT_SIZE_GRANULARITY'. For aliased points, query the | |
12260 | supported ranges and granularity with `glGet' with arguments | |
12261 | `GL_ALIASED_POINT_SIZE_RANGE'. | |
12262 | ||
12263 | `GL_INVALID_VALUE' is generated if SIZE is less than or equal to 0. | |
12264 | ||
12265 | `GL_INVALID_OPERATION' is generated if `glPointSize' is executed between | |
12266 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
12267 | ||
12268 | (define-gl-procedure | |
bb894c9d AW |
12269 | ((glPolygonMode |
12270 | (face GLenum) | |
12271 | (mode GLenum) | |
12272 | -> | |
12273 | void)) | |
3c9b6116 AW |
12274 | "Select a polygon rasterization mode. |
12275 | ||
12276 | FACE | |
12277 | Specifies the polygons that MODE applies to. Must be `GL_FRONT' for | |
12278 | front-facing polygons, `GL_BACK' for back-facing polygons, or | |
12279 | `GL_FRONT_AND_BACK' for front- and back-facing polygons. | |
12280 | ||
12281 | MODE | |
12282 | Specifies how polygons will be rasterized. Accepted values are | |
12283 | `GL_POINT', `GL_LINE', and `GL_FILL'. The initial value is | |
12284 | `GL_FILL' for both front- and back-facing polygons. | |
12285 | ||
12286 | `glPolygonMode' controls the interpretation of polygons for | |
12287 | rasterization. FACE describes which polygons MODE applies to: | |
12288 | front-facing polygons (`GL_FRONT'), back-facing polygons (`GL_BACK'), or | |
12289 | both (`GL_FRONT_AND_BACK'). The polygon mode affects only the final | |
12290 | rasterization of polygons. In particular, a polygon's vertices are lit | |
12291 | and the polygon is clipped and possibly culled before these modes are | |
12292 | applied. | |
12293 | ||
12294 | Three modes are defined and can be specified in MODE: | |
12295 | ||
12296 | `GL_POINT' | |
12297 | Polygon vertices that are marked as the start of a boundary edge | |
12298 | are drawn as points. Point attributes such as `GL_POINT_SIZE' and | |
12299 | `GL_POINT_SMOOTH' control the rasterization of the points. Polygon | |
12300 | rasterization attributes other than `GL_POLYGON_MODE' have no | |
12301 | effect. | |
12302 | ||
12303 | `GL_LINE' | |
12304 | Boundary edges of the polygon are drawn as line segments. They are | |
12305 | treated as connected line segments for line stippling; the line | |
12306 | stipple counter and pattern are not reset between segments (see | |
12307 | `glLineStipple'). Line attributes such as `GL_LINE_WIDTH' and | |
12308 | `GL_LINE_SMOOTH' control the rasterization of the lines. Polygon | |
12309 | rasterization attributes other than `GL_POLYGON_MODE' have no | |
12310 | effect. | |
12311 | ||
12312 | `GL_FILL' | |
12313 | The interior of the polygon is filled. Polygon attributes such as | |
12314 | `GL_POLYGON_STIPPLE' and `GL_POLYGON_SMOOTH' control the | |
12315 | rasterization of the polygon. | |
12316 | ||
12317 | `GL_INVALID_ENUM' is generated if either FACE or MODE is not an accepted | |
12318 | value. | |
12319 | ||
12320 | `GL_INVALID_OPERATION' is generated if `glPolygonMode' is executed | |
12321 | between the execution of `glBegin' and the corresponding execution of | |
12322 | `glEnd'.") | |
12323 | ||
12324 | (define-gl-procedure | |
bb894c9d AW |
12325 | ((glPolygonOffset |
12326 | (factor GLfloat) | |
12327 | (units GLfloat) | |
12328 | -> | |
12329 | void)) | |
3c9b6116 AW |
12330 | "Set the scale and units used to calculate depth values. |
12331 | ||
12332 | FACTOR | |
12333 | Specifies a scale factor that is used to create a variable depth | |
12334 | offset for each polygon. The initial value is 0. | |
12335 | ||
12336 | UNITS | |
12337 | Is multiplied by an implementation-specific value to create a | |
12338 | constant depth offset. The initial value is 0. | |
12339 | ||
12340 | When `GL_POLYGON_OFFSET_FILL', `GL_POLYGON_OFFSET_LINE', or | |
12341 | `GL_POLYGON_OFFSET_POINT' is enabled, each fragment's DEPTH value will | |
12342 | be offset after it is interpolated from the DEPTH values of the | |
12343 | appropriate vertices. The value of the offset is FACTOR×DZ+R×UNITS , | |
12344 | where DZ is a measurement of the change in depth relative to the screen | |
12345 | area of the polygon, and R is the smallest value that is guaranteed to | |
12346 | produce a resolvable offset for a given implementation. The offset is | |
12347 | added before the depth test is performed and before the value is written | |
12348 | into the depth buffer. | |
12349 | ||
12350 | `glPolygonOffset' is useful for rendering hidden-line images, for | |
12351 | applying decals to surfaces, and for rendering solids with highlighted | |
12352 | edges. | |
12353 | ||
12354 | `GL_INVALID_OPERATION' is generated if `glPolygonOffset' is executed | |
12355 | between the execution of `glBegin' and the corresponding execution of | |
12356 | `glEnd'.") | |
12357 | ||
12358 | (define-gl-procedure | |
bb894c9d | 12359 | ((glPolygonStipple (pattern *) -> void)) |
3c9b6116 AW |
12360 | "Set the polygon stippling pattern. |
12361 | ||
12362 | PATTERN | |
12363 | Specifies a pointer to a 32×32 stipple pattern that will be | |
12364 | unpacked from memory in the same way that `glDrawPixels' unpacks | |
12365 | pixels. | |
12366 | ||
12367 | Polygon stippling, like line stippling (see `glLineStipple'), masks out | |
12368 | certain fragments produced by rasterization, creating a pattern. | |
12369 | Stippling is independent of polygon antialiasing. | |
12370 | ||
12371 | PATTERN is a pointer to a 32×32 stipple pattern that is stored in memory | |
12372 | just like the pixel data supplied to a `glDrawPixels' call with height | |
12373 | and WIDTH both equal to 32, a pixel format of `GL_COLOR_INDEX', and data | |
12374 | type of `GL_BITMAP'. That is, the stipple pattern is represented as a | |
12375 | 32×32 array of 1-bit color indices packed in unsigned bytes. | |
12376 | `glPixelStore' parameters like `GL_UNPACK_SWAP_BYTES' and | |
12377 | `GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple | |
12378 | pattern. Pixel transfer operations (shift, offset, pixel map) are not | |
12379 | applied to the stipple image, however. | |
12380 | ||
12381 | If a non-zero named buffer object is bound to the | |
12382 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a stipple | |
12383 | pattern is specified, PATTERN is treated as a byte offset into the | |
12384 | buffer object's data store. | |
12385 | ||
12386 | To enable and disable polygon stippling, call `glEnable' and `glDisable' | |
12387 | with argument `GL_POLYGON_STIPPLE'. Polygon stippling is initially | |
12388 | disabled. If it's enabled, a rasterized polygon fragment with window | |
12389 | coordinates X_W and Y_W is sent to the next stage of the GL if and only | |
12390 | if the (X_W%32 )th bit in the (Y_W%32 )th row of the stipple pattern is | |
12391 | 1 (one). When polygon stippling is disabled, it is as if the stipple | |
12392 | pattern consists of all 1's. | |
12393 | ||
12394 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
12395 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
12396 | data store is currently mapped. | |
12397 | ||
12398 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
12399 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
12400 | unpacked from the buffer object such that the memory reads required | |
12401 | would exceed the data store size. | |
12402 | ||
12403 | `GL_INVALID_OPERATION' is generated if `glPolygonStipple' is executed | |
12404 | between the execution of `glBegin' and the corresponding execution of | |
12405 | `glEnd'.") | |
12406 | ||
12407 | (define-gl-procedure | |
bb894c9d AW |
12408 | ((glPrioritizeTextures |
12409 | (n GLsizei) | |
12410 | (textures *) | |
12411 | (priorities *) | |
12412 | -> | |
12413 | void)) | |
3c9b6116 AW |
12414 | "Set texture residence priority. |
12415 | ||
12416 | N | |
12417 | Specifies the number of textures to be prioritized. | |
12418 | ||
12419 | TEXTURES | |
12420 | Specifies an array containing the names of the textures to be | |
12421 | prioritized. | |
12422 | ||
12423 | PRIORITIES | |
12424 | Specifies an array containing the texture priorities. A priority | |
12425 | given in an element of PRIORITIES applies to the texture named by | |
12426 | the corresponding element of TEXTURES. | |
12427 | ||
12428 | `glPrioritizeTextures' assigns the N texture priorities given in | |
12429 | PRIORITIES to the N textures named in TEXTURES. | |
12430 | ||
12431 | The GL establishes a ``working set'' of textures that are resident in | |
12432 | texture memory. These textures may be bound to a texture target much | |
12433 | more efficiently than textures that are not resident. By specifying a | |
12434 | priority for each texture, `glPrioritizeTextures' allows applications to | |
12435 | guide the GL implementation in determining which textures should be | |
12436 | resident. | |
12437 | ||
12438 | The priorities given in PRIORITIES are clamped to the range [0,1] before | |
12439 | they are assigned. 0 indicates the lowest priority; textures with | |
12440 | priority 0 are least likely to be resident. 1 indicates the highest | |
12441 | priority; textures with priority 1 are most likely to be resident. | |
12442 | However, textures are not guaranteed to be resident until they are used. | |
12443 | ||
12444 | `glPrioritizeTextures' silently ignores attempts to prioritize texture 0 | |
12445 | or any texture name that does not correspond to an existing texture. | |
12446 | ||
12447 | `glPrioritizeTextures' does not require that any of the textures named | |
12448 | by TEXTURES be bound to a texture target. `glTexParameter' may also be | |
12449 | used to set a texture's priority, but only if the texture is currently | |
12450 | bound. This is the only way to set the priority of a default texture. | |
12451 | ||
12452 | `GL_INVALID_VALUE' is generated if N is negative. | |
12453 | ||
12454 | `GL_INVALID_OPERATION' is generated if `glPrioritizeTextures' is | |
12455 | executed between the execution of `glBegin' and the corresponding | |
12456 | execution of `glEnd'.") | |
12457 | ||
12458 | (define-gl-procedure | |
bb894c9d AW |
12459 | ((glPushAttrib (mask GLbitfield) -> void) |
12460 | (glPopAttrib -> void)) | |
3c9b6116 AW |
12461 | "Push and pop the server attribute stack. |
12462 | ||
12463 | MASK | |
12464 | Specifies a mask that indicates which attributes to save. Values | |
12465 | for MASK are listed below. | |
12466 | ||
12467 | `glPushAttrib' takes one argument, a mask that indicates which groups of | |
12468 | state variables to save on the attribute stack. Symbolic constants are | |
12469 | used to set bits in the mask. MASK is typically constructed by | |
12470 | specifying the bitwise-or of several of these constants together. The | |
12471 | special mask `GL_ALL_ATTRIB_BITS' can be used to save all stackable | |
12472 | states. | |
12473 | ||
12474 | The symbolic mask constants and their associated GL state are as follows | |
12475 | (the second column lists which attributes are saved): | |
12476 | ||
12477 | ||
12478 | ||
12479 | `GL_ACCUM_BUFFER_BIT' | |
12480 | Accumulation buffer clear value | |
12481 | ||
12482 | `GL_COLOR_BUFFER_BIT' | |
12483 | `GL_ALPHA_TEST' enable bit | |
12484 | ||
12485 | ||
12486 | Alpha test function and reference value | |
12487 | ||
12488 | ||
12489 | `GL_BLEND' enable bit | |
12490 | ||
12491 | ||
12492 | Blending source and destination functions | |
12493 | ||
12494 | ||
12495 | Constant blend color | |
12496 | ||
12497 | ||
12498 | Blending equation | |
12499 | ||
12500 | ||
12501 | `GL_DITHER' enable bit | |
12502 | ||
12503 | ||
12504 | `GL_DRAW_BUFFER' setting | |
12505 | ||
12506 | ||
12507 | `GL_COLOR_LOGIC_OP' enable bit | |
12508 | ||
12509 | ||
12510 | `GL_INDEX_LOGIC_OP' enable bit | |
12511 | ||
12512 | ||
12513 | Logic op function | |
12514 | ||
12515 | ||
12516 | Color mode and index mode clear values | |
12517 | ||
12518 | ||
12519 | Color mode and index mode writemasks | |
12520 | ||
12521 | `GL_CURRENT_BIT' | |
12522 | Current RGBA color | |
12523 | ||
12524 | ||
12525 | Current color index | |
12526 | ||
12527 | ||
12528 | Current normal vector | |
12529 | ||
12530 | ||
12531 | Current texture coordinates | |
12532 | ||
12533 | ||
12534 | Current raster position | |
12535 | ||
12536 | ||
12537 | `GL_CURRENT_RASTER_POSITION_VALID' flag | |
12538 | ||
12539 | ||
12540 | RGBA color associated with current raster position | |
12541 | ||
12542 | ||
12543 | Color index associated with current raster position | |
12544 | ||
12545 | ||
12546 | Texture coordinates associated with current raster position | |
12547 | ||
12548 | ||
12549 | `GL_EDGE_FLAG' flag | |
12550 | ||
12551 | `GL_DEPTH_BUFFER_BIT' | |
12552 | `GL_DEPTH_TEST' enable bit | |
12553 | ||
12554 | ||
12555 | Depth buffer test function | |
12556 | ||
12557 | ||
12558 | Depth buffer clear value | |
12559 | ||
12560 | ||
12561 | `GL_DEPTH_WRITEMASK' enable bit | |
12562 | ||
12563 | `GL_ENABLE_BIT' | |
12564 | `GL_ALPHA_TEST' flag | |
12565 | ||
12566 | ||
12567 | `GL_AUTO_NORMAL' flag | |
12568 | ||
12569 | ||
12570 | `GL_BLEND' flag | |
12571 | ||
12572 | ||
12573 | Enable bits for the user-definable clipping planes | |
12574 | ||
12575 | ||
12576 | `GL_COLOR_MATERIAL' | |
12577 | ||
12578 | ||
12579 | `GL_CULL_FACE' flag | |
12580 | ||
12581 | ||
12582 | `GL_DEPTH_TEST' flag | |
12583 | ||
12584 | ||
12585 | `GL_DITHER' flag | |
12586 | ||
12587 | ||
12588 | `GL_FOG' flag | |
12589 | ||
12590 | ||
12591 | `GL_LIGHT'I where `0' <= I < `GL_MAX_LIGHTS' | |
12592 | ||
12593 | ||
12594 | `GL_LIGHTING' flag | |
12595 | ||
12596 | ||
12597 | `GL_LINE_SMOOTH' flag | |
12598 | ||
12599 | ||
12600 | `GL_LINE_STIPPLE' flag | |
12601 | ||
12602 | ||
12603 | `GL_COLOR_LOGIC_OP' flag | |
12604 | ||
12605 | ||
12606 | `GL_INDEX_LOGIC_OP' flag | |
12607 | ||
12608 | ||
12609 | `GL_MAP1_'X where X is a map type | |
12610 | ||
12611 | ||
12612 | `GL_MAP2_'X where X is a map type | |
12613 | ||
12614 | ||
12615 | `GL_MULTISAMPLE' flag | |
12616 | ||
12617 | ||
12618 | `GL_NORMALIZE' flag | |
12619 | ||
12620 | ||
12621 | `GL_POINT_SMOOTH' flag | |
12622 | ||
12623 | ||
12624 | `GL_POLYGON_OFFSET_LINE' flag | |
12625 | ||
12626 | ||
12627 | `GL_POLYGON_OFFSET_FILL' flag | |
12628 | ||
12629 | ||
12630 | `GL_POLYGON_OFFSET_POINT' flag | |
12631 | ||
12632 | ||
12633 | `GL_POLYGON_SMOOTH' flag | |
12634 | ||
12635 | ||
12636 | `GL_POLYGON_STIPPLE' flag | |
12637 | ||
12638 | ||
12639 | `GL_SAMPLE_ALPHA_TO_COVERAGE' flag | |
12640 | ||
12641 | ||
12642 | `GL_SAMPLE_ALPHA_TO_ONE' flag | |
12643 | ||
12644 | ||
12645 | `GL_SAMPLE_COVERAGE' flag | |
12646 | ||
12647 | ||
12648 | `GL_SCISSOR_TEST' flag | |
12649 | ||
12650 | ||
12651 | `GL_STENCIL_TEST' flag | |
12652 | ||
12653 | ||
12654 | `GL_TEXTURE_1D' flag | |
12655 | ||
12656 | ||
12657 | `GL_TEXTURE_2D' flag | |
12658 | ||
12659 | ||
12660 | `GL_TEXTURE_3D' flag | |
12661 | ||
12662 | ||
12663 | Flags `GL_TEXTURE_GEN_'X where X is S, T, R, or Q | |
12664 | ||
12665 | `GL_EVAL_BIT' | |
12666 | `GL_MAP1_'X enable bits, where X is a map type | |
12667 | ||
12668 | ||
12669 | `GL_MAP2_'X enable bits, where X is a map type | |
12670 | ||
12671 | ||
12672 | 1D grid endpoints and divisions | |
12673 | ||
12674 | ||
12675 | 2D grid endpoints and divisions | |
12676 | ||
12677 | ||
12678 | `GL_AUTO_NORMAL' enable bit | |
12679 | ||
12680 | `GL_FOG_BIT' | |
12681 | `GL_FOG' enable bit | |
12682 | ||
12683 | ||
12684 | Fog color | |
12685 | ||
12686 | ||
12687 | Fog density | |
12688 | ||
12689 | ||
12690 | Linear fog start | |
12691 | ||
12692 | ||
12693 | Linear fog end | |
12694 | ||
12695 | ||
12696 | Fog index | |
12697 | ||
12698 | ||
12699 | `GL_FOG_MODE' value | |
12700 | ||
12701 | `GL_HINT_BIT' | |
12702 | `GL_PERSPECTIVE_CORRECTION_HINT' setting | |
12703 | ||
12704 | ||
12705 | `GL_POINT_SMOOTH_HINT' setting | |
12706 | ||
12707 | ||
12708 | `GL_LINE_SMOOTH_HINT' setting | |
12709 | ||
12710 | ||
12711 | `GL_POLYGON_SMOOTH_HINT' setting | |
12712 | ||
12713 | ||
12714 | `GL_FOG_HINT' setting | |
12715 | ||
12716 | ||
12717 | `GL_GENERATE_MIPMAP_HINT' setting | |
12718 | ||
12719 | ||
12720 | `GL_TEXTURE_COMPRESSION_HINT' setting | |
12721 | ||
12722 | `GL_LIGHTING_BIT' | |
12723 | `GL_COLOR_MATERIAL' enable bit | |
12724 | ||
12725 | ||
12726 | `GL_COLOR_MATERIAL_FACE' value | |
12727 | ||
12728 | ||
12729 | Color material parameters that are tracking the current color | |
12730 | ||
12731 | ||
12732 | Ambient scene color | |
12733 | ||
12734 | ||
12735 | `GL_LIGHT_MODEL_LOCAL_VIEWER' value | |
12736 | ||
12737 | ||
12738 | `GL_LIGHT_MODEL_TWO_SIDE' setting | |
12739 | ||
12740 | ||
12741 | `GL_LIGHTING' enable bit | |
12742 | ||
12743 | ||
12744 | Enable bit for each light | |
12745 | ||
12746 | ||
12747 | Ambient, diffuse, and specular intensity for each light | |
12748 | ||
12749 | ||
12750 | Direction, position, exponent, and cutoff angle for each light | |
12751 | ||
12752 | ||
12753 | Constant, linear, and quadratic attenuation factors for each light | |
12754 | ||
12755 | ||
12756 | Ambient, diffuse, specular, and emissive color for each material | |
12757 | ||
12758 | ||
12759 | Ambient, diffuse, and specular color indices for each material | |
12760 | ||
12761 | ||
12762 | Specular exponent for each material | |
12763 | ||
12764 | ||
12765 | `GL_SHADE_MODEL' setting | |
12766 | ||
12767 | `GL_LINE_BIT' | |
12768 | `GL_LINE_SMOOTH' flag | |
12769 | ||
12770 | ||
12771 | `GL_LINE_STIPPLE' enable bit | |
12772 | ||
12773 | ||
12774 | Line stipple pattern and repeat counter | |
12775 | ||
12776 | ||
12777 | Line width | |
12778 | ||
12779 | `GL_LIST_BIT' | |
12780 | `GL_LIST_BASE' setting | |
12781 | ||
12782 | `GL_MULTISAMPLE_BIT' | |
12783 | `GL_MULTISAMPLE' flag | |
12784 | ||
12785 | ||
12786 | `GL_SAMPLE_ALPHA_TO_COVERAGE' flag | |
12787 | ||
12788 | ||
12789 | `GL_SAMPLE_ALPHA_TO_ONE' flag | |
12790 | ||
12791 | ||
12792 | `GL_SAMPLE_COVERAGE' flag | |
12793 | ||
12794 | ||
12795 | `GL_SAMPLE_COVERAGE_VALUE' value | |
12796 | ||
12797 | ||
12798 | `GL_SAMPLE_COVERAGE_INVERT' value | |
12799 | ||
12800 | `GL_PIXEL_MODE_BIT' | |
12801 | `GL_RED_BIAS' and `GL_RED_SCALE' settings | |
12802 | ||
12803 | ||
12804 | `GL_GREEN_BIAS' and `GL_GREEN_SCALE' values | |
12805 | ||
12806 | ||
12807 | `GL_BLUE_BIAS' and `GL_BLUE_SCALE' | |
12808 | ||
12809 | ||
12810 | `GL_ALPHA_BIAS' and `GL_ALPHA_SCALE' | |
12811 | ||
12812 | ||
12813 | `GL_DEPTH_BIAS' and `GL_DEPTH_SCALE' | |
12814 | ||
12815 | ||
12816 | `GL_INDEX_OFFSET' and `GL_INDEX_SHIFT' values | |
12817 | ||
12818 | ||
12819 | `GL_MAP_COLOR' and `GL_MAP_STENCIL' flags | |
12820 | ||
12821 | ||
12822 | `GL_ZOOM_X' and `GL_ZOOM_Y' factors | |
12823 | ||
12824 | ||
12825 | `GL_READ_BUFFER' setting | |
12826 | ||
12827 | `GL_POINT_BIT' | |
12828 | `GL_POINT_SMOOTH' flag | |
12829 | ||
12830 | ||
12831 | Point size | |
12832 | ||
12833 | `GL_POLYGON_BIT' | |
12834 | `GL_CULL_FACE' enable bit | |
12835 | ||
12836 | ||
12837 | `GL_CULL_FACE_MODE' value | |
12838 | ||
12839 | ||
12840 | `GL_FRONT_FACE' indicator | |
12841 | ||
12842 | ||
12843 | `GL_POLYGON_MODE' setting | |
12844 | ||
12845 | ||
12846 | `GL_POLYGON_SMOOTH' flag | |
12847 | ||
12848 | ||
12849 | `GL_POLYGON_STIPPLE' enable bit | |
12850 | ||
12851 | ||
12852 | `GL_POLYGON_OFFSET_FILL' flag | |
12853 | ||
12854 | ||
12855 | `GL_POLYGON_OFFSET_LINE' flag | |
12856 | ||
12857 | ||
12858 | `GL_POLYGON_OFFSET_POINT' flag | |
12859 | ||
12860 | ||
12861 | `GL_POLYGON_OFFSET_FACTOR' | |
12862 | ||
12863 | ||
12864 | `GL_POLYGON_OFFSET_UNITS' | |
12865 | ||
12866 | `GL_POLYGON_STIPPLE_BIT' | |
12867 | Polygon stipple image | |
12868 | ||
12869 | `GL_SCISSOR_BIT' | |
12870 | `GL_SCISSOR_TEST' flag | |
12871 | ||
12872 | ||
12873 | Scissor box | |
12874 | ||
12875 | `GL_STENCIL_BUFFER_BIT' | |
12876 | `GL_STENCIL_TEST' enable bit | |
12877 | ||
12878 | ||
12879 | Stencil function and reference value | |
12880 | ||
12881 | ||
12882 | Stencil value mask | |
12883 | ||
12884 | ||
12885 | Stencil fail, pass, and depth buffer pass actions | |
12886 | ||
12887 | ||
12888 | Stencil buffer clear value | |
12889 | ||
12890 | ||
12891 | Stencil buffer writemask | |
12892 | ||
12893 | `GL_TEXTURE_BIT' | |
12894 | Enable bits for the four texture coordinates | |
12895 | ||
12896 | ||
12897 | Border color for each texture image | |
12898 | ||
12899 | ||
12900 | Minification function for each texture image | |
12901 | ||
12902 | ||
12903 | Magnification function for each texture image | |
12904 | ||
12905 | ||
12906 | Texture coordinates and wrap mode for each texture image | |
12907 | ||
12908 | ||
12909 | Color and mode for each texture environment | |
12910 | ||
12911 | ||
12912 | Enable bits `GL_TEXTURE_GEN_'X, X is S, T, R, and Q | |
12913 | ||
12914 | ||
12915 | `GL_TEXTURE_GEN_MODE' setting for S, T, R, and Q | |
12916 | ||
12917 | ||
12918 | `glTexGen' plane equations for S, T, R, and Q | |
12919 | ||
12920 | ||
12921 | Current texture bindings (for example, `GL_TEXTURE_BINDING_2D') | |
12922 | ||
12923 | `GL_TRANSFORM_BIT' | |
12924 | Coefficients of the six clipping planes | |
12925 | ||
12926 | ||
12927 | Enable bits for the user-definable clipping planes | |
12928 | ||
12929 | ||
12930 | `GL_MATRIX_MODE' value | |
12931 | ||
12932 | ||
12933 | `GL_NORMALIZE' flag | |
12934 | ||
12935 | ||
12936 | `GL_RESCALE_NORMAL' flag | |
12937 | ||
12938 | `GL_VIEWPORT_BIT' | |
12939 | Depth range (near and far) | |
12940 | ||
12941 | ||
12942 | Viewport origin and extent | |
12943 | ||
12944 | `glPopAttrib' restores the values of the state variables saved with the | |
12945 | last `glPushAttrib' command. Those not saved are left unchanged. | |
12946 | ||
12947 | It is an error to push attributes onto a full stack or to pop attributes | |
12948 | off an empty stack. In either case, the error flag is set and no other | |
12949 | change is made to GL state. | |
12950 | ||
12951 | Initially, the attribute stack is empty. | |
12952 | ||
12953 | `GL_STACK_OVERFLOW' is generated if `glPushAttrib' is called while the | |
12954 | attribute stack is full. | |
12955 | ||
12956 | `GL_STACK_UNDERFLOW' is generated if `glPopAttrib' is called while the | |
12957 | attribute stack is empty. | |
12958 | ||
12959 | `GL_INVALID_OPERATION' is generated if `glPushAttrib' or `glPopAttrib' | |
12960 | is executed between the execution of `glBegin' and the corresponding | |
12961 | execution of `glEnd'.") | |
8925f36f AW |
12962 | |
12963 | (define-gl-procedure | |
bb894c9d AW |
12964 | ((glPushClientAttrib (mask GLbitfield) -> void) |
12965 | (glPopClientAttrib -> void)) | |
3c9b6116 AW |
12966 | "Push and pop the client attribute stack. |
12967 | ||
12968 | MASK | |
12969 | Specifies a mask that indicates which attributes to save. Values | |
12970 | for MASK are listed below. | |
12971 | ||
12972 | `glPushClientAttrib' takes one argument, a mask that indicates which | |
12973 | groups of client-state variables to save on the client attribute stack. | |
12974 | Symbolic constants are used to set bits in the mask. MASK is typically | |
12975 | constructed by specifying the bitwise-or of several of these constants | |
12976 | together. The special mask `GL_CLIENT_ALL_ATTRIB_BITS' can be used to | |
12977 | save all stackable client state. | |
12978 | ||
12979 | The symbolic mask constants and their associated GL client state are as | |
12980 | follows (the second column lists which attributes are saved): | |
12981 | ||
12982 | `GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes | |
12983 | `GL_CLIENT_VERTEX_ARRAY_BIT' Vertex arrays (and enables) | |
12984 | ||
12985 | `glPopClientAttrib' restores the values of the client-state variables | |
12986 | saved with the last `glPushClientAttrib'. Those not saved are left | |
12987 | unchanged. | |
12988 | ||
12989 | It is an error to push attributes onto a full client attribute stack or | |
12990 | to pop attributes off an empty stack. In either case, the error flag is | |
12991 | set, and no other change is made to GL state. | |
12992 | ||
12993 | Initially, the client attribute stack is empty. | |
12994 | ||
12995 | `GL_STACK_OVERFLOW' is generated if `glPushClientAttrib' is called while | |
12996 | the attribute stack is full. | |
12997 | ||
12998 | `GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while | |
12999 | the attribute stack is empty.") | |
8925f36f AW |
13000 | |
13001 | (define-gl-procedure | |
bb894c9d | 13002 | ((glPushMatrix -> void) (glPopMatrix -> void)) |
3c9b6116 AW |
13003 | "Push and pop the current matrix stack. |
13004 | ||
13005 | There is a stack of matrices for each of the matrix modes. In | |
13006 | `GL_MODELVIEW' mode, the stack depth is at least 32. In the other modes, | |
13007 | `GL_COLOR', `GL_PROJECTION', and `GL_TEXTURE', the depth is at least 2. | |
13008 | The current matrix in any mode is the matrix on the top of the stack for | |
13009 | that mode. | |
13010 | ||
13011 | `glPushMatrix' pushes the current matrix stack down by one, duplicating | |
13012 | the current matrix. That is, after a `glPushMatrix' call, the matrix on | |
13013 | top of the stack is identical to the one below it. | |
13014 | ||
13015 | `glPopMatrix' pops the current matrix stack, replacing the current | |
13016 | matrix with the one below it on the stack. | |
13017 | ||
13018 | Initially, each of the stacks contains one matrix, an identity matrix. | |
13019 | ||
13020 | It is an error to push a full matrix stack or to pop a matrix stack that | |
13021 | contains only a single matrix. In either case, the error flag is set and | |
13022 | no other change is made to GL state. | |
13023 | ||
13024 | `GL_STACK_OVERFLOW' is generated if `glPushMatrix' is called while the | |
13025 | current matrix stack is full. | |
13026 | ||
13027 | `GL_STACK_UNDERFLOW' is generated if `glPopMatrix' is called while the | |
13028 | current matrix stack contains only a single matrix. | |
13029 | ||
13030 | `GL_INVALID_OPERATION' is generated if `glPushMatrix' or `glPopMatrix' | |
13031 | is executed between the execution of `glBegin' and the corresponding | |
13032 | execution of `glEnd'.") | |
8925f36f AW |
13033 | |
13034 | (define-gl-procedure | |
bb894c9d AW |
13035 | ((glPushName (name GLuint) -> void) |
13036 | (glPopName -> void)) | |
3c9b6116 AW |
13037 | "Push and pop the name stack. |
13038 | ||
13039 | NAME | |
13040 | Specifies a name that will be pushed onto the name stack. | |
13041 | ||
13042 | The name stack is used during selection mode to allow sets of rendering | |
13043 | commands to be uniquely identified. It consists of an ordered set of | |
13044 | unsigned integers and is initially empty. | |
13045 | ||
13046 | `glPushName' causes NAME to be pushed onto the name stack. `glPopName' | |
13047 | pops one name off the top of the stack. | |
13048 | ||
13049 | The maximum name stack depth is implementation-dependent; call | |
13050 | `GL_MAX_NAME_STACK_DEPTH' to find out the value for a particular | |
13051 | implementation. It is an error to push a name onto a full stack or to | |
13052 | pop a name off an empty stack. It is also an error to manipulate the | |
13053 | name stack between the execution of `glBegin' and the corresponding | |
13054 | execution of `glEnd'. In any of these cases, the error flag is set and | |
13055 | no other change is made to GL state. | |
13056 | ||
13057 | The name stack is always empty while the render mode is not `GL_SELECT'. | |
13058 | Calls to `glPushName' or `glPopName' while the render mode is not | |
13059 | `GL_SELECT' are ignored. | |
13060 | ||
13061 | `GL_STACK_OVERFLOW' is generated if `glPushName' is called while the | |
13062 | name stack is full. | |
13063 | ||
13064 | `GL_STACK_UNDERFLOW' is generated if `glPopName' is called while the | |
13065 | name stack is empty. | |
13066 | ||
13067 | `GL_INVALID_OPERATION' is generated if `glPushName' or `glPopName' is | |
13068 | executed between a call to `glBegin' and the corresponding call to | |
13069 | `glEnd'.") | |
8925f36f AW |
13070 | |
13071 | (define-gl-procedure | |
bb894c9d AW |
13072 | ((glRasterPos2i (x GLint) (y GLint) -> void) |
13073 | (glRasterPos2d (x GLdouble) (y GLdouble) -> void) | |
13074 | (glRasterPos3i | |
13075 | (x GLint) | |
13076 | (y GLint) | |
13077 | (z GLint) | |
13078 | -> | |
13079 | void) | |
13080 | (glRasterPos3d | |
13081 | (x GLdouble) | |
13082 | (y GLdouble) | |
13083 | (z GLdouble) | |
13084 | -> | |
13085 | void) | |
13086 | (glRasterPos4i | |
13087 | (x GLint) | |
13088 | (y GLint) | |
13089 | (z GLint) | |
13090 | (w GLint) | |
13091 | -> | |
13092 | void) | |
13093 | (glRasterPos4d | |
13094 | (x GLdouble) | |
13095 | (y GLdouble) | |
13096 | (z GLdouble) | |
13097 | (w GLdouble) | |
13098 | -> | |
13099 | void)) | |
3c9b6116 AW |
13100 | "Specify the raster position for pixel operations. |
13101 | ||
13102 | X | |
13103 | Y | |
13104 | ||
13105 | Z | |
13106 | ||
13107 | W | |
13108 | ||
13109 | Specify the X , Y , Z , and W object coordinates (if present) for | |
13110 | the raster position. | |
13111 | ||
13112 | The GL maintains a 3D position in window coordinates. This position, | |
13113 | called the raster position, is used to position pixel and bitmap write | |
13114 | operations. It is maintained with subpixel accuracy. See `glBitmap', | |
13115 | `glDrawPixels', and `glCopyPixels'. | |
13116 | ||
13117 | The current raster position consists of three window coordinates (X , Y | |
13118 | , Z ), a clip coordinate value (W ), an eye coordinate distance, a valid | |
13119 | bit, and associated color data and texture coordinates. The W coordinate | |
13120 | is a clip coordinate, because W is not projected to window coordinates. | |
13121 | `glRasterPos4' specifies object coordinates X , Y , Z , and W | |
13122 | explicitly. `glRasterPos3' specifies object coordinate X , Y , and Z | |
13123 | explicitly, while W is implicitly set to 1. `glRasterPos2' uses the | |
13124 | argument values for X and Y while implicitly setting Z and W to 0 and 1. | |
13125 | ||
13126 | The object coordinates presented by `glRasterPos' are treated just like | |
13127 | those of a `glVertex' command: They are transformed by the current | |
13128 | modelview and projection matrices and passed to the clipping stage. If | |
13129 | the vertex is not culled, then it is projected and scaled to window | |
13130 | coordinates, which become the new current raster position, and the | |
13131 | `GL_CURRENT_RASTER_POSITION_VALID' flag is set. If the vertex IS culled, | |
13132 | then the valid bit is cleared and the current raster position and | |
13133 | associated color and texture coordinates are undefined. | |
13134 | ||
13135 | The current raster position also includes some associated color data and | |
13136 | texture coordinates. If lighting is enabled, then | |
13137 | `GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX' | |
13138 | (in color index mode) is set to the color produced by the lighting | |
13139 | calculation (see `glLight', `glLightModel', and `glShadeModel'). If | |
13140 | lighting is disabled, current color (in RGBA mode, state variable | |
13141 | `GL_CURRENT_COLOR') or color index (in color index mode, state variable | |
13142 | `GL_CURRENT_INDEX') is used to update the current raster color. | |
13143 | `GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated. | |
13144 | ||
13145 | Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of | |
13146 | `GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture | |
13147 | generation functions (see `glTexGen'). Finally, the distance from the | |
13148 | origin of the eye coordinate system to the vertex as transformed by only | |
13149 | the modelview matrix replaces `GL_CURRENT_RASTER_DISTANCE'. | |
13150 | ||
13151 | Initially, the current raster position is (0, 0, 0, 1), the current | |
13152 | raster distance is 0, the valid bit is set, the associated RGBA color is | |
13153 | (1, 1, 1, 1), the associated color index is 1, and the associated | |
13154 | texture coordinates are (0, 0, 0, 1). In RGBA mode, | |
13155 | `GL_CURRENT_RASTER_INDEX' is always 1; in color index mode, the current | |
13156 | raster RGBA color always maintains its initial value. | |
13157 | ||
13158 | `GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between | |
13159 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
13160 | ||
13161 | (define-gl-procedure | |
bb894c9d | 13162 | ((glReadBuffer (mode GLenum) -> void)) |
3c9b6116 AW |
13163 | "Select a color buffer source for pixels. |
13164 | ||
13165 | MODE | |
13166 | Specifies a color buffer. Accepted values are `GL_FRONT_LEFT', | |
13167 | `GL_FRONT_RIGHT', `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', | |
13168 | `GL_BACK', `GL_LEFT', `GL_RIGHT', and `GL_AUX'I, where I is between | |
13169 | 0 and the value of `GL_AUX_BUFFERS' minus 1. | |
13170 | ||
13171 | `glReadBuffer' specifies a color buffer as the source for subsequent | |
13172 | `glReadPixels', `glCopyTexImage1D', `glCopyTexImage2D', | |
13173 | `glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', and | |
13174 | `glCopyPixels' commands. MODE accepts one of twelve or more predefined | |
13175 | values. (`GL_AUX0' through `GL_AUX3' are always defined.) In a fully | |
13176 | configured system, `GL_FRONT', `GL_LEFT', and `GL_FRONT_LEFT' all name | |
13177 | the front left buffer, `GL_FRONT_RIGHT' and `GL_RIGHT' name the front | |
13178 | right buffer, and `GL_BACK_LEFT' and `GL_BACK' name the back left | |
13179 | buffer. | |
13180 | ||
13181 | Nonstereo double-buffered configurations have only a front left and a | |
13182 | back left buffer. Single-buffered configurations have a front left and a | |
13183 | front right buffer if stereo, and only a front left buffer if nonstereo. | |
13184 | It is an error to specify a nonexistent buffer to `glReadBuffer'. | |
13185 | ||
13186 | MODE is initially `GL_FRONT' in single-buffered configurations and | |
13187 | `GL_BACK' in double-buffered configurations. | |
13188 | ||
13189 | `GL_INVALID_ENUM' is generated if MODE is not one of the twelve (or | |
13190 | more) accepted values. | |
13191 | ||
13192 | `GL_INVALID_OPERATION' is generated if MODE specifies a buffer that does | |
13193 | not exist. | |
13194 | ||
13195 | `GL_INVALID_OPERATION' is generated if `glReadBuffer' is executed | |
13196 | between the execution of `glBegin' and the corresponding execution of | |
13197 | `glEnd'.") | |
13198 | ||
13199 | (define-gl-procedure | |
bb894c9d AW |
13200 | ((glReadPixels |
13201 | (x GLint) | |
13202 | (y GLint) | |
13203 | (width GLsizei) | |
13204 | (height GLsizei) | |
13205 | (format GLenum) | |
13206 | (type GLenum) | |
13207 | (data *) | |
13208 | -> | |
13209 | void)) | |
3c9b6116 AW |
13210 | "Read a block of pixels from the frame buffer. |
13211 | ||
13212 | X | |
13213 | Y | |
13214 | ||
13215 | Specify the window coordinates of the first pixel that is read from | |
13216 | the frame buffer. This location is the lower left corner of a | |
13217 | rectangular block of pixels. | |
13218 | ||
13219 | WIDTH | |
13220 | HEIGHT | |
13221 | ||
13222 | Specify the dimensions of the pixel rectangle. WIDTH and HEIGHT of | |
13223 | one correspond to a single pixel. | |
13224 | ||
13225 | FORMAT | |
13226 | Specifies the format of the pixel data. The following symbolic | |
13227 | values are accepted: `GL_COLOR_INDEX', `GL_STENCIL_INDEX', | |
13228 | `GL_DEPTH_COMPONENT', `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', | |
13229 | `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and | |
13230 | `GL_LUMINANCE_ALPHA'. | |
13231 | ||
13232 | TYPE | |
13233 | Specifies the data type of the pixel data. Must be one of | |
13234 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
13235 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
13236 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
13237 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
13238 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
13239 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
13240 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
13241 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
13242 | ||
13243 | DATA | |
13244 | Returns the pixel data. | |
13245 | ||
13246 | `glReadPixels' returns pixel data from the frame buffer, starting with | |
13247 | the pixel whose lower left corner is at location (X, Y), into client | |
13248 | memory starting at location DATA. Several parameters control the | |
13249 | processing of the pixel data before it is placed into client memory. | |
13250 | These parameters are set with three commands: `glPixelStore', | |
13251 | `glPixelTransfer', and `glPixelMap'. This reference page describes the | |
13252 | effects on `glReadPixels' of most, but not all of the parameters | |
13253 | specified by these three commands. | |
13254 | ||
13255 | If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER' | |
13256 | target (see `glBindBuffer') while a block of pixels is requested, DATA | |
13257 | is treated as a byte offset into the buffer object's data store rather | |
13258 | than a pointer to client memory. | |
13259 | ||
13260 | When the `ARB_imaging' extension is supported, the pixel data may be | |
13261 | processed by additional operations including color table lookup, color | |
13262 | matrix transformations, convolutions, histograms, and minimum and | |
13263 | maximum pixel value computations. | |
13264 | ||
13265 | `glReadPixels' returns values from each pixel with lower left corner at | |
13266 | (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said to be the | |
13267 | I th pixel in the J th row. Pixels are returned in row order from the | |
13268 | lowest to the highest row, left to right in each row. | |
13269 | ||
13270 | FORMAT specifies the format for the returned pixel values; accepted | |
13271 | values are: | |
13272 | ||
13273 | `GL_COLOR_INDEX' | |
13274 | Color indices are read from the color buffer selected by | |
13275 | `glReadBuffer'. Each index is converted to fixed point, shifted | |
13276 | left or right depending on the value and sign of `GL_INDEX_SHIFT', | |
13277 | and added to `GL_INDEX_OFFSET'. If `GL_MAP_COLOR' is `GL_TRUE', | |
13278 | indices are replaced by their mappings in the table | |
13279 | `GL_PIXEL_MAP_I_TO_I'. | |
13280 | ||
13281 | `GL_STENCIL_INDEX' | |
13282 | Stencil values are read from the stencil buffer. Each index is | |
13283 | converted to fixed point, shifted left or right depending on the | |
13284 | value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'. | |
13285 | If `GL_MAP_STENCIL' is `GL_TRUE', indices are replaced by their | |
13286 | mappings in the table `GL_PIXEL_MAP_S_TO_S'. | |
13287 | ||
13288 | `GL_DEPTH_COMPONENT' | |
13289 | Depth values are read from the depth buffer. Each component is | |
13290 | converted to floating point such that the minimum depth value maps | |
13291 | to 0 and the maximum value maps to 1. Each component is then | |
13292 | multiplied by `GL_DEPTH_SCALE', added to `GL_DEPTH_BIAS', and | |
13293 | finally clamped to the range [0,1] . | |
13294 | ||
13295 | `GL_RED' | |
13296 | `GL_GREEN' | |
13297 | `GL_BLUE' | |
13298 | `GL_ALPHA' | |
13299 | `GL_RGB' | |
13300 | `GL_BGR' | |
13301 | `GL_RGBA' | |
13302 | `GL_BGRA' | |
13303 | `GL_LUMINANCE' | |
13304 | `GL_LUMINANCE_ALPHA' | |
13305 | Processing differs depending on whether color buffers store color | |
13306 | indices or RGBA color components. If color indices are stored, they | |
13307 | are read from the color buffer selected by `glReadBuffer'. Each | |
13308 | index is converted to fixed point, shifted left or right depending | |
13309 | on the value and sign of `GL_INDEX_SHIFT', and added to | |
13310 | `GL_INDEX_OFFSET'. Indices are then replaced by the red, green, | |
13311 | blue, and alpha values obtained by indexing the tables | |
13312 | `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G', | |
13313 | `GL_PIXEL_MAP_I_TO_B', and `GL_PIXEL_MAP_I_TO_A'. Each table must | |
13314 | be of size 2^N , but N may be different for different tables. | |
13315 | Before an index is used to look up a value in a table of size 2^N , | |
13316 | it must be masked against 2^N-1 . | |
13317 | ||
13318 | If RGBA color components are stored in the color buffers, they are | |
13319 | read from the color buffer selected by `glReadBuffer'. Each color | |
13320 | component is converted to floating point such that zero intensity | |
13321 | maps to 0.0 and full intensity maps to 1.0. Each component is then | |
13322 | multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where C is | |
13323 | RED, GREEN, BLUE, or ALPHA. Finally, if `GL_MAP_COLOR' is | |
13324 | `GL_TRUE', each component is clamped to the range [0,1] , scaled to | |
13325 | the size of its corresponding table, and is then replaced by its | |
13326 | mapping in the table `GL_PIXEL_MAP_c_TO_c', where C is R, G, B, or | |
13327 | A. | |
13328 | ||
13329 | Unneeded data is then discarded. For example, `GL_RED' discards the | |
13330 | green, blue, and alpha components, while `GL_RGB' discards only the | |
13331 | alpha component. `GL_LUMINANCE' computes a single-component value | |
13332 | as the sum of the red, green, and blue components, and | |
13333 | `GL_LUMINANCE_ALPHA' does the same, while keeping alpha as a second | |
13334 | value. The final values are clamped to the range [0,1] . | |
13335 | ||
13336 | The shift, scale, bias, and lookup factors just described are all | |
13337 | specified by `glPixelTransfer'. The lookup table contents themselves are | |
13338 | specified by `glPixelMap'. | |
13339 | ||
13340 | Finally, the indices or components are converted to the proper format, | |
13341 | as specified by TYPE. If FORMAT is `GL_COLOR_INDEX' or | |
13342 | `GL_STENCIL_INDEX' and TYPE is not `GL_FLOAT', each index is masked with | |
13343 | the mask value given in the following table. If TYPE is `GL_FLOAT', then | |
13344 | each integer index is converted to single-precision floating-point | |
13345 | format. | |
13346 | ||
13347 | If FORMAT is `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', | |
13348 | `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA' | |
13349 | and TYPE is not `GL_FLOAT', each component is multiplied by the | |
13350 | multiplier shown in the following table. If type is `GL_FLOAT', then | |
13351 | each component is passed as is (or converted to the client's | |
13352 | single-precision floating-point format if it is different from the one | |
13353 | used by the GL). | |
13354 | ||
13355 | ||
13356 | ||
13357 | TYPE | |
13358 | *Index Mask*, *Component Conversion* | |
13359 | ||
13360 | `GL_UNSIGNED_BYTE' | |
13361 | 2^8-1 , (2^8-1,)\u2062C | |
13362 | ||
13363 | `GL_BYTE' | |
13364 | 2^7-1 , (2^8-1,)\u2062C-1,/2 | |
13365 | ||
13366 | `GL_BITMAP' | |
13367 | 1 , 1 | |
13368 | ||
13369 | `GL_UNSIGNED_SHORT' | |
13370 | 2^16-1 , (2^16-1,)\u2062C | |
13371 | ||
13372 | `GL_SHORT' | |
13373 | 2^15-1 , (2^16-1,)\u2062C-1,/2 | |
13374 | ||
13375 | `GL_UNSIGNED_INT' | |
13376 | 2^32-1 , (2^32-1,)\u2062C | |
13377 | ||
13378 | `GL_INT' | |
13379 | 2^31-1 , (2^32-1,)\u2062C-1,/2 | |
13380 | ||
13381 | `GL_FLOAT' | |
13382 | none , C | |
13383 | ||
13384 | Return values are placed in memory as follows. If FORMAT is | |
13385 | `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', `GL_RED', | |
13386 | `GL_GREEN', `GL_BLUE', `GL_ALPHA', or `GL_LUMINANCE', a single value is | |
13387 | returned and the data for the I th pixel in the J th row is placed in | |
13388 | location (J,)\u2062WIDTH+I . `GL_RGB' and `GL_BGR' return three values, | |
13389 | `GL_RGBA' and `GL_BGRA' return four values, and `GL_LUMINANCE_ALPHA' | |
13390 | returns two values for each pixel, with all values corresponding to a | |
13391 | single pixel occupying contiguous space in DATA. Storage parameters set | |
13392 | by `glPixelStore', such as `GL_PACK_LSB_FIRST' and `GL_PACK_SWAP_BYTES', | |
13393 | affect the way that data is written into memory. See `glPixelStore' for | |
13394 | a description. | |
13395 | ||
13396 | `GL_INVALID_ENUM' is generated if FORMAT or TYPE is not an accepted | |
13397 | value. | |
13398 | ||
13399 | `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not | |
13400 | `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'. | |
13401 | ||
13402 | `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative. | |
13403 | ||
13404 | `GL_INVALID_OPERATION' is generated if FORMAT is `GL_COLOR_INDEX' and | |
13405 | the color buffers store RGBA color components. | |
13406 | ||
13407 | `GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and | |
13408 | there is no stencil buffer. | |
13409 | ||
13410 | `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT' | |
13411 | and there is no depth buffer. | |
13412 | ||
13413 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
13414 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
13415 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
13416 | is not `GL_RGB'. | |
13417 | ||
13418 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
13419 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
13420 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
13421 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
13422 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
13423 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
13424 | ||
13425 | The formats `GL_BGR', and `GL_BGRA' and types `GL_UNSIGNED_BYTE_3_3_2', | |
13426 | `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5', | |
13427 | `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4', | |
13428 | `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1', | |
13429 | `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8', | |
13430 | `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and | |
13431 | `GL_UNSIGNED_INT_2_10_10_10_REV' are available only if the GL version is | |
13432 | 1.2 or greater. | |
13433 | ||
13434 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
13435 | bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data | |
13436 | store is currently mapped. | |
13437 | ||
13438 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
13439 | bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed | |
13440 | to the buffer object such that the memory writes required would exceed | |
13441 | the data store size. | |
13442 | ||
13443 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
13444 | bound to the `GL_PIXEL_PACK_BUFFER' target and DATA is not evenly | |
13445 | divisible into the number of bytes needed to store in memory a datum | |
13446 | indicated by TYPE. | |
8925f36f | 13447 | |
3c9b6116 AW |
13448 | `GL_INVALID_OPERATION' is generated if `glReadPixels' is executed |
13449 | between the execution of `glBegin' and the corresponding execution of | |
13450 | `glEnd'.") | |
8925f36f AW |
13451 | |
13452 | (define-gl-procedure | |
bb894c9d AW |
13453 | ((glRectd |
13454 | (x1 GLdouble) | |
13455 | (y1 GLdouble) | |
13456 | (x2 GLdouble) | |
13457 | (y2 GLdouble) | |
13458 | -> | |
13459 | void) | |
13460 | (glRecti | |
13461 | (x1 GLint) | |
13462 | (y1 GLint) | |
13463 | (x2 GLint) | |
13464 | (y2 GLint) | |
13465 | -> | |
13466 | void)) | |
3c9b6116 | 13467 | "Draw a rectangle. |
8925f36f | 13468 | |
3c9b6116 AW |
13469 | X1 |
13470 | Y1 | |
8925f36f | 13471 | |
3c9b6116 | 13472 | Specify one vertex of a rectangle. |
8925f36f | 13473 | |
3c9b6116 AW |
13474 | X2 |
13475 | Y2 | |
8925f36f | 13476 | |
3c9b6116 | 13477 | Specify the opposite vertex of the rectangle. |
8925f36f | 13478 | |
3c9b6116 AW |
13479 | `glRect' supports efficient specification of rectangles as two corner |
13480 | points. Each rectangle command takes four arguments, organized either as | |
13481 | two consecutive pairs of (X,Y) coordinates or as two pointers to arrays, | |
13482 | each containing an (X,Y) pair. The resulting rectangle is defined in the | |
13483 | Z=0 plane. | |
8925f36f | 13484 | |
3c9b6116 AW |
13485 | `glRect'(X1, Y1, X2, Y2) is exactly equivalent to the following |
13486 | sequence: Note that if the second vertex is above and to the right of | |
13487 | the first vertex, the rectangle is constructed with a counterclockwise | |
13488 | winding. | |
8925f36f | 13489 | |
3c9b6116 AW |
13490 | |
13491 | glBegin(`GL_POLYGON'); | |
13492 | glVertex2(X1, Y1); | |
13493 | glVertex2(X2, Y1); | |
13494 | glVertex2(X2, Y2); | |
13495 | glVertex2(X1, Y2); | |
13496 | glEnd(); | |
8925f36f | 13497 | |
3c9b6116 AW |
13498 | `GL_INVALID_OPERATION' is generated if `glRect' is executed between the |
13499 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
13500 | |
13501 | (define-gl-procedure | |
bb894c9d | 13502 | ((glRenderMode (mode GLenum) -> GLint)) |
3c9b6116 | 13503 | "Set rasterization mode. |
8925f36f | 13504 | |
3c9b6116 AW |
13505 | MODE |
13506 | Specifies the rasterization mode. Three values are accepted: | |
13507 | `GL_RENDER', `GL_SELECT', and `GL_FEEDBACK'. The initial value is | |
13508 | `GL_RENDER'. | |
13509 | ||
13510 | `glRenderMode' sets the rasterization mode. It takes one argument, MODE, | |
13511 | which can assume one of three predefined values: | |
13512 | ||
13513 | `GL_RENDER' | |
13514 | Render mode. Primitives are rasterized, producing pixel fragments, | |
13515 | which are written into the frame buffer. This is the normal mode | |
13516 | and also the default mode. | |
13517 | ||
13518 | `GL_SELECT' | |
13519 | Selection mode. No pixel fragments are produced, and no change to | |
13520 | the frame buffer contents is made. Instead, a record of the names | |
13521 | of primitives that would have been drawn if the render mode had | |
13522 | been `GL_RENDER' is returned in a select buffer, which must be | |
13523 | created (see `glSelectBuffer') before selection mode is entered. | |
13524 | ||
13525 | `GL_FEEDBACK' | |
13526 | Feedback mode. No pixel fragments are produced, and no change to | |
13527 | the frame buffer contents is made. Instead, the coordinates and | |
13528 | attributes of vertices that would have been drawn if the render | |
13529 | mode had been `GL_RENDER' is returned in a feedback buffer, which | |
13530 | must be created (see `glFeedbackBuffer') before feedback mode is | |
13531 | entered. | |
13532 | ||
13533 | The return value of `glRenderMode' is determined by the render mode at | |
13534 | the time `glRenderMode' is called, rather than by MODE. The values | |
13535 | returned for the three render modes are as follows: | |
13536 | ||
13537 | `GL_RENDER' | |
13538 | 0. | |
13539 | ||
13540 | `GL_SELECT' | |
13541 | The number of hit records transferred to the select buffer. | |
13542 | ||
13543 | `GL_FEEDBACK' | |
13544 | The number of values (not vertices) transferred to the feedback | |
13545 | buffer. | |
13546 | ||
13547 | See the `glSelectBuffer' and `glFeedbackBuffer' reference pages for more | |
13548 | details concerning selection and feedback operation. | |
13549 | ||
13550 | `GL_INVALID_ENUM' is generated if MODE is not one of the three accepted | |
13551 | values. | |
13552 | ||
13553 | `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while | |
13554 | the render mode is `GL_SELECT', or if `glRenderMode' is called with | |
13555 | argument `GL_SELECT' before `glSelectBuffer' is called at least once. | |
13556 | ||
13557 | `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called | |
13558 | while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called | |
13559 | with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least | |
13560 | once. | |
13561 | ||
13562 | `GL_INVALID_OPERATION' is generated if `glRenderMode' is executed | |
13563 | between the execution of `glBegin' and the corresponding execution of | |
13564 | `glEnd'.") | |
8925f36f AW |
13565 | |
13566 | (define-gl-procedure | |
bb894c9d | 13567 | ((glResetHistogram (target GLenum) -> void)) |
3c9b6116 AW |
13568 | "Reset histogram table entries to zero. |
13569 | ||
13570 | TARGET | |
13571 | Must be `GL_HISTOGRAM'. | |
13572 | ||
13573 | `glResetHistogram' resets all the elements of the current histogram | |
13574 | table to zero. | |
13575 | ||
13576 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'. | |
13577 | ||
13578 | `GL_INVALID_OPERATION' is generated if `glResetHistogram' is executed | |
13579 | between the execution of `glBegin' and the corresponding execution of | |
13580 | `glEnd'.") | |
8925f36f AW |
13581 | |
13582 | (define-gl-procedure | |
bb894c9d | 13583 | ((glResetMinmax (target GLenum) -> void)) |
3c9b6116 AW |
13584 | "Reset minmax table entries to initial values. |
13585 | ||
13586 | TARGET | |
13587 | Must be `GL_MINMAX'. | |
13588 | ||
13589 | `glResetMinmax' resets the elements of the current minmax table to their | |
13590 | initial values: the ``maximum'' element receives the minimum possible | |
13591 | component values, and the ``minimum'' element receives the maximum | |
13592 | possible component values. | |
13593 | ||
13594 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'. | |
13595 | ||
13596 | `GL_INVALID_OPERATION' is generated if `glResetMinmax' is executed | |
13597 | between the execution of `glBegin' and the corresponding execution of | |
13598 | `glEnd'.") | |
8925f36f AW |
13599 | |
13600 | (define-gl-procedure | |
bb894c9d AW |
13601 | ((glRotated |
13602 | (angle GLdouble) | |
13603 | (x GLdouble) | |
13604 | (y GLdouble) | |
13605 | (z GLdouble) | |
13606 | -> | |
13607 | void)) | |
3c9b6116 AW |
13608 | "Multiply the current matrix by a rotation matrix. |
13609 | ||
13610 | ANGLE | |
13611 | Specifies the angle of rotation, in degrees. | |
13612 | ||
13613 | X | |
13614 | Y | |
13615 | ||
13616 | Z | |
13617 | ||
13618 | Specify the X, Y, and Z coordinates of a vector, respectively. | |
13619 | ||
13620 | `glRotate' produces a rotation of ANGLE degrees around the vector (X,YZ) | |
13621 | . The current matrix (see `glMatrixMode') is multiplied by a rotation | |
13622 | matrix with the product replacing the current matrix, as if | |
13623 | `glMultMatrix' were called with the following matrix as its argument: | |
13624 | ||
13625 | ((X^2\u2061(1-C,)+C X\u2062Y\u2061(1-C,)-Z\u2062S X\u2062Z\u2061(1-C,)+Y\u2062S 0), (Y\u2062X\u2061(1-C,)+Z\u2062S | |
13626 | Y^2\u2061(1-C,)+C Y\u2062Z\u2061(1-C,)-X\u2062S 0), (X\u2062Z\u2061(1-C,)-Y\u2062S Y\u2062Z\u2061(1-C,)+X\u2062S | |
13627 | Z^2\u2061(1-C,)+C 0), (0 0 0 1),) | |
13628 | ||
13629 | ||
13630 | ||
13631 | Where C=COS\u2061(ANGLE,) , S=SIN\u2061(ANGLE,) , and ∥(X,YZ),∥=1 (if not, the GL | |
13632 | will normalize this vector). | |
13633 | ||
13634 | ||
13635 | ||
13636 | ||
13637 | ||
13638 | If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all | |
13639 | objects drawn after `glRotate' is called are rotated. Use `glPushMatrix' | |
13640 | and `glPopMatrix' to save and restore the unrotated coordinate system. | |
13641 | ||
13642 | `GL_INVALID_OPERATION' is generated if `glRotate' is executed between | |
13643 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
13644 | |
13645 | (define-gl-procedure | |
bb894c9d AW |
13646 | ((glSampleCoverage |
13647 | (value GLclampf) | |
13648 | (invert GLboolean) | |
13649 | -> | |
13650 | void)) | |
3c9b6116 AW |
13651 | "Specify multisample coverage parameters. |
13652 | ||
13653 | VALUE | |
13654 | Specify a single floating-point sample coverage value. The value is | |
13655 | clamped to the range [0,1] . The initial value is 1.0. | |
13656 | ||
13657 | INVERT | |
13658 | Specify a single boolean value representing if the coverage masks | |
13659 | should be inverted. `GL_TRUE' and `GL_FALSE' are accepted. The | |
13660 | initial value is `GL_FALSE'. | |
13661 | ||
13662 | Multisampling samples a pixel multiple times at various | |
13663 | implementation-dependent subpixel locations to generate antialiasing | |
13664 | effects. Multisampling transparently antialiases points, lines, | |
13665 | polygons, bitmaps, and images if it is enabled. | |
13666 | ||
13667 | VALUE is used in constructing a temporary mask used in determining which | |
13668 | samples will be used in resolving the final fragment color. This mask is | |
13669 | bitwise-anded with the coverage mask generated from the multisampling | |
13670 | computation. If the INVERT flag is set, the temporary mask is inverted | |
13671 | (all bits flipped) and then the bitwise-and is computed. | |
13672 | ||
13673 | If an implementation does not have any multisample buffers available, or | |
13674 | multisampling is disabled, rasterization occurs with only a single | |
13675 | sample computing a pixel's final RGB color. | |
13676 | ||
13677 | Provided an implementation supports multisample buffers, and | |
13678 | multisampling is enabled, then a pixel's final color is generated by | |
13679 | combining several samples per pixel. Each sample contains color, depth, | |
13680 | and stencil information, allowing those operations to be performed on | |
13681 | each sample. | |
13682 | ||
13683 | `GL_INVALID_OPERATION' is generated if `glSampleCoverage' is executed | |
13684 | between the execution of `glBegin' and the corresponding execution of | |
13685 | `glEnd'.") | |
8925f36f AW |
13686 | |
13687 | (define-gl-procedure | |
bb894c9d AW |
13688 | ((glScaled |
13689 | (x GLdouble) | |
13690 | (y GLdouble) | |
13691 | (z GLdouble) | |
13692 | -> | |
13693 | void)) | |
3c9b6116 AW |
13694 | "Multiply the current matrix by a general scaling matrix. |
13695 | ||
13696 | X | |
13697 | Y | |
13698 | ||
13699 | Z | |
13700 | ||
13701 | Specify scale factors along the X, Y, and Z axes, respectively. | |
13702 | ||
13703 | `glScale' produces a nonuniform scaling along the X, Y, and Z axes. The | |
13704 | three parameters indicate the desired scale factor along each of the | |
13705 | three axes. | |
13706 | ||
13707 | The current matrix (see `glMatrixMode') is multiplied by this scale | |
13708 | matrix, and the product replaces the current matrix as if `glMultMatrix' | |
13709 | were called with the following matrix as its argument: | |
13710 | ||
13711 | ((X 0 0 0), (0 Y 0 0), (0 0 Z 0), (0 0 0 1),) | |
13712 | ||
13713 | If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all | |
13714 | objects drawn after `glScale' is called are scaled. | |
13715 | ||
13716 | Use `glPushMatrix' and `glPopMatrix' to save and restore the unscaled | |
13717 | coordinate system. | |
13718 | ||
13719 | `GL_INVALID_OPERATION' is generated if `glScale' is executed between the | |
13720 | execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
13721 | |
13722 | (define-gl-procedure | |
bb894c9d AW |
13723 | ((glScissor |
13724 | (x GLint) | |
13725 | (y GLint) | |
13726 | (width GLsizei) | |
13727 | (height GLsizei) | |
13728 | -> | |
13729 | void)) | |
3c9b6116 AW |
13730 | "Define the scissor box. |
13731 | ||
13732 | X | |
13733 | Y | |
13734 | ||
13735 | Specify the lower left corner of the scissor box. Initially (0, 0). | |
13736 | ||
13737 | WIDTH | |
13738 | HEIGHT | |
13739 | ||
13740 | Specify the width and height of the scissor box. When a GL context | |
13741 | is first attached to a window, WIDTH and HEIGHT are set to the | |
13742 | dimensions of that window. | |
8925f36f | 13743 | |
3c9b6116 AW |
13744 | `glScissor' defines a rectangle, called the scissor box, in window |
13745 | coordinates. The first two arguments, X and Y, specify the lower left | |
13746 | corner of the box. WIDTH and HEIGHT specify the width and height of the | |
13747 | box. | |
13748 | ||
13749 | To enable and disable the scissor test, call `glEnable' and `glDisable' | |
13750 | with argument `GL_SCISSOR_TEST'. The test is initially disabled. While | |
13751 | the test is enabled, only pixels that lie within the scissor box can be | |
13752 | modified by drawing commands. Window coordinates have integer values at | |
13753 | the shared corners of frame buffer pixels. `glScissor(0,0,1,1)' allows | |
13754 | modification of only the lower left pixel in the window, and | |
13755 | `glScissor(0,0,0,0)' doesn't allow modification of any pixels in the | |
13756 | window. | |
13757 | ||
13758 | When the scissor test is disabled, it is as though the scissor box | |
13759 | includes the entire window. | |
13760 | ||
13761 | `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative. | |
13762 | ||
13763 | `GL_INVALID_OPERATION' is generated if `glScissor' is executed between | |
13764 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
13765 | |
13766 | (define-gl-procedure | |
bb894c9d AW |
13767 | ((glSecondaryColorPointer |
13768 | (size GLint) | |
13769 | (type GLenum) | |
13770 | (stride GLsizei) | |
13771 | (pointer *) | |
13772 | -> | |
13773 | void)) | |
3c9b6116 | 13774 | "Define an array of secondary colors. |
8925f36f | 13775 | |
3c9b6116 AW |
13776 | SIZE |
13777 | Specifies the number of components per color. Must be 3. | |
13778 | ||
13779 | TYPE | |
13780 | Specifies the data type of each color component in the array. | |
13781 | Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', | |
13782 | `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or | |
13783 | `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'. | |
13784 | ||
13785 | STRIDE | |
13786 | Specifies the byte offset between consecutive colors. If STRIDE is | |
13787 | 0, the colors are understood to be tightly packed in the array. The | |
13788 | initial value is 0. | |
13789 | ||
13790 | POINTER | |
13791 | Specifies a pointer to the first component of the first color | |
13792 | element in the array. The initial value is 0. | |
13793 | ||
13794 | `glSecondaryColorPointer' specifies the location and data format of an | |
13795 | array of color components to use when rendering. SIZE specifies the | |
13796 | number of components per color, and must be 3. TYPE specifies the data | |
13797 | type of each color component, and STRIDE specifies the byte stride from | |
13798 | one color to the next, allowing vertices and attributes to be packed | |
13799 | into a single array or stored in separate arrays. | |
13800 | ||
13801 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' | |
13802 | target (see `glBindBuffer') while a secondary color array is specified, | |
13803 | POINTER is treated as a byte offset into the buffer object's data store. | |
13804 | Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as | |
13805 | secondary color vertex array client-side state | |
13806 | (`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING'). | |
13807 | ||
13808 | When a secondary color array is specified, SIZE, TYPE, STRIDE, and | |
13809 | POINTER are saved as client-side state, in addition to the current | |
13810 | vertex array buffer object binding. | |
13811 | ||
13812 | To enable and disable the secondary color array, call | |
13813 | `glEnableClientState' and `glDisableClientState' with the argument | |
13814 | `GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array is | |
13815 | used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays', | |
13816 | `glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is | |
13817 | called. | |
13818 | ||
13819 | `GL_INVALID_VALUE' is generated if SIZE is not 3. | |
13820 | ||
13821 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
13822 | ||
13823 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
8925f36f AW |
13824 | |
13825 | (define-gl-procedure | |
bb894c9d AW |
13826 | ((glSecondaryColor3i |
13827 | (red GLint) | |
13828 | (green GLint) | |
13829 | (blue GLint) | |
13830 | -> | |
13831 | void) | |
13832 | (glSecondaryColor3d | |
13833 | (red GLdouble) | |
13834 | (green GLdouble) | |
13835 | (blue GLdouble) | |
13836 | -> | |
13837 | void) | |
13838 | (glSecondaryColor3ui | |
13839 | (red GLuint) | |
13840 | (green GLuint) | |
13841 | (blue GLuint) | |
13842 | -> | |
13843 | void)) | |
3c9b6116 AW |
13844 | "Set the current secondary color. |
13845 | ||
13846 | RED | |
13847 | GREEN | |
13848 | ||
13849 | BLUE | |
13850 | ||
13851 | Specify new red, green, and blue values for the current secondary | |
13852 | color. | |
13853 | ||
13854 | The GL stores both a primary four-valued RGBA color and a secondary | |
13855 | four-valued RGBA color (where alpha is always set to 0.0) that is | |
13856 | associated with every vertex. | |
13857 | ||
13858 | The secondary color is interpolated and applied to each fragment during | |
13859 | rasterization when `GL_COLOR_SUM' is enabled. When lighting is enabled, | |
13860 | and `GL_SEPARATE_SPECULAR_COLOR' is specified, the value of the | |
13861 | secondary color is assigned the value computed from the specular term of | |
13862 | the lighting computation. Both the primary and secondary current colors | |
13863 | are applied to each fragment, regardless of the state of `GL_COLOR_SUM', | |
13864 | under such conditions. When `GL_SEPARATE_SPECULAR_COLOR' is specified, | |
13865 | the value returned from querying the current secondary color is | |
13866 | undefined. | |
13867 | ||
13868 | `glSecondaryColor3b', `glSecondaryColor3s', and `glSecondaryColor3i' | |
13869 | take three signed byte, short, or long integers as arguments. When *v* | |
13870 | is appended to the name, the color commands can take a pointer to an | |
13871 | array of such values. | |
13872 | ||
13873 | Color values are stored in floating-point format, with unspecified | |
13874 | mantissa and exponent sizes. Unsigned integer color components, when | |
13875 | specified, are linearly mapped to floating-point values such that the | |
13876 | largest representable value maps to 1.0 (full intensity), and 0 maps to | |
13877 | 0.0 (zero intensity). Signed integer color components, when specified, | |
13878 | are linearly mapped to floating-point values such that the most positive | |
13879 | representable value maps to 1.0, and the most negative representable | |
13880 | value maps to -1.0 . (Note that this mapping does not convert 0 | |
13881 | precisely to 0.0). Floating-point values are mapped directly. | |
13882 | ||
13883 | Neither floating-point nor signed integer values are clamped to the | |
13884 | range [0,1] before the current color is updated. However, color | |
13885 | components are clamped to this range before they are interpolated or | |
13886 | written into a color buffer.") | |
8925f36f AW |
13887 | |
13888 | (define-gl-procedure | |
bb894c9d AW |
13889 | ((glSelectBuffer |
13890 | (size GLsizei) | |
13891 | (buffer *) | |
13892 | -> | |
13893 | void)) | |
3c9b6116 AW |
13894 | "Establish a buffer for selection mode values. |
13895 | ||
13896 | SIZE | |
13897 | Specifies the size of BUFFER. | |
13898 | ||
13899 | BUFFER | |
13900 | Returns the selection data. | |
13901 | ||
13902 | `glSelectBuffer' has two arguments: BUFFER is a pointer to an array of | |
13903 | unsigned integers, and SIZE indicates the size of the array. BUFFER | |
13904 | returns values from the name stack (see `glInitNames', `glLoadName', | |
13905 | `glPushName') when the rendering mode is `GL_SELECT' (see | |
13906 | `glRenderMode'). `glSelectBuffer' must be issued before selection mode | |
13907 | is enabled, and it must not be issued while the rendering mode is | |
13908 | `GL_SELECT'. | |
13909 | ||
13910 | A programmer can use selection to determine which primitives are drawn | |
13911 | into some region of a window. The region is defined by the current | |
13912 | modelview and perspective matrices. | |
13913 | ||
13914 | In selection mode, no pixel fragments are produced from rasterization. | |
13915 | Instead, if a primitive or a raster position intersects the clipping | |
13916 | volume defined by the viewing frustum and the user-defined clipping | |
13917 | planes, this primitive causes a selection hit. (With polygons, no hit | |
13918 | occurs if the polygon is culled.) When a change is made to the name | |
13919 | stack, or when `glRenderMode' is called, a hit record is copied to | |
13920 | BUFFER if any hits have occurred since the last such event (name stack | |
13921 | change or `glRenderMode' call). The hit record consists of the number of | |
13922 | names in the name stack at the time of the event, followed by the | |
13923 | minimum and maximum depth values of all vertices that hit since the | |
13924 | previous event, followed by the name stack contents, bottom name first. | |
13925 | ||
13926 | Depth values (which are in the range [0,1]) are multiplied by 2^32-1 , | |
13927 | before being placed in the hit record. | |
13928 | ||
13929 | An internal index into BUFFER is reset to 0 whenever selection mode is | |
13930 | entered. Each time a hit record is copied into BUFFER, the index is | |
13931 | incremented to point to the cell just past the end of the block of | |
13932 | names\\(emthat is, to the next available cell If the hit record is larger | |
13933 | than the number of remaining locations in BUFFER, as much data as can | |
13934 | fit is copied, and the overflow flag is set. If the name stack is empty | |
13935 | when a hit record is copied, that record consists of 0 followed by the | |
13936 | minimum and maximum depth values. | |
13937 | ||
13938 | To exit selection mode, call `glRenderMode' with an argument other than | |
13939 | `GL_SELECT'. Whenever `glRenderMode' is called while the render mode is | |
13940 | `GL_SELECT', it returns the number of hit records copied to BUFFER, | |
13941 | resets the overflow flag and the selection buffer pointer, and | |
13942 | initializes the name stack to be empty. If the overflow bit was set when | |
13943 | `glRenderMode' was called, a negative hit record count is returned. | |
13944 | ||
13945 | `GL_INVALID_VALUE' is generated if SIZE is negative. | |
13946 | ||
13947 | `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while | |
13948 | the render mode is `GL_SELECT', or if `glRenderMode' is called with | |
13949 | argument `GL_SELECT' before `glSelectBuffer' is called at least once. | |
13950 | ||
13951 | `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is executed | |
13952 | between the execution of `glBegin' and the corresponding execution of | |
13953 | `glEnd'.") | |
8925f36f AW |
13954 | |
13955 | (define-gl-procedure | |
bb894c9d AW |
13956 | ((glSeparableFilter2D |
13957 | (target GLenum) | |
13958 | (internalformat GLenum) | |
13959 | (width GLsizei) | |
13960 | (height GLsizei) | |
13961 | (format GLenum) | |
13962 | (type GLenum) | |
13963 | (row *) | |
13964 | (column *) | |
13965 | -> | |
13966 | void)) | |
3c9b6116 | 13967 | "Define a separable two-dimensional convolution filter. |
8925f36f | 13968 | |
3c9b6116 AW |
13969 | TARGET |
13970 | Must be `GL_SEPARABLE_2D'. | |
13971 | ||
13972 | INTERNALFORMAT | |
13973 | The internal format of the convolution filter kernel. The allowable | |
13974 | values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', | |
13975 | `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', | |
13976 | `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', | |
13977 | `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2', | |
13978 | `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4', | |
13979 | `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', | |
13980 | `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12', | |
13981 | `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5', | |
13982 | `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA', | |
13983 | `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', | |
13984 | `GL_RGBA12', or `GL_RGBA16'. | |
13985 | ||
13986 | WIDTH | |
13987 | The number of elements in the pixel array referenced by ROW. (This | |
13988 | is the width of the separable filter kernel.) | |
13989 | ||
13990 | HEIGHT | |
13991 | The number of elements in the pixel array referenced by COLUMN. | |
13992 | (This is the height of the separable filter kernel.) | |
13993 | ||
13994 | FORMAT | |
13995 | The format of the pixel data in ROW and COLUMN. The allowable | |
13996 | values are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', | |
13997 | `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_INTENSITY', `GL_LUMINANCE', and | |
13998 | `GL_LUMINANCE_ALPHA'. | |
13999 | ||
14000 | TYPE | |
14001 | The type of the pixel data in ROW and COLUMN. Symbolic constants | |
14002 | `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT', | |
14003 | `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', | |
14004 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
14005 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
14006 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
14007 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
14008 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
14009 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV' | |
14010 | are accepted. | |
14011 | ||
14012 | ROW | |
14013 | Pointer to a one-dimensional array of pixel data that is processed | |
14014 | to build the row filter kernel. | |
14015 | ||
14016 | COLUMN | |
14017 | Pointer to a one-dimensional array of pixel data that is processed | |
14018 | to build the column filter kernel. | |
14019 | ||
14020 | `glSeparableFilter2D' builds a two-dimensional separable convolution | |
14021 | filter kernel from two arrays of pixels. | |
14022 | ||
14023 | The pixel arrays specified by (WIDTH, FORMAT, TYPE, ROW) and (HEIGHT, | |
14024 | FORMAT, TYPE, COLUMN) are processed just as if they had been passed to | |
14025 | `glDrawPixels', but processing stops after the final expansion to RGBA | |
14026 | is completed. | |
14027 | ||
14028 | If a non-zero named buffer object is bound to the | |
14029 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution | |
14030 | filter is specified, ROW and COLUMN are treated as byte offsets into the | |
14031 | buffer object's data store. | |
14032 | ||
14033 | Next, the R, G, B, and A components of all pixels in both arrays are | |
14034 | scaled by the four separable 2D `GL_CONVOLUTION_FILTER_SCALE' parameters | |
14035 | and biased by the four separable 2D `GL_CONVOLUTION_FILTER_BIAS' | |
14036 | parameters. (The scale and bias parameters are set by | |
14037 | `glConvolutionParameter' using the `GL_SEPARABLE_2D' target and the | |
14038 | names `GL_CONVOLUTION_FILTER_SCALE' and `GL_CONVOLUTION_FILTER_BIAS'. | |
14039 | The parameters themselves are vectors of four values that are applied to | |
14040 | red, green, blue, and alpha, in that order.) The R, G, B, and A values | |
14041 | are not clamped to [0,1] at any time during this process. | |
14042 | ||
14043 | Each pixel is then converted to the internal format specified by | |
14044 | INTERNALFORMAT. This conversion simply maps the component values of the | |
14045 | pixel (R, G, B, and A) to the values included in the internal format | |
14046 | (red, green, blue, alpha, luminance, and intensity). The mapping is as | |
14047 | follows: | |
14048 | ||
14049 | *Internal Format* | |
14050 | *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity* | |
14051 | ||
14052 | `GL_LUMINANCE' | |
14053 | , , , , R , | |
14054 | ||
14055 | `GL_LUMINANCE_ALPHA' | |
14056 | , , , A , R , | |
14057 | ||
14058 | `GL_INTENSITY' | |
14059 | , , , , , R | |
14060 | ||
14061 | `GL_RGB' | |
14062 | R , G , B , , , | |
14063 | ||
14064 | `GL_RGBA' | |
14065 | R , G , B , A , , | |
14066 | ||
14067 | The red, green, blue, alpha, luminance, and/or intensity components of | |
14068 | the resulting pixels are stored in floating-point rather than integer | |
14069 | format. They form two one-dimensional filter kernel images. The row | |
14070 | image is indexed by coordinate I starting at zero and increasing from | |
14071 | left to right. Each location in the row image is derived from element I | |
14072 | of ROW. The column image is indexed by coordinate J starting at zero and | |
14073 | increasing from bottom to top. Each location in the column image is | |
14074 | derived from element J of COLUMN. | |
14075 | ||
14076 | Note that after a convolution is performed, the resulting color | |
14077 | components are also scaled by their corresponding | |
14078 | `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their | |
14079 | corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on | |
14080 | the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are | |
14081 | set by `glPixelTransfer'. | |
14082 | ||
14083 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'. | |
14084 | ||
14085 | `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the | |
14086 | allowable values. | |
14087 | ||
14088 | `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable | |
14089 | values. | |
14090 | ||
14091 | `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable | |
14092 | values. | |
14093 | ||
14094 | `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater | |
14095 | than the maximum supported value. This value may be queried with | |
14096 | `glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name | |
14097 | `GL_MAX_CONVOLUTION_WIDTH'. | |
14098 | ||
14099 | `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater | |
14100 | than the maximum supported value. This value may be queried with | |
14101 | `glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name | |
14102 | `GL_MAX_CONVOLUTION_HEIGHT'. | |
14103 | ||
14104 | `GL_INVALID_OPERATION' is generated if HEIGHT is one of | |
14105 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
14106 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
14107 | is not `GL_RGB'. | |
14108 | ||
14109 | `GL_INVALID_OPERATION' is generated if HEIGHT is one of | |
14110 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
14111 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
14112 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
14113 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
14114 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
14115 | ||
14116 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
14117 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
14118 | data store is currently mapped. | |
14119 | ||
14120 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
14121 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
14122 | unpacked from the buffer object such that the memory reads required | |
14123 | would exceed the data store size. | |
14124 | ||
14125 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
14126 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and ROW or COLUMN is not | |
14127 | evenly divisible into the number of bytes needed to store in memory a | |
14128 | datum indicated by TYPE. | |
14129 | ||
14130 | `GL_INVALID_OPERATION' is generated if `glSeparableFilter2D' is executed | |
14131 | between the execution of `glBegin' and the corresponding execution of | |
14132 | `glEnd'.") | |
8925f36f AW |
14133 | |
14134 | (define-gl-procedure | |
bb894c9d | 14135 | ((glShadeModel (mode GLenum) -> void)) |
3c9b6116 AW |
14136 | "Select flat or smooth shading. |
14137 | ||
14138 | MODE | |
14139 | Specifies a symbolic value representing a shading technique. | |
14140 | Accepted values are `GL_FLAT' and `GL_SMOOTH'. The initial value is | |
14141 | `GL_SMOOTH'. | |
14142 | ||
14143 | GL primitives can have either flat or smooth shading. Smooth shading, | |
14144 | the default, causes the computed colors of vertices to be interpolated | |
14145 | as the primitive is rasterized, typically assigning different colors to | |
14146 | each resulting pixel fragment. Flat shading selects the computed color | |
14147 | of just one vertex and assigns it to all the pixel fragments generated | |
14148 | by rasterizing a single primitive. In either case, the computed color of | |
14149 | a vertex is the result of lighting if lighting is enabled, or it is the | |
14150 | current color at the time the vertex was specified if lighting is | |
14151 | disabled. | |
14152 | ||
14153 | Flat and smooth shading are indistinguishable for points. Starting when | |
14154 | `glBegin' is issued and counting vertices and primitives from 1, the GL | |
14155 | gives each flat-shaded line segment I the computed color of vertex I+1 , | |
14156 | its second vertex. Counting similarly from 1, the GL gives each | |
14157 | flat-shaded polygon the computed color of the vertex listed in the | |
14158 | following table. This is the last vertex to specify the polygon in all | |
14159 | cases except single polygons, where the first vertex specifies the | |
14160 | flat-shaded color. | |
14161 | ||
14162 | ||
14163 | ||
14164 | * Primitive Type of Polygon I * | |
14165 | *Vertex* | |
14166 | ||
14167 | Single polygon (I==1 ) | |
14168 | 1 | |
14169 | ||
14170 | Triangle strip | |
14171 | I+2 | |
14172 | ||
14173 | Triangle fan | |
14174 | I+2 | |
14175 | ||
14176 | Independent triangle | |
14177 | 3\u2062I | |
14178 | ||
14179 | Quad strip | |
14180 | 2\u2062I+2 | |
14181 | ||
14182 | Independent quad | |
14183 | 4\u2062I | |
14184 | ||
14185 | Flat and smooth shading are specified by `glShadeModel' with MODE set to | |
14186 | `GL_FLAT' and `GL_SMOOTH', respectively. | |
14187 | ||
14188 | `GL_INVALID_ENUM' is generated if MODE is any value other than `GL_FLAT' | |
14189 | or `GL_SMOOTH'. | |
14190 | ||
14191 | `GL_INVALID_OPERATION' is generated if `glShadeModel' is executed | |
14192 | between the execution of `glBegin' and the corresponding execution of | |
14193 | `glEnd'.") | |
8925f36f AW |
14194 | |
14195 | (define-gl-procedure | |
bb894c9d AW |
14196 | ((glShaderSource |
14197 | (shader GLuint) | |
14198 | (count GLsizei) | |
14199 | (string *) | |
14200 | (length *) | |
14201 | -> | |
14202 | void)) | |
3c9b6116 AW |
14203 | "Replaces the source code in a shader object. |
14204 | ||
14205 | SHADER | |
14206 | Specifies the handle of the shader object whose source code is to | |
14207 | be replaced. | |
14208 | ||
14209 | COUNT | |
14210 | Specifies the number of elements in the STRING and LENGTH arrays. | |
14211 | ||
14212 | STRING | |
14213 | Specifies an array of pointers to strings containing the source | |
14214 | code to be loaded into the shader. | |
14215 | ||
14216 | LENGTH | |
14217 | Specifies an array of string lengths. | |
14218 | ||
14219 | `glShaderSource' sets the source code in SHADER to the source code in | |
14220 | the array of strings specified by STRING. Any source code previously | |
14221 | stored in the shader object is completely replaced. The number of | |
14222 | strings in the array is specified by COUNT. If LENGTH is `NULL', each | |
14223 | string is assumed to be null terminated. If LENGTH is a value other than | |
14224 | `NULL', it points to an array containing a string length for each of the | |
14225 | corresponding elements of STRING. Each element in the LENGTH array may | |
14226 | contain the length of the corresponding string (the null character is | |
14227 | not counted as part of the string length) or a value less than 0 to | |
14228 | indicate that the string is null terminated. The source code strings are | |
14229 | not scanned or parsed at this time; they are simply copied into the | |
14230 | specified shader object. | |
14231 | ||
14232 | `GL_INVALID_VALUE' is generated if SHADER is not a value generated by | |
14233 | OpenGL. | |
14234 | ||
14235 | `GL_INVALID_OPERATION' is generated if SHADER is not a shader object. | |
14236 | ||
14237 | `GL_INVALID_VALUE' is generated if COUNT is less than 0. | |
14238 | ||
14239 | `GL_INVALID_OPERATION' is generated if `glShaderSource' is executed | |
14240 | between the execution of `glBegin' and the corresponding execution of | |
14241 | `glEnd'.") | |
8925f36f AW |
14242 | |
14243 | (define-gl-procedure | |
bb894c9d AW |
14244 | ((glStencilFuncSeparate |
14245 | (face GLenum) | |
14246 | (func GLenum) | |
14247 | (ref GLint) | |
14248 | (mask GLuint) | |
14249 | -> | |
14250 | void)) | |
3c9b6116 AW |
14251 | "Set front and/or back function and reference value for stencil testing. |
14252 | ||
14253 | FACE | |
14254 | Specifies whether front and/or back stencil state is updated. Three | |
14255 | symbolic constants are valid: `GL_FRONT', `GL_BACK', and | |
14256 | `GL_FRONT_AND_BACK'. | |
14257 | ||
14258 | FUNC | |
14259 | Specifies the test function. Eight symbolic constants are valid: | |
14260 | `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL', | |
14261 | `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is | |
14262 | `GL_ALWAYS'. | |
14263 | ||
14264 | REF | |
14265 | Specifies the reference value for the stencil test. REF is clamped | |
14266 | to the range [0,2^N-1] , where N is the number of bitplanes in the | |
14267 | stencil buffer. The initial value is 0. | |
14268 | ||
14269 | MASK | |
14270 | Specifies a mask that is ANDed with both the reference value and | |
14271 | the stored stencil value when the test is done. The initial value | |
14272 | is all 1's. | |
14273 | ||
14274 | Stenciling, like depth-buffering, enables and disables drawing on a | |
14275 | per-pixel basis. You draw into the stencil planes using GL drawing | |
14276 | primitives, then render geometry and images, using the stencil planes to | |
14277 | mask out portions of the screen. Stenciling is typically used in | |
14278 | multipass rendering algorithms to achieve special effects, such as | |
14279 | decals, outlining, and constructive solid geometry rendering. | |
14280 | ||
14281 | The stencil test conditionally eliminates a pixel based on the outcome | |
14282 | of a comparison between the reference value and the value in the stencil | |
14283 | buffer. To enable and disable the test, call `glEnable' and `glDisable' | |
14284 | with argument `GL_STENCIL_TEST'. To specify actions based on the outcome | |
14285 | of the stencil test, call `glStencilOp' or `glStencilOpSeparate'. | |
14286 | ||
14287 | There can be two separate sets of FUNC, REF, and MASK parameters; one | |
14288 | affects back-facing polygons, and the other affects front-facing | |
14289 | polygons as well as other non-polygon primitives. `glStencilFunc' sets | |
14290 | both front and back stencil state to the same values, as if | |
14291 | `glStencilFuncSeparate' were called with FACE set to | |
14292 | `GL_FRONT_AND_BACK'. | |
14293 | ||
14294 | FUNC is a symbolic constant that determines the stencil comparison | |
14295 | function. It accepts one of eight values, shown in the following list. | |
14296 | REF is an integer reference value that is used in the stencil | |
14297 | comparison. It is clamped to the range [0,2^N-1] , where N is the number | |
14298 | of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the | |
14299 | reference value and the stored stencil value, with the ANDed values | |
14300 | participating in the comparison. | |
14301 | ||
14302 | If STENCIL represents the value stored in the corresponding stencil | |
14303 | buffer location, the following list shows the effect of each comparison | |
14304 | function that can be specified by FUNC. Only if the comparison succeeds | |
14305 | is the pixel passed through to the next stage in the rasterization | |
14306 | process (see `glStencilOp'). All tests treat STENCIL values as unsigned | |
14307 | integers in the range [0,2^N-1] , where N is the number of bitplanes in | |
14308 | the stencil buffer. | |
14309 | ||
14310 | The following values are accepted by FUNC: | |
14311 | ||
14312 | `GL_NEVER' | |
14313 | Always fails. | |
14314 | ||
14315 | `GL_LESS' | |
14316 | Passes if ( REF & MASK ) < ( STENCIL & MASK ). | |
14317 | ||
14318 | `GL_LEQUAL' | |
14319 | Passes if ( REF & MASK ) <= ( STENCIL & MASK ). | |
14320 | ||
14321 | `GL_GREATER' | |
14322 | Passes if ( REF & MASK ) > ( STENCIL & MASK ). | |
14323 | ||
14324 | `GL_GEQUAL' | |
14325 | Passes if ( REF & MASK ) >= ( STENCIL & MASK ). | |
14326 | ||
14327 | `GL_EQUAL' | |
14328 | Passes if ( REF & MASK ) = ( STENCIL & MASK ). | |
14329 | ||
14330 | `GL_NOTEQUAL' | |
14331 | Passes if ( REF & MASK ) != ( STENCIL & MASK ). | |
14332 | ||
14333 | `GL_ALWAYS' | |
14334 | Always passes. | |
14335 | ||
14336 | `GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted | |
14337 | values. | |
14338 | ||
14339 | `GL_INVALID_OPERATION' is generated if `glStencilFuncSeparate' is | |
14340 | executed between the execution of `glBegin' and the corresponding | |
14341 | execution of `glEnd'.") | |
8925f36f AW |
14342 | |
14343 | (define-gl-procedure | |
bb894c9d AW |
14344 | ((glStencilFunc |
14345 | (func GLenum) | |
14346 | (ref GLint) | |
14347 | (mask GLuint) | |
14348 | -> | |
14349 | void)) | |
3c9b6116 AW |
14350 | "Set front and back function and reference value for stencil testing. |
14351 | ||
14352 | FUNC | |
14353 | Specifies the test function. Eight symbolic constants are valid: | |
14354 | `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL', | |
14355 | `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is | |
14356 | `GL_ALWAYS'. | |
14357 | ||
14358 | REF | |
14359 | Specifies the reference value for the stencil test. REF is clamped | |
14360 | to the range [0,2^N-1] , where N is the number of bitplanes in the | |
14361 | stencil buffer. The initial value is 0. | |
14362 | ||
14363 | MASK | |
14364 | Specifies a mask that is ANDed with both the reference value and | |
14365 | the stored stencil value when the test is done. The initial value | |
14366 | is all 1's. | |
14367 | ||
14368 | Stenciling, like depth-buffering, enables and disables drawing on a | |
14369 | per-pixel basis. Stencil planes are first drawn into using GL drawing | |
14370 | primitives, then geometry and images are rendered using the stencil | |
14371 | planes to mask out portions of the screen. Stenciling is typically used | |
14372 | in multipass rendering algorithms to achieve special effects, such as | |
14373 | decals, outlining, and constructive solid geometry rendering. | |
14374 | ||
14375 | The stencil test conditionally eliminates a pixel based on the outcome | |
14376 | of a comparison between the reference value and the value in the stencil | |
14377 | buffer. To enable and disable the test, call `glEnable' and `glDisable' | |
14378 | with argument `GL_STENCIL_TEST'. To specify actions based on the outcome | |
14379 | of the stencil test, call `glStencilOp' or `glStencilOpSeparate'. | |
14380 | ||
14381 | There can be two separate sets of FUNC, REF, and MASK parameters; one | |
14382 | affects back-facing polygons, and the other affects front-facing | |
14383 | polygons as well as other non-polygon primitives. `glStencilFunc' sets | |
14384 | both front and back stencil state to the same values. Use | |
14385 | `glStencilFuncSeparate' to set front and back stencil state to different | |
14386 | values. | |
14387 | ||
14388 | FUNC is a symbolic constant that determines the stencil comparison | |
14389 | function. It accepts one of eight values, shown in the following list. | |
14390 | REF is an integer reference value that is used in the stencil | |
14391 | comparison. It is clamped to the range [0,2^N-1] , where N is the number | |
14392 | of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the | |
14393 | reference value and the stored stencil value, with the ANDed values | |
14394 | participating in the comparison. | |
14395 | ||
14396 | If STENCIL represents the value stored in the corresponding stencil | |
14397 | buffer location, the following list shows the effect of each comparison | |
14398 | function that can be specified by FUNC. Only if the comparison succeeds | |
14399 | is the pixel passed through to the next stage in the rasterization | |
14400 | process (see `glStencilOp'). All tests treat STENCIL values as unsigned | |
14401 | integers in the range [0,2^N-1] , where N is the number of bitplanes in | |
14402 | the stencil buffer. | |
14403 | ||
14404 | The following values are accepted by FUNC: | |
14405 | ||
14406 | `GL_NEVER' | |
14407 | Always fails. | |
14408 | ||
14409 | `GL_LESS' | |
14410 | Passes if ( REF & MASK ) < ( STENCIL & MASK ). | |
14411 | ||
14412 | `GL_LEQUAL' | |
14413 | Passes if ( REF & MASK ) <= ( STENCIL & MASK ). | |
14414 | ||
14415 | `GL_GREATER' | |
14416 | Passes if ( REF & MASK ) > ( STENCIL & MASK ). | |
14417 | ||
14418 | `GL_GEQUAL' | |
14419 | Passes if ( REF & MASK ) >= ( STENCIL & MASK ). | |
14420 | ||
14421 | `GL_EQUAL' | |
14422 | Passes if ( REF & MASK ) = ( STENCIL & MASK ). | |
14423 | ||
14424 | `GL_NOTEQUAL' | |
14425 | Passes if ( REF & MASK ) != ( STENCIL & MASK ). | |
14426 | ||
14427 | `GL_ALWAYS' | |
14428 | Always passes. | |
14429 | ||
14430 | `GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted | |
14431 | values. | |
14432 | ||
14433 | `GL_INVALID_OPERATION' is generated if `glStencilFunc' is executed | |
14434 | between the execution of `glBegin' and the corresponding execution of | |
14435 | `glEnd'.") | |
8925f36f AW |
14436 | |
14437 | (define-gl-procedure | |
bb894c9d AW |
14438 | ((glStencilMaskSeparate |
14439 | (face GLenum) | |
14440 | (mask GLuint) | |
14441 | -> | |
14442 | void)) | |
3c9b6116 AW |
14443 | "Control the front and/or back writing of individual bits in the stencil |
14444 | planes. | |
14445 | ||
14446 | FACE | |
14447 | Specifies whether the front and/or back stencil writemask is | |
14448 | updated. Three symbolic constants are valid: `GL_FRONT', `GL_BACK', | |
14449 | and `GL_FRONT_AND_BACK'. | |
14450 | ||
14451 | MASK | |
14452 | Specifies a bit mask to enable and disable writing of individual | |
14453 | bits in the stencil planes. Initially, the mask is all 1's. | |
14454 | ||
14455 | `glStencilMaskSeparate' controls the writing of individual bits in the | |
14456 | stencil planes. The least significant N bits of MASK, where N is the | |
14457 | number of bits in the stencil buffer, specify a mask. Where a 1 appears | |
14458 | in the mask, it's possible to write to the corresponding bit in the | |
14459 | stencil buffer. Where a 0 appears, the corresponding bit is | |
14460 | write-protected. Initially, all bits are enabled for writing. | |
14461 | ||
14462 | There can be two separate MASK writemasks; one affects back-facing | |
14463 | polygons, and the other affects front-facing polygons as well as other | |
14464 | non-polygon primitives. `glStencilMask' sets both front and back stencil | |
14465 | writemasks to the same values, as if `glStencilMaskSeparate' were called | |
14466 | with FACE set to `GL_FRONT_AND_BACK'. | |
14467 | ||
14468 | `GL_INVALID_OPERATION' is generated if `glStencilMaskSeparate' is | |
14469 | executed between the execution of `glBegin' and the corresponding | |
14470 | execution of `glEnd'.") | |
8925f36f AW |
14471 | |
14472 | (define-gl-procedure | |
bb894c9d | 14473 | ((glStencilMask (mask GLuint) -> void)) |
3c9b6116 AW |
14474 | "Control the front and back writing of individual bits in the stencil |
14475 | planes. | |
14476 | ||
14477 | MASK | |
14478 | Specifies a bit mask to enable and disable writing of individual | |
14479 | bits in the stencil planes. Initially, the mask is all 1's. | |
14480 | ||
14481 | `glStencilMask' controls the writing of individual bits in the stencil | |
14482 | planes. The least significant N bits of MASK, where N is the number of | |
14483 | bits in the stencil buffer, specify a mask. Where a 1 appears in the | |
14484 | mask, it's possible to write to the corresponding bit in the stencil | |
14485 | buffer. Where a 0 appears, the corresponding bit is write-protected. | |
14486 | Initially, all bits are enabled for writing. | |
14487 | ||
14488 | There can be two separate MASK writemasks; one affects back-facing | |
14489 | polygons, and the other affects front-facing polygons as well as other | |
14490 | non-polygon primitives. `glStencilMask' sets both front and back stencil | |
14491 | writemasks to the same values. Use `glStencilMaskSeparate' to set front | |
14492 | and back stencil writemasks to different values. | |
14493 | ||
14494 | `GL_INVALID_OPERATION' is generated if `glStencilMask' is executed | |
14495 | between the execution of `glBegin' and the corresponding execution of | |
14496 | `glEnd'.") | |
8925f36f AW |
14497 | |
14498 | (define-gl-procedure | |
bb894c9d AW |
14499 | ((glStencilOpSeparate |
14500 | (face GLenum) | |
14501 | (sfail GLenum) | |
14502 | (dpfail GLenum) | |
14503 | (dppass GLenum) | |
14504 | -> | |
14505 | void)) | |
3c9b6116 AW |
14506 | "Set front and/or back stencil test actions. |
14507 | ||
14508 | FACE | |
14509 | Specifies whether front and/or back stencil state is updated. Three | |
14510 | symbolic constants are valid: `GL_FRONT', `GL_BACK', and | |
14511 | `GL_FRONT_AND_BACK'. | |
14512 | ||
14513 | SFAIL | |
14514 | Specifies the action to take when the stencil test fails. Eight | |
14515 | symbolic constants are accepted: `GL_KEEP', `GL_ZERO', | |
14516 | `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP', | |
14517 | and `GL_INVERT'. The initial value is `GL_KEEP'. | |
14518 | ||
14519 | DPFAIL | |
14520 | Specifies the stencil action when the stencil test passes, but the | |
14521 | depth test fails. DPFAIL accepts the same symbolic constants as | |
14522 | SFAIL. The initial value is `GL_KEEP'. | |
14523 | ||
14524 | DPPASS | |
14525 | Specifies the stencil action when both the stencil test and the | |
14526 | depth test pass, or when the stencil test passes and either there | |
14527 | is no depth buffer or depth testing is not enabled. DPPASS accepts | |
14528 | the same symbolic constants as SFAIL. The initial value is | |
14529 | `GL_KEEP'. | |
14530 | ||
14531 | Stenciling, like depth-buffering, enables and disables drawing on a | |
14532 | per-pixel basis. You draw into the stencil planes using GL drawing | |
14533 | primitives, then render geometry and images, using the stencil planes to | |
14534 | mask out portions of the screen. Stenciling is typically used in | |
14535 | multipass rendering algorithms to achieve special effects, such as | |
14536 | decals, outlining, and constructive solid geometry rendering. | |
14537 | ||
14538 | The stencil test conditionally eliminates a pixel based on the outcome | |
14539 | of a comparison between the value in the stencil buffer and a reference | |
14540 | value. To enable and disable the test, call `glEnable' and `glDisable' | |
14541 | with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or | |
14542 | `glStencilFuncSeparate'. | |
14543 | ||
14544 | There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters; | |
14545 | one affects back-facing polygons, and the other affects front-facing | |
14546 | polygons as well as other non-polygon primitives. `glStencilOp' sets | |
14547 | both front and back stencil state to the same values, as if | |
14548 | `glStencilOpSeparate' were called with FACE set to `GL_FRONT_AND_BACK'. | |
14549 | ||
14550 | `glStencilOpSeparate' takes three arguments that indicate what happens | |
14551 | to the stored stencil value while stenciling is enabled. If the stencil | |
14552 | test fails, no change is made to the pixel's color or depth buffers, and | |
14553 | SFAIL specifies what happens to the stencil buffer contents. The | |
14554 | following eight actions are possible. | |
14555 | ||
14556 | `GL_KEEP' | |
14557 | Keeps the current value. | |
14558 | ||
14559 | `GL_ZERO' | |
14560 | Sets the stencil buffer value to 0. | |
14561 | ||
14562 | `GL_REPLACE' | |
14563 | Sets the stencil buffer value to REF, as specified by | |
14564 | `glStencilFunc'. | |
14565 | ||
14566 | `GL_INCR' | |
14567 | Increments the current stencil buffer value. Clamps to the maximum | |
14568 | representable unsigned value. | |
14569 | ||
14570 | `GL_INCR_WRAP' | |
14571 | Increments the current stencil buffer value. Wraps stencil buffer | |
14572 | value to zero when incrementing the maximum representable unsigned | |
14573 | value. | |
14574 | ||
14575 | `GL_DECR' | |
14576 | Decrements the current stencil buffer value. Clamps to 0. | |
14577 | ||
14578 | `GL_DECR_WRAP' | |
14579 | Decrements the current stencil buffer value. Wraps stencil buffer | |
14580 | value to the maximum representable unsigned value when decrementing | |
14581 | a stencil buffer value of zero. | |
14582 | ||
14583 | `GL_INVERT' | |
14584 | Bitwise inverts the current stencil buffer value. | |
14585 | ||
14586 | Stencil buffer values are treated as unsigned integers. When incremented | |
14587 | and decremented, values are clamped to 0 and 2^N-1 , where N is the | |
14588 | value returned by querying `GL_STENCIL_BITS'. | |
14589 | ||
14590 | The other two arguments to `glStencilOpSeparate' specify stencil buffer | |
14591 | actions that depend on whether subsequent depth buffer tests succeed | |
14592 | (DPPASS) or fail (DPFAIL) (see `glDepthFunc'). The actions are specified | |
14593 | using the same eight symbolic constants as SFAIL. Note that DPFAIL is | |
14594 | ignored when there is no depth buffer, or when the depth buffer is not | |
14595 | enabled. In these cases, SFAIL and DPPASS specify stencil action when | |
14596 | the stencil test fails and passes, respectively. | |
14597 | ||
14598 | `GL_INVALID_ENUM' is generated if FACE is any value other than | |
14599 | `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'. | |
14600 | ||
14601 | `GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value | |
14602 | other than the eight defined constant values. | |
14603 | ||
14604 | `GL_INVALID_OPERATION' is generated if `glStencilOpSeparate' is executed | |
14605 | between the execution of `glBegin' and the corresponding execution of | |
14606 | `glEnd'.") | |
8925f36f AW |
14607 | |
14608 | (define-gl-procedure | |
bb894c9d AW |
14609 | ((glStencilOp |
14610 | (sfail GLenum) | |
14611 | (dpfail GLenum) | |
14612 | (dppass GLenum) | |
14613 | -> | |
14614 | void)) | |
3c9b6116 AW |
14615 | "Set front and back stencil test actions. |
14616 | ||
14617 | SFAIL | |
14618 | Specifies the action to take when the stencil test fails. Eight | |
14619 | symbolic constants are accepted: `GL_KEEP', `GL_ZERO', | |
14620 | `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP', | |
14621 | and `GL_INVERT'. The initial value is `GL_KEEP'. | |
14622 | ||
14623 | DPFAIL | |
14624 | Specifies the stencil action when the stencil test passes, but the | |
14625 | depth test fails. DPFAIL accepts the same symbolic constants as | |
14626 | SFAIL. The initial value is `GL_KEEP'. | |
14627 | ||
14628 | DPPASS | |
14629 | Specifies the stencil action when both the stencil test and the | |
14630 | depth test pass, or when the stencil test passes and either there | |
14631 | is no depth buffer or depth testing is not enabled. DPPASS accepts | |
14632 | the same symbolic constants as SFAIL. The initial value is | |
14633 | `GL_KEEP'. | |
14634 | ||
14635 | Stenciling, like depth-buffering, enables and disables drawing on a | |
14636 | per-pixel basis. You draw into the stencil planes using GL drawing | |
14637 | primitives, then render geometry and images, using the stencil planes to | |
14638 | mask out portions of the screen. Stenciling is typically used in | |
14639 | multipass rendering algorithms to achieve special effects, such as | |
14640 | decals, outlining, and constructive solid geometry rendering. | |
14641 | ||
14642 | The stencil test conditionally eliminates a pixel based on the outcome | |
14643 | of a comparison between the value in the stencil buffer and a reference | |
14644 | value. To enable and disable the test, call `glEnable' and `glDisable' | |
14645 | with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or | |
14646 | `glStencilFuncSeparate'. | |
14647 | ||
14648 | There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters; | |
14649 | one affects back-facing polygons, and the other affects front-facing | |
14650 | polygons as well as other non-polygon primitives. `glStencilOp' sets | |
14651 | both front and back stencil state to the same values. Use | |
14652 | `glStencilOpSeparate' to set front and back stencil state to different | |
14653 | values. | |
14654 | ||
14655 | `glStencilOp' takes three arguments that indicate what happens to the | |
14656 | stored stencil value while stenciling is enabled. If the stencil test | |
14657 | fails, no change is made to the pixel's color or depth buffers, and | |
14658 | SFAIL specifies what happens to the stencil buffer contents. The | |
14659 | following eight actions are possible. | |
14660 | ||
14661 | `GL_KEEP' | |
14662 | Keeps the current value. | |
14663 | ||
14664 | `GL_ZERO' | |
14665 | Sets the stencil buffer value to 0. | |
14666 | ||
14667 | `GL_REPLACE' | |
14668 | Sets the stencil buffer value to REF, as specified by | |
14669 | `glStencilFunc'. | |
14670 | ||
14671 | `GL_INCR' | |
14672 | Increments the current stencil buffer value. Clamps to the maximum | |
14673 | representable unsigned value. | |
14674 | ||
14675 | `GL_INCR_WRAP' | |
14676 | Increments the current stencil buffer value. Wraps stencil buffer | |
14677 | value to zero when incrementing the maximum representable unsigned | |
14678 | value. | |
14679 | ||
14680 | `GL_DECR' | |
14681 | Decrements the current stencil buffer value. Clamps to 0. | |
14682 | ||
14683 | `GL_DECR_WRAP' | |
14684 | Decrements the current stencil buffer value. Wraps stencil buffer | |
14685 | value to the maximum representable unsigned value when decrementing | |
14686 | a stencil buffer value of zero. | |
14687 | ||
14688 | `GL_INVERT' | |
14689 | Bitwise inverts the current stencil buffer value. | |
14690 | ||
14691 | Stencil buffer values are treated as unsigned integers. When incremented | |
14692 | and decremented, values are clamped to 0 and 2^N-1 , where N is the | |
14693 | value returned by querying `GL_STENCIL_BITS'. | |
14694 | ||
14695 | The other two arguments to `glStencilOp' specify stencil buffer actions | |
14696 | that depend on whether subsequent depth buffer tests succeed (DPPASS) or | |
14697 | fail (DPFAIL) (see `glDepthFunc'). The actions are specified using the | |
14698 | same eight symbolic constants as SFAIL. Note that DPFAIL is ignored when | |
14699 | there is no depth buffer, or when the depth buffer is not enabled. In | |
14700 | these cases, SFAIL and DPPASS specify stencil action when the stencil | |
14701 | test fails and passes, respectively. | |
14702 | ||
14703 | `GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value | |
14704 | other than the eight defined constant values. | |
14705 | ||
14706 | `GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between | |
14707 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
14708 | |
14709 | (define-gl-procedure | |
bb894c9d AW |
14710 | ((glTexCoordPointer |
14711 | (size GLint) | |
14712 | (type GLenum) | |
14713 | (stride GLsizei) | |
14714 | (pointer *) | |
14715 | -> | |
14716 | void)) | |
3c9b6116 AW |
14717 | "Define an array of texture coordinates. |
14718 | ||
14719 | SIZE | |
14720 | Specifies the number of coordinates per array element. Must be 1, | |
14721 | 2, 3, or 4. The initial value is 4. | |
14722 | ||
14723 | TYPE | |
14724 | Specifies the data type of each texture coordinate. Symbolic | |
14725 | constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are | |
14726 | accepted. The initial value is `GL_FLOAT'. | |
14727 | ||
14728 | STRIDE | |
14729 | Specifies the byte offset between consecutive texture coordinate | |
14730 | sets. If STRIDE is 0, the array elements are understood to be | |
14731 | tightly packed. The initial value is 0. | |
14732 | ||
14733 | POINTER | |
14734 | Specifies a pointer to the first coordinate of the first texture | |
14735 | coordinate set in the array. The initial value is 0. | |
14736 | ||
14737 | `glTexCoordPointer' specifies the location and data format of an array | |
14738 | of texture coordinates to use when rendering. SIZE specifies the number | |
14739 | of coordinates per texture coordinate set, and must be 1, 2, 3, or 4. | |
14740 | TYPE specifies the data type of each texture coordinate, and STRIDE | |
14741 | specifies the byte stride from one texture coordinate set to the next, | |
14742 | allowing vertices and attributes to be packed into a single array or | |
14743 | stored in separate arrays. (Single-array storage may be more efficient | |
14744 | on some implementations; see `glInterleavedArrays'.) | |
14745 | ||
14746 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' | |
14747 | target (see `glBindBuffer') while a texture coordinate array is | |
14748 | specified, POINTER is treated as a byte offset into the buffer object's | |
14749 | data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') | |
14750 | is saved as texture coordinate vertex array client-side state | |
14751 | (`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING'). | |
14752 | ||
14753 | When a texture coordinate array is specified, SIZE, TYPE, STRIDE, and | |
14754 | POINTER are saved as client-side state, in addition to the current | |
14755 | vertex array buffer object binding. | |
14756 | ||
14757 | To enable and disable a texture coordinate array, call | |
14758 | `glEnableClientState' and `glDisableClientState' with the argument | |
14759 | `GL_TEXTURE_COORD_ARRAY'. If enabled, the texture coordinate array is | |
14760 | used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays', | |
14761 | `glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is | |
14762 | called. | |
14763 | ||
14764 | `GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4. | |
14765 | ||
14766 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
14767 | ||
14768 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
8925f36f AW |
14769 | |
14770 | (define-gl-procedure | |
bb894c9d AW |
14771 | ((glTexCoord1i (s GLint) -> void) |
14772 | (glTexCoord1d (s GLdouble) -> void) | |
14773 | (glTexCoord2i (s GLint) (t GLint) -> void) | |
14774 | (glTexCoord2d (s GLdouble) (t GLdouble) -> void) | |
14775 | (glTexCoord3i | |
14776 | (s GLint) | |
14777 | (t GLint) | |
14778 | (r GLint) | |
14779 | -> | |
14780 | void) | |
14781 | (glTexCoord3d | |
14782 | (s GLdouble) | |
14783 | (t GLdouble) | |
14784 | (r GLdouble) | |
14785 | -> | |
14786 | void) | |
14787 | (glTexCoord4i | |
14788 | (s GLint) | |
14789 | (t GLint) | |
14790 | (r GLint) | |
14791 | (q GLint) | |
14792 | -> | |
14793 | void) | |
14794 | (glTexCoord4d | |
14795 | (s GLdouble) | |
14796 | (t GLdouble) | |
14797 | (r GLdouble) | |
14798 | (q GLdouble) | |
14799 | -> | |
14800 | void)) | |
3c9b6116 AW |
14801 | "Set the current texture coordinates. |
14802 | ||
14803 | S | |
14804 | T | |
14805 | ||
14806 | R | |
14807 | ||
14808 | Q | |
14809 | ||
14810 | Specify S, T, R, and Q texture coordinates. Not all parameters are | |
14811 | present in all forms of the command. | |
14812 | ||
14813 | `glTexCoord' specifies texture coordinates in one, two, three, or four | |
14814 | dimensions. `glTexCoord1' sets the current texture coordinates to | |
14815 | (S,001) ; a call to `glTexCoord2' sets them to (S,T01) . Similarly, | |
14816 | `glTexCoord3' specifies the texture coordinates as (S,TR1) , and | |
14817 | `glTexCoord4' defines all four components explicitly as (S,TRQ) . | |
14818 | ||
14819 | The current texture coordinates are part of the data that is associated | |
14820 | with each vertex and with the current raster position. Initially, the | |
14821 | values for S, T, R, and Q are (0, 0, 0, 1).") | |
8925f36f AW |
14822 | |
14823 | (define-gl-procedure | |
bb894c9d AW |
14824 | ((glTexEnvf |
14825 | (target GLenum) | |
14826 | (pname GLenum) | |
14827 | (param GLfloat) | |
14828 | -> | |
14829 | void) | |
14830 | (glTexEnvi | |
14831 | (target GLenum) | |
14832 | (pname GLenum) | |
14833 | (param GLint) | |
14834 | -> | |
14835 | void)) | |
3c9b6116 AW |
14836 | "Set texture environment parameters. |
14837 | ||
14838 | TARGET | |
14839 | Specifies a texture environment. May be `GL_TEXTURE_ENV', | |
14840 | `GL_TEXTURE_FILTER_CONTROL' or `GL_POINT_SPRITE'. | |
14841 | ||
14842 | PNAME | |
14843 | Specifies the symbolic name of a single-valued texture environment | |
14844 | parameter. May be either `GL_TEXTURE_ENV_MODE', | |
14845 | `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA', | |
14846 | `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA', | |
14847 | `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB', | |
14848 | `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA', | |
14849 | `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE', | |
14850 | `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'. | |
14851 | ||
14852 | PARAM | |
14853 | Specifies a single symbolic constant, one of `GL_ADD', | |
14854 | `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_MODULATE', `GL_DECAL', | |
14855 | `GL_BLEND', `GL_REPLACE', `GL_SUBTRACT', `GL_COMBINE', | |
14856 | `GL_TEXTURE', `GL_CONSTANT', `GL_PRIMARY_COLOR', `GL_PREVIOUS', | |
14857 | `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_SRC_ALPHA', | |
14858 | `GL_ONE_MINUS_SRC_ALPHA', a single boolean value for the point | |
14859 | sprite texture coordinate replacement, a single floating-point | |
14860 | value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0 | |
14861 | when specifying the `GL_RGB_SCALE' or `GL_ALPHA_SCALE'. | |
14862 | ||
14863 | A texture environment specifies how texture values are interpreted when | |
14864 | a fragment is textured. When TARGET is `GL_TEXTURE_FILTER_CONTROL', | |
14865 | PNAME must be `GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_TEXTURE_ENV', | |
14866 | PNAME can be `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR', | |
14867 | `GL_COMBINE_RGB', `GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE', | |
14868 | `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA', | |
14869 | `GL_SRC1_ALPHA', or `GL_SRC2_ALPHA'. | |
14870 | ||
14871 | If PNAME is `GL_TEXTURE_ENV_MODE', then PARAMS is (or points to) the | |
14872 | symbolic name of a texture function. Six texture functions may be | |
14873 | specified: `GL_ADD', `GL_MODULATE', `GL_DECAL', `GL_BLEND', | |
14874 | `GL_REPLACE', or `GL_COMBINE'. | |
14875 | ||
14876 | The following table shows the correspondence of filtered texture values | |
14877 | R_T , G_T , B_T , A_T , L_T , I_T to texture source components. C_S and | |
14878 | A_S are used by the texture functions described below. | |
14879 | ||
14880 | ||
14881 | ||
14882 | Texture Base Internal Format | |
14883 | `C'_S , `A'_S | |
14884 | ||
14885 | `GL_ALPHA' | |
14886 | (0, 0, 0) , A_T | |
14887 | ||
14888 | `GL_LUMINANCE' | |
14889 | ( L_T , L_T , L_T ) , 1 | |
14890 | ||
14891 | `GL_LUMINANCE_ALPHA' | |
14892 | ( L_T , L_T , L_T ) , A_T | |
14893 | ||
14894 | `GL_INTENSITY' | |
14895 | ( I_T , I_T , I_T ) , I_T | |
14896 | ||
14897 | `GL_RGB' | |
14898 | ( R_T , G_T , B_T ) , 1 | |
14899 | ||
14900 | `GL_RGBA' | |
14901 | ( R_T , G_T , B_T ) , A_T | |
14902 | ||
14903 | A texture function acts on the fragment to be textured using the texture | |
14904 | image value that applies to the fragment (see `glTexParameter') and | |
14905 | produces an RGBA color for that fragment. The following table shows how | |
14906 | the RGBA color is produced for each of the first five texture functions | |
14907 | that can be chosen. C is a triple of color values (RGB) and A is the | |
14908 | associated alpha value. RGBA values extracted from a texture image are | |
14909 | in the range [0,1]. The subscript P refers to the color computed from | |
14910 | the previous texture stage (or the incoming fragment if processing | |
14911 | texture stage 0), the subscript S to the texture source color, the | |
14912 | subscript C to the texture environment color, and the subscript V | |
14913 | indicates a value produced by the texture function. | |
14914 | ||
14915 | ||
14916 | ||
14917 | Texture Base Internal Format | |
14918 | `Value', `GL_REPLACE' Function , `GL_MODULATE' Function , | |
14919 | `GL_DECAL' Function , `GL_BLEND' Function , `GL_ADD' Function | |
14920 | ||
14921 | `GL_ALPHA' | |
14922 | C_V= , C_P , C_P , undefined , C_P , C_P | |
14923 | ||
14924 | ||
14925 | A_V= , A_S , A_P\u2062A_S , , A_V=A_P\u2062A_S , A_P\u2062A_S | |
14926 | ||
14927 | `GL_LUMINANCE' | |
14928 | C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S | |
14929 | ||
14930 | (or 1) | |
14931 | A_V= , A_P , A_P , , A_P , A_P | |
14932 | ||
14933 | `GL_LUMINANCE_ALPHA' | |
14934 | C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S | |
14935 | ||
14936 | (or 2) | |
14937 | A_V= , A_S , A_P\u2062A_S , , A_P\u2062A_S , A_P\u2062A_S | |
14938 | ||
14939 | `GL_INTENSITY' | |
14940 | C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S | |
14941 | ||
14942 | ||
14943 | A_V= , A_S , A_P\u2062A_S , , A_P\u2062(1-A_S,)+A_C\u2062A_S , A_P+A_S | |
14944 | ||
14945 | `GL_RGB' | |
14946 | C_V= , C_S , C_P\u2062C_S , C_S , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S | |
14947 | ||
14948 | (or 3) | |
14949 | A_V= , A_P , A_P , A_P , A_P , A_P | |
14950 | ||
14951 | `GL_RGBA' | |
14952 | C_V= , C_S , C_P\u2062C_S , C_P\u2062(1-A_S,)+C_S\u2062A_S , C_P\u2062(1-C_S,)+C_C\u2062C_S | |
14953 | , C_P+C_S | |
14954 | ||
14955 | (or 4) | |
14956 | A_V= , A_S , A_P\u2062A_S , A_P , A_P\u2062A_S , A_P\u2062A_S | |
14957 | ||
14958 | If PNAME is `GL_TEXTURE_ENV_MODE', and PARAMS is `GL_COMBINE', the form | |
14959 | of the texture function depends on the values of `GL_COMBINE_RGB' and | |
14960 | `GL_COMBINE_ALPHA'. | |
14961 | ||
14962 | The following describes how the texture sources, as specified by | |
14963 | `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA', | |
14964 | `GL_SRC1_ALPHA', and `GL_SRC2_ALPHA', are combined to produce a final | |
14965 | texture color. In the following tables, `GL_SRC0_c' is represented by | |
14966 | ARG0 , `GL_SRC1_c' is represented by ARG1 , and `GL_SRC2_c' is | |
14967 | represented by ARG2 . | |
14968 | ||
14969 | `GL_COMBINE_RGB' accepts any of `GL_REPLACE', `GL_MODULATE', `GL_ADD', | |
14970 | `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_SUBTRACT', `GL_DOT3_RGB', or | |
14971 | `GL_DOT3_RGBA'. | |
14972 | ||
14973 | ||
14974 | ||
14975 | *`GL_COMBINE_RGB'* | |
14976 | *Texture Function* | |
14977 | ||
14978 | `GL_REPLACE' | |
14979 | ARG0 | |
14980 | ||
14981 | `GL_MODULATE' | |
14982 | ARG0×ARG1 | |
14983 | ||
14984 | `GL_ADD' | |
14985 | ARG0+ARG1 | |
14986 | ||
14987 | `GL_ADD_SIGNED' | |
14988 | ARG0+ARG1-0.5 | |
14989 | ||
14990 | `GL_INTERPOLATE' | |
14991 | ARG0×ARG2+ARG1×(1-ARG2,) | |
14992 | ||
14993 | `GL_SUBTRACT' | |
14994 | ARG0-ARG1 | |
14995 | ||
14996 | `GL_DOT3_RGB' or `GL_DOT3_RGBA' | |
14997 | 4×(((ARG0_R,-0.5,)×(ARG1_R,-0.5,),)+((ARG0_G,-0.5,)×(ARG1_G,-0.5,), | |
14998 | )+((ARG0_B,-0.5,)×(ARG1_B,-0.5,),),) | |
14999 | ||
15000 | The scalar results for `GL_DOT3_RGB' and `GL_DOT3_RGBA' are placed into | |
15001 | each of the 3 (RGB) or 4 (RGBA) components on output. | |
15002 | ||
15003 | Likewise, `GL_COMBINE_ALPHA' accepts any of `GL_REPLACE', `GL_MODULATE', | |
15004 | `GL_ADD', `GL_ADD_SIGNED', `GL_INTERPOLATE', or `GL_SUBTRACT'. The | |
15005 | following table describes how alpha values are combined: | |
15006 | ||
15007 | ||
15008 | ||
15009 | *`GL_COMBINE_ALPHA'* | |
15010 | *Texture Function* | |
15011 | ||
15012 | `GL_REPLACE' | |
15013 | ARG0 | |
15014 | ||
15015 | `GL_MODULATE' | |
15016 | ARG0×ARG1 | |
15017 | ||
15018 | `GL_ADD' | |
15019 | ARG0+ARG1 | |
15020 | ||
15021 | `GL_ADD_SIGNED' | |
15022 | ARG0+ARG1-0.5 | |
15023 | ||
15024 | `GL_INTERPOLATE' | |
15025 | ARG0×ARG2+ARG1×(1-ARG2,) | |
15026 | ||
15027 | `GL_SUBTRACT' | |
15028 | ARG0-ARG1 | |
15029 | ||
15030 | In the following tables, the value C_S represents the color sampled from | |
15031 | the currently bound texture, C_C represents the constant | |
15032 | texture-environment color, C_F represents the primary color of the | |
15033 | incoming fragment, and C_P represents the color computed from the | |
15034 | previous texture stage or C_F if processing texture stage 0. Likewise, | |
15035 | A_S , A_C , A_F , and A_P represent the respective alpha values. | |
15036 | ||
15037 | The following table describes the values assigned to ARG0 , ARG1 , and | |
15038 | ARG2 based upon the RGB sources and operands: | |
15039 | ||
15040 | ||
15041 | ||
15042 | *`GL_SRCn_RGB'* | |
15043 | *`GL_OPERANDn_RGB'*, *Argument Value* | |
15044 | ||
15045 | `GL_TEXTURE' | |
15046 | `GL_SRC_COLOR', C_S, | |
15047 | ||
15048 | ||
15049 | `GL_ONE_MINUS_SRC_COLOR', 1-C_S, | |
15050 | ||
15051 | ||
15052 | `GL_SRC_ALPHA', A_S, | |
15053 | ||
15054 | ||
15055 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_S, | |
15056 | ||
15057 | `GL_TEXTUREn' | |
15058 | `GL_SRC_COLOR', C_S, | |
15059 | ||
15060 | ||
15061 | `GL_ONE_MINUS_SRC_COLOR', 1-C_S, | |
15062 | ||
15063 | ||
15064 | `GL_SRC_ALPHA', A_S, | |
15065 | ||
15066 | ||
15067 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_S, | |
15068 | ||
15069 | `GL_CONSTANT' | |
15070 | `GL_SRC_COLOR', C_C, | |
15071 | ||
15072 | ||
15073 | `GL_ONE_MINUS_SRC_COLOR', 1-C_C, | |
15074 | ||
15075 | ||
15076 | `GL_SRC_ALPHA', A_C, | |
15077 | ||
15078 | ||
15079 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_C, | |
15080 | ||
15081 | `GL_PRIMARY_COLOR' | |
15082 | `GL_SRC_COLOR', C_F, | |
15083 | ||
8925f36f | 15084 | |
3c9b6116 | 15085 | `GL_ONE_MINUS_SRC_COLOR', 1-C_F, |
8925f36f | 15086 | |
8925f36f | 15087 | |
3c9b6116 | 15088 | `GL_SRC_ALPHA', A_F, |
8925f36f | 15089 | |
8925f36f | 15090 | |
3c9b6116 | 15091 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_F, |
8925f36f | 15092 | |
3c9b6116 AW |
15093 | `GL_PREVIOUS' |
15094 | `GL_SRC_COLOR', C_P, | |
8925f36f | 15095 | |
8925f36f | 15096 | |
3c9b6116 | 15097 | `GL_ONE_MINUS_SRC_COLOR', 1-C_P, |
8925f36f | 15098 | |
8925f36f | 15099 | |
3c9b6116 | 15100 | `GL_SRC_ALPHA', A_P, |
8925f36f | 15101 | |
8925f36f | 15102 | |
3c9b6116 | 15103 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_P, |
8925f36f | 15104 | |
3c9b6116 AW |
15105 | For `GL_TEXTUREn' sources, C_S and A_S represent the color and alpha, |
15106 | respectively, produced from texture stage N . | |
8925f36f | 15107 | |
3c9b6116 AW |
15108 | The follow table describes the values assigned to ARG0 , ARG1 , and ARG2 |
15109 | based upon the alpha sources and operands: | |
8925f36f | 15110 | |
8925f36f | 15111 | |
8925f36f | 15112 | |
3c9b6116 AW |
15113 | *`GL_SRCn_ALPHA'* |
15114 | *`GL_OPERANDn_ALPHA'*, *Argument Value* | |
8925f36f | 15115 | |
3c9b6116 AW |
15116 | `GL_TEXTURE' |
15117 | `GL_SRC_ALPHA', A_S, | |
8925f36f | 15118 | |
8925f36f | 15119 | |
3c9b6116 | 15120 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_S, |
8925f36f | 15121 | |
3c9b6116 AW |
15122 | `GL_TEXTUREn' |
15123 | `GL_SRC_ALPHA', A_S, | |
8925f36f | 15124 | |
8925f36f | 15125 | |
3c9b6116 | 15126 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_S, |
8925f36f | 15127 | |
3c9b6116 AW |
15128 | `GL_CONSTANT' |
15129 | `GL_SRC_ALPHA', A_C, | |
8925f36f | 15130 | |
8925f36f | 15131 | |
3c9b6116 | 15132 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_C, |
8925f36f | 15133 | |
3c9b6116 AW |
15134 | `GL_PRIMARY_COLOR' |
15135 | `GL_SRC_ALPHA', A_F, | |
8925f36f | 15136 | |
8925f36f | 15137 | |
3c9b6116 AW |
15138 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_F, |
15139 | ||
15140 | `GL_PREVIOUS' | |
15141 | `GL_SRC_ALPHA', A_P, | |
15142 | ||
15143 | ||
15144 | `GL_ONE_MINUS_SRC_ALPHA', 1-A_P, | |
15145 | ||
15146 | The RGB and alpha results of the texture function are multipled by the | |
15147 | values of `GL_RGB_SCALE' and `GL_ALPHA_SCALE', respectively, and clamped | |
15148 | to the range [0,1] . | |
15149 | ||
15150 | If PNAME is `GL_TEXTURE_ENV_COLOR', PARAMS is a pointer to an array that | |
15151 | holds an RGBA color consisting of four values. Integer color components | |
15152 | are interpreted linearly such that the most positive integer maps to | |
15153 | 1.0, and the most negative integer maps to -1.0. The values are clamped | |
15154 | to the range [0,1] when they are specified. C_C takes these four values. | |
15155 | ||
15156 | If PNAME is `GL_TEXTURE_LOD_BIAS', the value specified is added to the | |
15157 | texture level-of-detail parameter, that selects which mipmap, or mipmaps | |
15158 | depending upon the selected `GL_TEXTURE_MIN_FILTER', will be sampled. | |
15159 | ||
15160 | `GL_TEXTURE_ENV_MODE' defaults to `GL_MODULATE' and | |
15161 | `GL_TEXTURE_ENV_COLOR' defaults to (0, 0, 0, 0). | |
8925f36f | 15162 | |
3c9b6116 AW |
15163 | If TARGET is `GL_POINT_SPRITE' and PNAME is `GL_COORD_REPLACE', the |
15164 | boolean value specified is used to either enable or disable point sprite | |
15165 | texture coordinate replacement. The default value is `GL_FALSE'. | |
8925f36f | 15166 | |
3c9b6116 AW |
15167 | `GL_INVALID_ENUM' is generated when TARGET or PNAME is not one of the |
15168 | accepted defined values, or when PARAMS should have a defined constant | |
15169 | value (based on the value of PNAME) and does not. | |
15170 | ||
15171 | `GL_INVALID_VALUE' is generated if the PARAMS value for `GL_RGB_SCALE' | |
15172 | or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0. | |
15173 | ||
15174 | `GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between | |
15175 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
15176 | |
15177 | (define-gl-procedure | |
bb894c9d AW |
15178 | ((glTexGeni |
15179 | (coord GLenum) | |
15180 | (pname GLenum) | |
15181 | (param GLint) | |
15182 | -> | |
15183 | void) | |
15184 | (glTexGend | |
15185 | (coord GLenum) | |
15186 | (pname GLenum) | |
15187 | (param GLdouble) | |
15188 | -> | |
15189 | void)) | |
3c9b6116 | 15190 | "Control the generation of texture coordinates. |
8925f36f | 15191 | |
3c9b6116 AW |
15192 | COORD |
15193 | Specifies a texture coordinate. Must be one of `GL_S', `GL_T', | |
15194 | `GL_R', or `GL_Q'. | |
8925f36f | 15195 | |
3c9b6116 AW |
15196 | PNAME |
15197 | Specifies the symbolic name of the texture-coordinate generation | |
15198 | function. Must be `GL_TEXTURE_GEN_MODE'. | |
8925f36f | 15199 | |
3c9b6116 AW |
15200 | PARAM |
15201 | Specifies a single-valued texture generation parameter, one of | |
15202 | `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', | |
15203 | `GL_NORMAL_MAP', or `GL_REFLECTION_MAP'. | |
8925f36f | 15204 | |
3c9b6116 AW |
15205 | `glTexGen' selects a texture-coordinate generation function or supplies |
15206 | coefficients for one of the functions. COORD names one of the (S, T, R, | |
15207 | Q) texture coordinates; it must be one of the symbols `GL_S', `GL_T', | |
15208 | `GL_R', or `GL_Q'. PNAME must be one of three symbolic constants: | |
15209 | `GL_TEXTURE_GEN_MODE', `GL_OBJECT_PLANE', or `GL_EYE_PLANE'. If PNAME is | |
15210 | `GL_TEXTURE_GEN_MODE', then PARAMS chooses a mode, one of | |
15211 | `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', `GL_NORMAL_MAP', | |
15212 | or `GL_REFLECTION_MAP'. If PNAME is either `GL_OBJECT_PLANE' or | |
15213 | `GL_EYE_PLANE', PARAMS contains coefficients for the corresponding | |
15214 | texture generation function. | |
8925f36f | 15215 | |
3c9b6116 | 15216 | If the texture generation function is `GL_OBJECT_LINEAR', the function |
8925f36f | 15217 | |
3c9b6116 | 15218 | G=P_1×X_O+P_2×Y_O+P_3×Z_O+P_4×W_O |
8925f36f | 15219 | |
3c9b6116 AW |
15220 | is used, where G is the value computed for the coordinate named in |
15221 | COORD, P_1 , P_2 , P_3 , and P_4 are the four values supplied in PARAMS, | |
15222 | and X_O , Y_O , Z_O , and W_O are the object coordinates of the vertex. | |
15223 | This function can be used, for example, to texture-map terrain using sea | |
15224 | level as a reference plane (defined by P_1 , P_2 , P_3 , and P_4 ). The | |
15225 | altitude of a terrain vertex is computed by the `GL_OBJECT_LINEAR' | |
15226 | coordinate generation function as its distance from sea level; that | |
15227 | altitude can then be used to index the texture image to map white snow | |
15228 | onto peaks and green grass onto foothills. | |
8925f36f | 15229 | |
3c9b6116 AW |
15230 | If the texture generation function is `GL_EYE_LINEAR', the function |
15231 | ||
15232 | G=P_1,^″×X_E+P_2,^″×Y_E+P_3,^″×Z_E+P_4,^″×W_E | |
15233 | ||
15234 | is used, where | |
15235 | ||
15236 | (P_1,^″\u2062P_2,^″\u2062P_3,^″\u2062P_4,^″,)=(P_1\u2062P_2\u2062P_3\u2062P_4,)\u2062M^-1 | |
15237 | ||
15238 | and X_E , Y_E , Z_E , and W_E are the eye coordinates of the vertex, P_1 | |
15239 | , P_2 , P_3 , and P_4 are the values supplied in PARAMS, and M is the | |
15240 | modelview matrix when `glTexGen' is invoked. If M is poorly conditioned | |
15241 | or singular, texture coordinates generated by the resulting function may | |
15242 | be inaccurate or undefined. | |
15243 | ||
15244 | Note that the values in PARAMS define a reference plane in eye | |
15245 | coordinates. The modelview matrix that is applied to them may not be the | |
15246 | same one in effect when the polygon vertices are transformed. This | |
15247 | function establishes a field of texture coordinates that can produce | |
15248 | dynamic contour lines on moving objects. | |
15249 | ||
15250 | If the texture generation function is `GL_SPHERE_MAP' and COORD is | |
15251 | either `GL_S' or `GL_T', S and T texture coordinates are generated as | |
15252 | follows. Let U be the unit vector pointing from the origin to the | |
15253 | polygon vertex (in eye coordinates). Let N sup prime be the current | |
15254 | normal, after transformation to eye coordinates. Let | |
15255 | ||
15256 | F=(F_X\u2062F_Y\u2062F_Z,)^T be the reflection vector such that | |
15257 | ||
15258 | F=U-2\u2062N^″\u2062N^″,^T\u2062U | |
15259 | ||
15260 | Finally, let M=2\u2062√(F_X,^2+F_Y,^2+(F_Z+1,)^2,) . Then the values assigned | |
15261 | to the S and T texture coordinates are | |
15262 | ||
15263 | S=F_X/M+1/2 | |
15264 | ||
15265 | T=F_Y/M+1/2 | |
15266 | ||
15267 | To enable or disable a texture-coordinate generation function, call | |
15268 | `glEnable' or `glDisable' with one of the symbolic texture-coordinate | |
15269 | names (`GL_TEXTURE_GEN_S', `GL_TEXTURE_GEN_T', `GL_TEXTURE_GEN_R', or | |
15270 | `GL_TEXTURE_GEN_Q') as the argument. When enabled, the specified texture | |
15271 | coordinate is computed according to the generating function associated | |
15272 | with that coordinate. When disabled, subsequent vertices take the | |
15273 | specified texture coordinate from the current set of texture | |
15274 | coordinates. Initially, all texture generation functions are set to | |
15275 | `GL_EYE_LINEAR' and are disabled. Both S plane equations are (1, 0, 0, | |
15276 | 0), both T plane equations are (0, 1, 0, 0), and all R and Q plane | |
15277 | equations are (0, 0, 0, 0). | |
15278 | ||
15279 | When the `ARB_multitexture' extension is supported, `glTexGen' sets the | |
15280 | texture generation parameters for the currently active texture unit, | |
15281 | selected with `glActiveTexture'. | |
15282 | ||
15283 | `GL_INVALID_ENUM' is generated when COORD or PNAME is not an accepted | |
15284 | defined value, or when PNAME is `GL_TEXTURE_GEN_MODE' and PARAMS is not | |
15285 | an accepted defined value. | |
15286 | ||
15287 | `GL_INVALID_ENUM' is generated when PNAME is `GL_TEXTURE_GEN_MODE', | |
15288 | PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'. | |
15289 | ||
15290 | `GL_INVALID_OPERATION' is generated if `glTexGen' is executed between | |
15291 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
15292 | |
15293 | (define-gl-procedure | |
bb894c9d AW |
15294 | ((glTexImage1D |
15295 | (target GLenum) | |
15296 | (level GLint) | |
15297 | (internalFormat GLint) | |
15298 | (width GLsizei) | |
15299 | (border GLint) | |
15300 | (format GLenum) | |
15301 | (type GLenum) | |
15302 | (data *) | |
15303 | -> | |
15304 | void)) | |
3c9b6116 | 15305 | "Specify a one-dimensional texture image. |
8925f36f | 15306 | |
3c9b6116 AW |
15307 | TARGET |
15308 | Specifies the target texture. Must be `GL_TEXTURE_1D' or | |
15309 | `GL_PROXY_TEXTURE_1D'. | |
8925f36f | 15310 | |
3c9b6116 AW |
15311 | LEVEL |
15312 | Specifies the level-of-detail number. Level 0 is the base image | |
15313 | level. Level N is the Nth mipmap reduction image. | |
8925f36f | 15314 | |
3c9b6116 AW |
15315 | INTERNALFORMAT |
15316 | Specifies the number of color components in the texture. Must be 1, | |
15317 | 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA', | |
15318 | `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', | |
15319 | `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE', | |
15320 | `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY', | |
15321 | `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', | |
15322 | `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', | |
15323 | `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4', | |
15324 | `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16', | |
15325 | `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
15326 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
15327 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
15328 | `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4', | |
15329 | `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2', | |
15330 | `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', | |
15331 | `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', | |
15332 | `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16', | |
15333 | `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA', | |
15334 | `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or | |
15335 | `GL_SRGB8_ALPHA8'. | |
8925f36f | 15336 | |
3c9b6116 AW |
15337 | WIDTH |
15338 | Specifies the width of the texture image including the border if | |
15339 | any. If the GL version does not support non-power-of-two sizes, | |
15340 | this value must be 2^N+2\u2061(BORDER,) for some integer N . All | |
15341 | implementations support texture images that are at least 64 texels | |
15342 | wide. The height of the 1D texture image is 1. | |
8925f36f | 15343 | |
3c9b6116 AW |
15344 | BORDER |
15345 | Specifies the width of the border. Must be either 0 or 1. | |
8925f36f | 15346 | |
3c9b6116 AW |
15347 | FORMAT |
15348 | Specifies the format of the pixel data. The following symbolic | |
15349 | values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN', | |
15350 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', | |
15351 | `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'. | |
8925f36f | 15352 | |
3c9b6116 AW |
15353 | TYPE |
15354 | Specifies the data type of the pixel data. The following symbolic | |
15355 | values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', | |
15356 | `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', | |
15357 | `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
15358 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
15359 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
15360 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
15361 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
15362 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
15363 | ||
15364 | DATA | |
15365 | Specifies a pointer to the image data in memory. | |
15366 | ||
15367 | Texturing maps a portion of a specified texture image onto each | |
15368 | graphical primitive for which texturing is enabled. To enable and | |
15369 | disable one-dimensional texturing, call `glEnable' and `glDisable' with | |
15370 | argument `GL_TEXTURE_1D'. | |
15371 | ||
15372 | Texture images are defined with `glTexImage1D'. The arguments describe | |
15373 | the parameters of the texture image, such as width, width of the border, | |
15374 | level-of-detail number (see `glTexParameter'), and the internal | |
15375 | resolution and format used to store the image. The last three arguments | |
15376 | describe how the image is represented in memory; they are identical to | |
15377 | the pixel formats used for `glDrawPixels'. | |
15378 | ||
15379 | If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all | |
15380 | of the texture image state is recalculated, checked for consistency, and | |
15381 | checked against the implementation's capabilities. If the implementation | |
15382 | cannot handle a texture of the requested texture size, it sets all of | |
15383 | the image state to 0, but does not generate an error (see `glGetError'). | |
15384 | To query for an entire mipmap array, use an image array level greater | |
15385 | than or equal to 1. | |
15386 | ||
15387 | If TARGET is `GL_TEXTURE_1D', data is read from DATA as a sequence of | |
15388 | signed or unsigned bytes, shorts, or longs, or single-precision | |
15389 | floating-point values, depending on TYPE. These values are grouped into | |
15390 | sets of one, two, three, or four values, depending on FORMAT, to form | |
15391 | elements. If TYPE is `GL_BITMAP', the data is considered as a string of | |
15392 | unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is | |
15393 | treated as eight 1-bit elements, with bit ordering determined by | |
15394 | `GL_UNPACK_LSB_FIRST' (see `glPixelStore'). | |
15395 | ||
15396 | If a non-zero named buffer object is bound to the | |
15397 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
15398 | image is specified, DATA is treated as a byte offset into the buffer | |
15399 | object's data store. | |
15400 | ||
15401 | The first element corresponds to the left end of the texture array. | |
15402 | Subsequent elements progress left-to-right through the remaining texels | |
15403 | in the texture array. The final element corresponds to the right end of | |
15404 | the texture array. | |
15405 | ||
15406 | FORMAT determines the composition of each element in DATA. It can assume | |
15407 | one of these symbolic values: | |
15408 | ||
15409 | `GL_COLOR_INDEX' | |
15410 | Each element is a single value, a color index. The GL converts it | |
15411 | to fixed point (with an unspecified number of zero bits to the | |
15412 | right of the binary point), shifted left or right depending on the | |
15413 | value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET' | |
15414 | (see `glPixelTransfer'). The resulting index is converted to a set | |
15415 | of color components using the `GL_PIXEL_MAP_I_TO_R', | |
15416 | `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and | |
15417 | `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1]. | |
15418 | ||
15419 | `GL_RED' | |
15420 | Each element is a single red component. The GL converts it to | |
15421 | floating point and assembles it into an RGBA element by attaching 0 | |
15422 | for green and blue, and 1 for alpha. Each component is then | |
15423 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
15424 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
15425 | `glPixelTransfer'). | |
15426 | ||
15427 | `GL_GREEN' | |
15428 | Each element is a single green component. The GL converts it to | |
15429 | floating point and assembles it into an RGBA element by attaching 0 | |
15430 | for red and blue, and 1 for alpha. Each component is then | |
15431 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
15432 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
15433 | `glPixelTransfer'). | |
15434 | ||
15435 | `GL_BLUE' | |
15436 | Each element is a single blue component. The GL converts it to | |
15437 | floating point and assembles it into an RGBA element by attaching 0 | |
15438 | for red and green, and 1 for alpha. Each component is then | |
15439 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
15440 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
15441 | `glPixelTransfer'). | |
15442 | ||
15443 | `GL_ALPHA' | |
15444 | Each element is a single alpha component. The GL converts it to | |
15445 | floating point and assembles it into an RGBA element by attaching 0 | |
15446 | for red, green, and blue. Each component is then multiplied by the | |
15447 | signed scale factor `GL_c_SCALE', added to the signed bias | |
15448 | `GL_c_BIAS', and clamped to the range [0,1] (see | |
15449 | `glPixelTransfer'). | |
15450 | ||
15451 | `GL_INTENSITY' | |
15452 | Each element is a single intensity value. The GL converts it to | |
15453 | floating point, then assembles it into an RGBA element by | |
15454 | replicating the intensity value three times for red, green, blue, | |
15455 | and alpha. Each component is then multiplied by the signed scale | |
15456 | factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and | |
15457 | clamped to the range [0,1] (see `glPixelTransfer'). | |
15458 | ||
15459 | `GL_RGB' | |
15460 | `GL_BGR' | |
15461 | Each element is an RGB triple. The GL converts it to floating point | |
15462 | and assembles it into an RGBA element by attaching 1 for alpha. | |
15463 | Each component is then multiplied by the signed scale factor | |
15464 | `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to | |
15465 | the range [0,1] (see `glPixelTransfer'). | |
15466 | ||
15467 | `GL_RGBA' | |
15468 | `GL_BGRA' | |
15469 | Each element contains all four components. Each component is | |
15470 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
15471 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
15472 | `glPixelTransfer'). | |
15473 | ||
15474 | `GL_LUMINANCE' | |
15475 | Each element is a single luminance value. The GL converts it to | |
15476 | floating point, then assembles it into an RGBA element by | |
15477 | replicating the luminance value three times for red, green, and | |
15478 | blue and attaching 1 for alpha. Each component is then multiplied | |
15479 | by the signed scale factor `GL_c_SCALE', added to the signed bias | |
15480 | `GL_c_BIAS', and clamped to the range [0,1] (see | |
15481 | `glPixelTransfer'). | |
15482 | ||
15483 | `GL_LUMINANCE_ALPHA' | |
15484 | Each element is a luminance/alpha pair. The GL converts it to | |
15485 | floating point, then assembles it into an RGBA element by | |
15486 | replicating the luminance value three times for red, green, and | |
15487 | blue. Each component is then multiplied by the signed scale factor | |
15488 | `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to | |
15489 | the range [0,1] (see `glPixelTransfer'). | |
15490 | ||
15491 | `GL_DEPTH_COMPONENT' | |
15492 | Each element is a single depth value. The GL converts it to | |
15493 | floating point, multiplies by the signed scale factor | |
15494 | `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps | |
15495 | to the range [0,1] (see `glPixelTransfer'). | |
15496 | ||
15497 | Refer to the `glDrawPixels' reference page for a description of the | |
15498 | acceptable values for the TYPE parameter. | |
15499 | ||
15500 | If an application wants to store the texture at a certain resolution or | |
15501 | in a certain format, it can request the resolution and format with | |
15502 | INTERNALFORMAT. The GL will choose an internal representation that | |
15503 | closely approximates that requested by INTERNALFORMAT, but it may not | |
15504 | match exactly. (The representations specified by `GL_LUMINANCE', | |
15505 | `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The | |
15506 | numeric values 1, 2, 3, and 4 may also be used to specify the above | |
15507 | representations.) | |
15508 | ||
15509 | If the INTERNALFORMAT parameter is one of the generic compressed | |
15510 | formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY', | |
15511 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
15512 | `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the | |
15513 | internal format with the symbolic constant for a specific internal | |
15514 | format and compress the texture before storage. If no corresponding | |
15515 | internal format is available, or the GL can not compress that image for | |
15516 | any reason, the internal format is instead replaced with a corresponding | |
15517 | base internal format. | |
15518 | ||
15519 | If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8', | |
15520 | `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8', | |
15521 | `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is | |
15522 | treated as if the red, green, blue, or luminance components are encoded | |
15523 | in the sRGB color space. Any alpha component is left unchanged. The | |
15524 | conversion from the sRGB encoded component C_S to a linear component C_L | |
15525 | is: | |
15526 | ||
15527 | C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if | |
15528 | C_S>0.04045) | |
15529 | ||
15530 | Assume C_S is the sRGB component in the range [0,1]. | |
15531 | ||
15532 | Use the `GL_PROXY_TEXTURE_1D' target to try out a resolution and format. | |
15533 | The implementation will update and recompute its best match for the | |
15534 | requested storage resolution and format. To then query this state, call | |
15535 | `glGetTexLevelParameter'. If the texture cannot be accommodated, texture | |
15536 | state is set to 0. | |
15537 | ||
15538 | A one-component texture image uses only the red component of the RGBA | |
15539 | color from DATA. A two-component image uses the R and A values. A | |
15540 | three-component image uses the R, G, and B values. A four-component | |
15541 | image uses all of the RGBA components. | |
15542 | ||
15543 | Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures | |
15544 | during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be | |
15545 | \xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to | |
15546 | generate a boolean result. See `glTexParameter' for details on texture | |
15547 | comparison. | |
15548 | ||
15549 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_1D' or | |
15550 | `GL_PROXY_TEXTURE_1D'. | |
15551 | ||
15552 | `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format | |
15553 | constant. Format constants other than `GL_STENCIL_INDEX' are accepted. | |
15554 | ||
15555 | `GL_INVALID_ENUM' is generated if TYPE is not a type constant. | |
15556 | ||
15557 | `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not | |
15558 | `GL_COLOR_INDEX'. | |
15559 | ||
15560 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
8925f36f | 15561 | |
3c9b6116 AW |
15562 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than |
15563 | LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
8925f36f | 15564 | |
3c9b6116 AW |
15565 | `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or |
15566 | one of the accepted resolution and format symbolic constants. | |
8925f36f | 15567 | |
3c9b6116 AW |
15568 | `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than |
15569 | 2 + `GL_MAX_TEXTURE_SIZE'. | |
8925f36f | 15570 | |
3c9b6116 AW |
15571 | `GL_INVALID_VALUE' is generated if non-power-of-two textures are not |
15572 | supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for | |
15573 | some integer value of N. | |
8925f36f | 15574 | |
3c9b6116 | 15575 | `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1. |
8925f36f | 15576 | |
3c9b6116 AW |
15577 | `GL_INVALID_OPERATION' is generated if TYPE is one of |
15578 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
15579 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
15580 | is not `GL_RGB'. | |
8925f36f | 15581 | |
3c9b6116 AW |
15582 | `GL_INVALID_OPERATION' is generated if TYPE is one of |
15583 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
15584 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
15585 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
15586 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
15587 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
8925f36f | 15588 | |
3c9b6116 AW |
15589 | `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT' |
15590 | and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', | |
15591 | `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'. | |
8925f36f | 15592 | |
3c9b6116 AW |
15593 | `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is |
15594 | `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or | |
15595 | `GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'. | |
8925f36f | 15596 | |
3c9b6116 AW |
15597 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
15598 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
15599 | data store is currently mapped. | |
8925f36f | 15600 | |
3c9b6116 AW |
15601 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
15602 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
15603 | unpacked from the buffer object such that the memory reads required | |
15604 | would exceed the data store size. | |
8925f36f | 15605 | |
3c9b6116 AW |
15606 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is |
15607 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
15608 | divisible into the number of bytes needed to store in memory a datum | |
15609 | indicated by TYPE. | |
15610 | ||
15611 | `GL_INVALID_OPERATION' is generated if `glTexImage1D' is executed | |
15612 | between the execution of `glBegin' and the corresponding execution of | |
15613 | `glEnd'.") | |
8925f36f AW |
15614 | |
15615 | (define-gl-procedure | |
bb894c9d AW |
15616 | ((glTexImage2D |
15617 | (target GLenum) | |
15618 | (level GLint) | |
15619 | (internalFormat GLint) | |
15620 | (width GLsizei) | |
15621 | (height GLsizei) | |
15622 | (border GLint) | |
15623 | (format GLenum) | |
15624 | (type GLenum) | |
15625 | (data *) | |
15626 | -> | |
15627 | void)) | |
3c9b6116 | 15628 | "Specify a two-dimensional texture image. |
8925f36f | 15629 | |
3c9b6116 AW |
15630 | TARGET |
15631 | Specifies the target texture. Must be `GL_TEXTURE_2D', | |
15632 | `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X', | |
15633 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', | |
15634 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', | |
15635 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'. | |
8925f36f | 15636 | |
3c9b6116 AW |
15637 | LEVEL |
15638 | Specifies the level-of-detail number. Level 0 is the base image | |
15639 | level. Level N is the Nth mipmap reduction image. | |
8925f36f | 15640 | |
3c9b6116 AW |
15641 | INTERNALFORMAT |
15642 | Specifies the number of color components in the texture. Must be 1, | |
15643 | 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA', | |
15644 | `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', | |
15645 | `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE', | |
15646 | `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY', | |
15647 | `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', | |
15648 | `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', | |
15649 | `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4', | |
15650 | `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16', | |
15651 | `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
15652 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
15653 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
15654 | `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4', | |
15655 | `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2', | |
15656 | `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', | |
15657 | `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', | |
15658 | `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16', | |
15659 | `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA', | |
15660 | `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or | |
15661 | `GL_SRGB8_ALPHA8'. | |
8925f36f | 15662 | |
3c9b6116 AW |
15663 | WIDTH |
15664 | Specifies the width of the texture image including the border if | |
15665 | any. If the GL version does not support non-power-of-two sizes, | |
15666 | this value must be 2^N+2\u2061(BORDER,) for some integer N . All | |
15667 | implementations support texture images that are at least 64 texels | |
15668 | wide. | |
8925f36f | 15669 | |
3c9b6116 AW |
15670 | HEIGHT |
15671 | Specifies the height of the texture image including the border if | |
15672 | any. If the GL version does not support non-power-of-two sizes, | |
15673 | this value must be 2^M+2\u2061(BORDER,) for some integer M . All | |
15674 | implementations support texture images that are at least 64 texels | |
15675 | high. | |
8925f36f | 15676 | |
3c9b6116 AW |
15677 | BORDER |
15678 | Specifies the width of the border. Must be either 0 or 1. | |
8925f36f | 15679 | |
3c9b6116 AW |
15680 | FORMAT |
15681 | Specifies the format of the pixel data. The following symbolic | |
15682 | values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN', | |
15683 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', | |
15684 | `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'. | |
8925f36f | 15685 | |
3c9b6116 AW |
15686 | TYPE |
15687 | Specifies the data type of the pixel data. The following symbolic | |
15688 | values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', | |
15689 | `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', | |
15690 | `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
15691 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
15692 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
15693 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
15694 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
15695 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
8925f36f | 15696 | |
3c9b6116 AW |
15697 | DATA |
15698 | Specifies a pointer to the image data in memory. | |
8925f36f | 15699 | |
3c9b6116 AW |
15700 | Texturing maps a portion of a specified texture image onto each |
15701 | graphical primitive for which texturing is enabled. To enable and | |
15702 | disable two-dimensional texturing, call `glEnable' and `glDisable' with | |
15703 | argument `GL_TEXTURE_2D'. To enable and disable texturing using | |
15704 | cube-mapped texture, call `glEnable' and `glDisable' with argument | |
15705 | `GL_TEXTURE_CUBE_MAP'. | |
15706 | ||
15707 | To define texture images, call `glTexImage2D'. The arguments describe | |
15708 | the parameters of the texture image, such as height, width, width of the | |
15709 | border, level-of-detail number (see `glTexParameter'), and number of | |
15710 | color components provided. The last three arguments describe how the | |
15711 | image is represented in memory; they are identical to the pixel formats | |
15712 | used for `glDrawPixels'. | |
15713 | ||
15714 | If TARGET is `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP', no | |
15715 | data is read from DATA, but all of the texture image state is | |
15716 | recalculated, checked for consistency, and checked against the | |
15717 | implementation's capabilities. If the implementation cannot handle a | |
15718 | texture of the requested texture size, it sets all of the image state to | |
15719 | 0, but does not generate an error (see `glGetError'). To query for an | |
15720 | entire mipmap array, use an image array level greater than or equal to | |
15721 | 1. | |
15722 | ||
15723 | If TARGET is `GL_TEXTURE_2D', or one of the `GL_TEXTURE_CUBE_MAP' | |
15724 | targets, data is read from DATA as a sequence of signed or unsigned | |
15725 | bytes, shorts, or longs, or single-precision floating-point values, | |
15726 | depending on TYPE. These values are grouped into sets of one, two, | |
15727 | three, or four values, depending on FORMAT, to form elements. If TYPE is | |
15728 | `GL_BITMAP', the data is considered as a string of unsigned bytes (and | |
15729 | FORMAT must be `GL_COLOR_INDEX'). Each data byte is treated as eight | |
15730 | 1-bit elements, with bit ordering determined by `GL_UNPACK_LSB_FIRST' | |
15731 | (see `glPixelStore'). | |
15732 | ||
15733 | If a non-zero named buffer object is bound to the | |
15734 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
15735 | image is specified, DATA is treated as a byte offset into the buffer | |
15736 | object's data store. | |
15737 | ||
15738 | The first element corresponds to the lower left corner of the texture | |
15739 | image. Subsequent elements progress left-to-right through the remaining | |
15740 | texels in the lowest row of the texture image, and then in successively | |
15741 | higher rows of the texture image. The final element corresponds to the | |
15742 | upper right corner of the texture image. | |
15743 | ||
15744 | FORMAT determines the composition of each element in DATA. It can assume | |
15745 | one of these symbolic values: | |
15746 | ||
15747 | `GL_COLOR_INDEX' | |
15748 | Each element is a single value, a color index. The GL converts it | |
15749 | to fixed point (with an unspecified number of zero bits to the | |
15750 | right of the binary point), shifted left or right depending on the | |
15751 | value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET' | |
15752 | (see `glPixelTransfer'). The resulting index is converted to a set | |
15753 | of color components using the `GL_PIXEL_MAP_I_TO_R', | |
15754 | `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and | |
15755 | `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1]. | |
15756 | ||
15757 | `GL_RED' | |
15758 | Each element is a single red component. The GL converts it to | |
15759 | floating point and assembles it into an RGBA element by attaching 0 | |
15760 | for green and blue, and 1 for alpha. Each component is then | |
15761 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
15762 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
15763 | `glPixelTransfer'). | |
15764 | ||
15765 | `GL_GREEN' | |
15766 | Each element is a single green component. The GL converts it to | |
15767 | floating point and assembles it into an RGBA element by attaching 0 | |
15768 | for red and blue, and 1 for alpha. Each component is then | |
15769 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
15770 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
15771 | `glPixelTransfer'). | |
15772 | ||
15773 | `GL_BLUE' | |
15774 | Each element is a single blue component. The GL converts it to | |
15775 | floating point and assembles it into an RGBA element by attaching 0 | |
15776 | for red and green, and 1 for alpha. Each component is then | |
15777 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
15778 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
15779 | `glPixelTransfer'). | |
15780 | ||
15781 | `GL_ALPHA' | |
15782 | Each element is a single alpha component. The GL converts it to | |
15783 | floating point and assembles it into an RGBA element by attaching 0 | |
15784 | for red, green, and blue. Each component is then multiplied by the | |
15785 | signed scale factor `GL_c_SCALE', added to the signed bias | |
15786 | `GL_c_BIAS', and clamped to the range [0,1] (see | |
15787 | `glPixelTransfer'). | |
15788 | ||
15789 | `GL_INTENSITY' | |
15790 | Each element is a single intensity value. The GL converts it to | |
15791 | floating point, then assembles it into an RGBA element by | |
15792 | replicating the intensity value three times for red, green, blue, | |
15793 | and alpha. Each component is then multiplied by the signed scale | |
15794 | factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and | |
15795 | clamped to the range [0,1] (see `glPixelTransfer'). | |
15796 | ||
15797 | `GL_RGB' | |
15798 | `GL_BGR' | |
15799 | Each element is an RGB triple. The GL converts it to floating point | |
15800 | and assembles it into an RGBA element by attaching 1 for alpha. | |
15801 | Each component is then multiplied by the signed scale factor | |
15802 | `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to | |
15803 | the range [0,1] (see `glPixelTransfer'). | |
15804 | ||
15805 | `GL_RGBA' | |
15806 | `GL_BGRA' | |
15807 | Each element contains all four components. Each component is | |
15808 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
15809 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
15810 | `glPixelTransfer'). | |
15811 | ||
15812 | `GL_LUMINANCE' | |
15813 | Each element is a single luminance value. The GL converts it to | |
15814 | floating point, then assembles it into an RGBA element by | |
15815 | replicating the luminance value three times for red, green, and | |
15816 | blue and attaching 1 for alpha. Each component is then multiplied | |
15817 | by the signed scale factor `GL_c_SCALE', added to the signed bias | |
15818 | `GL_c_BIAS', and clamped to the range [0,1] (see | |
15819 | `glPixelTransfer'). | |
15820 | ||
15821 | `GL_LUMINANCE_ALPHA' | |
15822 | Each element is a luminance/alpha pair. The GL converts it to | |
15823 | floating point, then assembles it into an RGBA element by | |
15824 | replicating the luminance value three times for red, green, and | |
15825 | blue. Each component is then multiplied by the signed scale factor | |
15826 | `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to | |
15827 | the range [0,1] (see `glPixelTransfer'). | |
15828 | ||
15829 | `GL_DEPTH_COMPONENT' | |
15830 | Each element is a single depth value. The GL converts it to | |
15831 | floating point, multiplies by the signed scale factor | |
15832 | `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps | |
15833 | to the range [0,1] (see `glPixelTransfer'). | |
15834 | ||
15835 | Refer to the `glDrawPixels' reference page for a description of the | |
15836 | acceptable values for the TYPE parameter. | |
15837 | ||
15838 | If an application wants to store the texture at a certain resolution or | |
15839 | in a certain format, it can request the resolution and format with | |
15840 | INTERNALFORMAT. The GL will choose an internal representation that | |
15841 | closely approximates that requested by INTERNALFORMAT, but it may not | |
15842 | match exactly. (The representations specified by `GL_LUMINANCE', | |
15843 | `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The | |
15844 | numeric values 1, 2, 3, and 4 may also be used to specify the above | |
15845 | representations.) | |
15846 | ||
15847 | If the INTERNALFORMAT parameter is one of the generic compressed | |
15848 | formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY', | |
15849 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
15850 | `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the | |
15851 | internal format with the symbolic constant for a specific internal | |
15852 | format and compress the texture before storage. If no corresponding | |
15853 | internal format is available, or the GL can not compress that image for | |
15854 | any reason, the internal format is instead replaced with a corresponding | |
15855 | base internal format. | |
15856 | ||
15857 | If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8', | |
15858 | `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8', | |
15859 | `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is | |
15860 | treated as if the red, green, blue, or luminance components are encoded | |
15861 | in the sRGB color space. Any alpha component is left unchanged. The | |
15862 | conversion from the sRGB encoded component C_S to a linear component C_L | |
15863 | is: | |
15864 | ||
15865 | C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if | |
15866 | C_S>0.04045) | |
15867 | ||
15868 | Assume C_S is the sRGB component in the range [0,1]. | |
15869 | ||
15870 | Use the `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP' target to | |
15871 | try out a resolution and format. The implementation will update and | |
15872 | recompute its best match for the requested storage resolution and | |
15873 | format. To then query this state, call `glGetTexLevelParameter'. If the | |
15874 | texture cannot be accommodated, texture state is set to 0. | |
15875 | ||
15876 | A one-component texture image uses only the red component of the RGBA | |
15877 | color extracted from DATA. A two-component image uses the R and A | |
15878 | values. A three-component image uses the R, G, and B values. A | |
15879 | four-component image uses all of the RGBA components. | |
15880 | ||
15881 | Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures | |
15882 | during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be | |
15883 | \xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to | |
15884 | generate a boolean result. See `glTexParameter' for details on texture | |
15885 | comparison. | |
15886 | ||
15887 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D', | |
15888 | `GL_PROXY_TEXTURE_2D', `GL_PROXY_TEXTURE_CUBE_MAP', | |
15889 | `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | |
15890 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | |
15891 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'. | |
15892 | ||
15893 | `GL_INVALID_ENUM' is generated if TARGET is one of the six cube map 2D | |
15894 | image targets and the width and height parameters are not equal. | |
15895 | ||
15896 | `GL_INVALID_ENUM' is generated if TYPE is not a type constant. | |
15897 | ||
15898 | `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not | |
15899 | `GL_COLOR_INDEX'. | |
15900 | ||
15901 | `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or | |
15902 | greater than 2 + `GL_MAX_TEXTURE_SIZE'. | |
15903 | ||
15904 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
15905 | ||
15906 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than | |
15907 | LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
15908 | ||
15909 | `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or | |
15910 | one of the accepted resolution and format symbolic constants. | |
15911 | ||
15912 | `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or | |
15913 | greater than 2 + `GL_MAX_TEXTURE_SIZE'. | |
15914 | ||
15915 | `GL_INVALID_VALUE' is generated if non-power-of-two textures are not | |
15916 | supported and the WIDTH or HEIGHT cannot be represented as | |
15917 | 2^K+2\u2061(BORDER,) for some integer value of K. | |
15918 | ||
15919 | `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1. | |
15920 | ||
15921 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
15922 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
15923 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
15924 | is not `GL_RGB'. | |
15925 | ||
15926 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
15927 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
15928 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
15929 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
15930 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
15931 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
8925f36f | 15932 | |
3c9b6116 AW |
15933 | `GL_INVALID_OPERATION' is generated if TARGET is not `GL_TEXTURE_2D' or |
15934 | `GL_PROXY_TEXTURE_2D' and INTERNALFORMAT is `GL_DEPTH_COMPONENT', | |
15935 | `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or | |
15936 | `GL_DEPTH_COMPONENT32'. | |
15937 | ||
15938 | `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT' | |
15939 | and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', | |
15940 | `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'. | |
15941 | ||
15942 | `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is | |
15943 | `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or | |
15944 | `GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'. | |
15945 | ||
15946 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
15947 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
15948 | data store is currently mapped. | |
15949 | ||
15950 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
15951 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
15952 | unpacked from the buffer object such that the memory reads required | |
15953 | would exceed the data store size. | |
15954 | ||
15955 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
15956 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
15957 | divisible into the number of bytes needed to store in memory a datum | |
15958 | indicated by TYPE. | |
15959 | ||
15960 | `GL_INVALID_OPERATION' is generated if `glTexImage2D' is executed | |
15961 | between the execution of `glBegin' and the corresponding execution of | |
15962 | `glEnd'.") | |
8925f36f AW |
15963 | |
15964 | (define-gl-procedure | |
bb894c9d AW |
15965 | ((glTexImage3D |
15966 | (target GLenum) | |
15967 | (level GLint) | |
15968 | (internalFormat GLint) | |
15969 | (width GLsizei) | |
15970 | (height GLsizei) | |
15971 | (depth GLsizei) | |
15972 | (border GLint) | |
15973 | (format GLenum) | |
15974 | (type GLenum) | |
15975 | (data *) | |
15976 | -> | |
15977 | void)) | |
3c9b6116 | 15978 | "Specify a three-dimensional texture image. |
8925f36f | 15979 | |
3c9b6116 AW |
15980 | TARGET |
15981 | Specifies the target texture. Must be `GL_TEXTURE_3D' or | |
15982 | `GL_PROXY_TEXTURE_3D'. | |
8925f36f | 15983 | |
3c9b6116 AW |
15984 | LEVEL |
15985 | Specifies the level-of-detail number. Level 0 is the base image | |
15986 | level. Level N is the N^TH mipmap reduction image. | |
8925f36f | 15987 | |
3c9b6116 AW |
15988 | INTERNALFORMAT |
15989 | Specifies the number of color components in the texture. Must be 1, | |
15990 | 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA', | |
15991 | `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', | |
15992 | `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE', | |
15993 | `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY', | |
15994 | `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_LUMINANCE', | |
15995 | `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12', | |
15996 | `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4', | |
15997 | `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8', | |
15998 | `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12', | |
15999 | `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4', | |
16000 | `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2', | |
16001 | `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', | |
16002 | `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', | |
16003 | `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16', | |
16004 | `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA', | |
16005 | `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or | |
16006 | `GL_SRGB8_ALPHA8'. | |
8925f36f | 16007 | |
3c9b6116 AW |
16008 | WIDTH |
16009 | Specifies the width of the texture image including the border if | |
16010 | any. If the GL version does not support non-power-of-two sizes, | |
16011 | this value must be 2^N+2\u2061(BORDER,) for some integer N . All | |
16012 | implementations support 3D texture images that are at least 16 | |
16013 | texels wide. | |
8925f36f | 16014 | |
3c9b6116 AW |
16015 | HEIGHT |
16016 | Specifies the height of the texture image including the border if | |
16017 | any. If the GL version does not support non-power-of-two sizes, | |
16018 | this value must be 2^M+2\u2061(BORDER,) for some integer M . All | |
16019 | implementations support 3D texture images that are at least 16 | |
16020 | texels high. | |
8925f36f | 16021 | |
3c9b6116 AW |
16022 | DEPTH |
16023 | Specifies the depth of the texture image including the border if | |
16024 | any. If the GL version does not support non-power-of-two sizes, | |
16025 | this value must be 2^K+2\u2061(BORDER,) for some integer K . All | |
16026 | implementations support 3D texture images that are at least 16 | |
16027 | texels deep. | |
8925f36f | 16028 | |
3c9b6116 AW |
16029 | BORDER |
16030 | Specifies the width of the border. Must be either 0 or 1. | |
8925f36f | 16031 | |
3c9b6116 AW |
16032 | FORMAT |
16033 | Specifies the format of the pixel data. The following symbolic | |
16034 | values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN', | |
16035 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', | |
16036 | `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'. | |
8925f36f | 16037 | |
3c9b6116 AW |
16038 | TYPE |
16039 | Specifies the data type of the pixel data. The following symbolic | |
16040 | values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', | |
16041 | `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', | |
16042 | `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
16043 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
16044 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
16045 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
16046 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
16047 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
8925f36f | 16048 | |
3c9b6116 AW |
16049 | DATA |
16050 | Specifies a pointer to the image data in memory. | |
16051 | ||
16052 | Texturing maps a portion of a specified texture image onto each | |
16053 | graphical primitive for which texturing is enabled. To enable and | |
16054 | disable three-dimensional texturing, call `glEnable' and `glDisable' | |
16055 | with argument `GL_TEXTURE_3D'. | |
16056 | ||
16057 | To define texture images, call `glTexImage3D'. The arguments describe | |
16058 | the parameters of the texture image, such as height, width, depth, width | |
16059 | of the border, level-of-detail number (see `glTexParameter'), and number | |
16060 | of color components provided. The last three arguments describe how the | |
16061 | image is represented in memory; they are identical to the pixel formats | |
16062 | used for `glDrawPixels'. | |
16063 | ||
16064 | If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all | |
16065 | of the texture image state is recalculated, checked for consistency, and | |
16066 | checked against the implementation's capabilities. If the implementation | |
16067 | cannot handle a texture of the requested texture size, it sets all of | |
16068 | the image state to 0, but does not generate an error (see `glGetError'). | |
16069 | To query for an entire mipmap array, use an image array level greater | |
16070 | than or equal to 1. | |
16071 | ||
16072 | If TARGET is `GL_TEXTURE_3D', data is read from DATA as a sequence of | |
16073 | signed or unsigned bytes, shorts, or longs, or single-precision | |
16074 | floating-point values, depending on TYPE. These values are grouped into | |
16075 | sets of one, two, three, or four values, depending on FORMAT, to form | |
16076 | elements. If TYPE is `GL_BITMAP', the data is considered as a string of | |
16077 | unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is | |
16078 | treated as eight 1-bit elements, with bit ordering determined by | |
16079 | `GL_UNPACK_LSB_FIRST' (see `glPixelStore'). | |
16080 | ||
16081 | If a non-zero named buffer object is bound to the | |
16082 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
16083 | image is specified, DATA is treated as a byte offset into the buffer | |
16084 | object's data store. | |
16085 | ||
16086 | The first element corresponds to the lower left corner of the texture | |
16087 | image. Subsequent elements progress left-to-right through the remaining | |
16088 | texels in the lowest row of the texture image, and then in successively | |
16089 | higher rows of the texture image. The final element corresponds to the | |
16090 | upper right corner of the texture image. | |
16091 | ||
16092 | FORMAT determines the composition of each element in DATA. It can assume | |
16093 | one of these symbolic values: | |
16094 | ||
16095 | `GL_COLOR_INDEX' | |
16096 | Each element is a single value, a color index. The GL converts it | |
16097 | to fixed point (with an unspecified number of zero bits to the | |
16098 | right of the binary point), shifted left or right depending on the | |
16099 | value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET' | |
16100 | (see `glPixelTransfer'). The resulting index is converted to a set | |
16101 | of color components using the `GL_PIXEL_MAP_I_TO_R', | |
16102 | `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and | |
16103 | `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1]. | |
16104 | ||
16105 | `GL_RED' | |
16106 | Each element is a single red component. The GL converts it to | |
16107 | floating point and assembles it into an RGBA element by attaching 0 | |
16108 | for green and blue, and 1 for alpha. Each component is then | |
16109 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
16110 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
16111 | `glPixelTransfer'). | |
16112 | ||
16113 | `GL_GREEN' | |
16114 | Each element is a single green component. The GL converts it to | |
16115 | floating point and assembles it into an RGBA element by attaching 0 | |
16116 | for red and blue, and 1 for alpha. Each component is then | |
16117 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
16118 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
16119 | `glPixelTransfer'). | |
16120 | ||
16121 | `GL_BLUE' | |
16122 | Each element is a single blue component. The GL converts it to | |
16123 | floating point and assembles it into an RGBA element by attaching 0 | |
16124 | for red and green, and 1 for alpha. Each component is then | |
16125 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
16126 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
16127 | `glPixelTransfer'). | |
16128 | ||
16129 | `GL_ALPHA' | |
16130 | Each element is a single alpha component. The GL converts it to | |
16131 | floating point and assembles it into an RGBA element by attaching 0 | |
16132 | for red, green, and blue. Each component is then multiplied by the | |
16133 | signed scale factor `GL_c_SCALE', added to the signed bias | |
16134 | `GL_c_BIAS', and clamped to the range [0,1] (see | |
16135 | `glPixelTransfer'). | |
16136 | ||
16137 | `GL_INTENSITY' | |
16138 | Each element is a single intensity value. The GL converts it to | |
16139 | floating point, then assembles it into an RGBA element by | |
16140 | replicating the intensity value three times for red, green, blue, | |
16141 | and alpha. Each component is then multiplied by the signed scale | |
16142 | factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and | |
16143 | clamped to the range [0,1] (see `glPixelTransfer'). | |
16144 | ||
16145 | `GL_RGB' | |
16146 | `GL_BGR' | |
16147 | Each element is an RGB triple. The GL converts it to floating point | |
16148 | and assembles it into an RGBA element by attaching 1 for alpha. | |
16149 | Each component is then multiplied by the signed scale factor | |
16150 | `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to | |
16151 | the range [0,1] (see `glPixelTransfer'). | |
16152 | ||
16153 | `GL_RGBA' | |
16154 | `GL_BGRA' | |
16155 | Each element contains all four components. Each component is | |
16156 | multiplied by the signed scale factor `GL_c_SCALE', added to the | |
16157 | signed bias `GL_c_BIAS', and clamped to the range [0,1] (see | |
16158 | `glPixelTransfer'). | |
16159 | ||
16160 | `GL_LUMINANCE' | |
16161 | Each element is a single luminance value. The GL converts it to | |
16162 | floating point, then assembles it into an RGBA element by | |
16163 | replicating the luminance value three times for red, green, and | |
16164 | blue and attaching 1 for alpha. Each component is then multiplied | |
16165 | by the signed scale factor `GL_c_SCALE', added to the signed bias | |
16166 | `GL_c_BIAS', and clamped to the range [0,1] (see | |
16167 | `glPixelTransfer'). | |
16168 | ||
16169 | `GL_LUMINANCE_ALPHA' | |
16170 | Each element is a luminance/alpha pair. The GL converts it to | |
16171 | floating point, then assembles it into an RGBA element by | |
16172 | replicating the luminance value three times for red, green, and | |
16173 | blue. Each component is then multiplied by the signed scale factor | |
16174 | `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to | |
16175 | the range [0,1] (see `glPixelTransfer'). | |
16176 | ||
16177 | Refer to the `glDrawPixels' reference page for a description of the | |
16178 | acceptable values for the TYPE parameter. | |
16179 | ||
16180 | If an application wants to store the texture at a certain resolution or | |
16181 | in a certain format, it can request the resolution and format with | |
16182 | INTERNALFORMAT. The GL will choose an internal representation that | |
16183 | closely approximates that requested by INTERNALFORMAT, but it may not | |
16184 | match exactly. (The representations specified by `GL_LUMINANCE', | |
16185 | `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The | |
16186 | numeric values 1, 2, 3, and 4 may also be used to specify the above | |
16187 | representations.) | |
16188 | ||
16189 | If the INTERNALFORMAT parameter is one of the generic compressed | |
16190 | formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY', | |
16191 | `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA', | |
16192 | `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the | |
16193 | internal format with the symbolic constant for a specific internal | |
16194 | format and compress the texture before storage. If no corresponding | |
16195 | internal format is available, or the GL can not compress that image for | |
16196 | any reason, the internal format is instead replaced with a corresponding | |
16197 | base internal format. | |
16198 | ||
16199 | If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8', | |
16200 | `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8', | |
16201 | `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is | |
16202 | treated as if the red, green, blue, or luminance components are encoded | |
16203 | in the sRGB color space. Any alpha component is left unchanged. The | |
16204 | conversion from the sRGB encoded component C_S to a linear component C_L | |
16205 | is: | |
16206 | ||
16207 | C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if | |
16208 | C_S>0.04045) | |
16209 | ||
16210 | Assume C_S is the sRGB component in the range [0,1]. | |
16211 | ||
16212 | Use the `GL_PROXY_TEXTURE_3D' target to try out a resolution and format. | |
16213 | The implementation will update and recompute its best match for the | |
16214 | requested storage resolution and format. To then query this state, call | |
16215 | `glGetTexLevelParameter'. If the texture cannot be accommodated, texture | |
16216 | state is set to 0. | |
16217 | ||
16218 | A one-component texture image uses only the red component of the RGBA | |
16219 | color extracted from DATA. A two-component image uses the R and A | |
16220 | values. A three-component image uses the R, G, and B values. A | |
16221 | four-component image uses all of the RGBA components. | |
16222 | ||
16223 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_3D' or | |
16224 | `GL_PROXY_TEXTURE_3D'. | |
16225 | ||
16226 | `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format | |
16227 | constant. Format constants other than `GL_STENCIL_INDEX' and | |
16228 | `GL_DEPTH_COMPONENT' are accepted. | |
16229 | ||
16230 | `GL_INVALID_ENUM' is generated if TYPE is not a type constant. | |
16231 | ||
16232 | `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not | |
16233 | `GL_COLOR_INDEX'. | |
16234 | ||
16235 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
16236 | ||
16237 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than | |
16238 | LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
16239 | ||
16240 | `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or | |
16241 | one of the accepted resolution and format symbolic constants. | |
16242 | ||
16243 | `GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than | |
16244 | 0 or greater than 2 + `GL_MAX_TEXTURE_SIZE'. | |
16245 | ||
16246 | `GL_INVALID_VALUE' is generated if non-power-of-two textures are not | |
16247 | supported and the WIDTH, HEIGHT, or DEPTH cannot be represented as | |
16248 | 2^K+2\u2061(BORDER,) for some integer value of K. | |
16249 | ||
16250 | `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1. | |
16251 | ||
16252 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
16253 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
16254 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
16255 | is not `GL_RGB'. | |
16256 | ||
16257 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
16258 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
16259 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
16260 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
16261 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
16262 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
16263 | ||
16264 | `GL_INVALID_OPERATION' is generated if FORMAT or INTERNALFORMAT is | |
16265 | `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or | |
16266 | `GL_DEPTH_COMPONENT32'. | |
16267 | ||
16268 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16269 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
16270 | data store is currently mapped. | |
16271 | ||
16272 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16273 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
16274 | unpacked from the buffer object such that the memory reads required | |
16275 | would exceed the data store size. | |
16276 | ||
16277 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16278 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
16279 | divisible into the number of bytes needed to store in memory a datum | |
16280 | indicated by TYPE. | |
16281 | ||
16282 | `GL_INVALID_OPERATION' is generated if `glTexImage3D' is executed | |
16283 | between the execution of `glBegin' and the corresponding execution of | |
16284 | `glEnd'.") | |
8925f36f AW |
16285 | |
16286 | (define-gl-procedure | |
bb894c9d AW |
16287 | ((glTexParameterf |
16288 | (target GLenum) | |
16289 | (pname GLenum) | |
16290 | (param GLfloat) | |
16291 | -> | |
16292 | void) | |
16293 | (glTexParameteri | |
16294 | (target GLenum) | |
16295 | (pname GLenum) | |
16296 | (param GLint) | |
16297 | -> | |
16298 | void)) | |
3c9b6116 | 16299 | "Set texture parameters. |
8925f36f | 16300 | |
3c9b6116 AW |
16301 | TARGET |
16302 | Specifies the target texture, which must be either `GL_TEXTURE_1D', | |
16303 | `GL_TEXTURE_2D', `GL_TEXTURE_3D', or `GL_TEXTURE_CUBE_MAP'. | |
8925f36f | 16304 | |
3c9b6116 AW |
16305 | PNAME |
16306 | Specifies the symbolic name of a single-valued texture parameter. | |
16307 | PNAME can be one of the following: `GL_TEXTURE_MIN_FILTER', | |
16308 | `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_LOD', | |
16309 | `GL_TEXTURE_MAX_LOD', `GL_TEXTURE_BASE_LEVEL', | |
16310 | `GL_TEXTURE_MAX_LEVEL', `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T', | |
16311 | `GL_TEXTURE_WRAP_R', `GL_TEXTURE_PRIORITY', | |
16312 | `GL_TEXTURE_COMPARE_MODE', `GL_TEXTURE_COMPARE_FUNC', | |
16313 | `GL_DEPTH_TEXTURE_MODE', or `GL_GENERATE_MIPMAP'. | |
16314 | ||
16315 | PARAM | |
16316 | Specifies the value of PNAME. | |
16317 | ||
16318 | Texture mapping is a technique that applies an image onto an object's | |
16319 | surface as if the image were a decal or cellophane shrink-wrap. The | |
16320 | image is created in texture space, with an (S , T ) coordinate system. A | |
16321 | texture is a one- or two-dimensional image and a set of parameters that | |
16322 | determine how samples are derived from the image. | |
16323 | ||
16324 | `glTexParameter' assigns the value or values in PARAMS to the texture | |
16325 | parameter specified as PNAME. TARGET defines the target texture, either | |
16326 | `GL_TEXTURE_1D', `GL_TEXTURE_2D', or `GL_TEXTURE_3D'. The following | |
16327 | symbols are accepted in PNAME: | |
16328 | ||
16329 | `GL_TEXTURE_MIN_FILTER' | |
16330 | The texture minifying function is used whenever the pixel being | |
16331 | textured maps to an area greater than one texture element. There | |
16332 | are six defined minifying functions. Two of them use the nearest | |
16333 | one or nearest four texture elements to compute the texture value. | |
16334 | The other four use mipmaps. | |
16335 | ||
16336 | A mipmap is an ordered set of arrays representing the same image at | |
16337 | progressively lower resolutions. If the texture has dimensions | |
16338 | 2^N×2^M , there are MAX\u2061(N,M)+1 mipmaps. The first mipmap is the | |
16339 | original texture, with dimensions 2^N×2^M . Each subsequent mipmap | |
16340 | has dimensions 2^K-1,×2^L-1, , where 2^K×2^L are the dimensions of | |
16341 | the previous mipmap, until either K=0 or L=0 . At that point, | |
16342 | subsequent mipmaps have dimension 1×2^L-1, or 2^K-1,×1 until the | |
16343 | final mipmap, which has dimension 1×1 . To define the mipmaps, call | |
16344 | `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D', | |
16345 | or `glCopyTexImage2D' with the LEVEL argument indicating the order | |
16346 | of the mipmaps. Level 0 is the original texture; level MAX\u2061(N,M) is | |
16347 | the final 1×1 mipmap. | |
16348 | ||
16349 | PARAMS supplies a function for minifying the texture as one of the | |
16350 | following: | |
16351 | ||
16352 | As more texture elements are sampled in the minification process, | |
16353 | fewer aliasing artifacts will be apparent. While the `GL_NEAREST' | |
16354 | and `GL_LINEAR' minification functions can be faster than the other | |
16355 | four, they sample only one or four texture elements to determine | |
16356 | the texture value of the pixel being rendered and can produce moire | |
16357 | patterns or ragged transitions. The initial value of | |
16358 | `GL_TEXTURE_MIN_FILTER' is `GL_NEAREST_MIPMAP_LINEAR'. | |
16359 | ||
16360 | `GL_TEXTURE_MAG_FILTER' | |
16361 | The texture magnification function is used when the pixel being | |
16362 | textured maps to an area less than or equal to one texture element. | |
16363 | It sets the texture magnification function to either `GL_NEAREST' | |
16364 | or `GL_LINEAR' (see below). `GL_NEAREST' is generally faster than | |
16365 | `GL_LINEAR', but it can produce textured images with sharper edges | |
16366 | because the transition between texture elements is not as smooth. | |
16367 | The initial value of `GL_TEXTURE_MAG_FILTER' is `GL_LINEAR'. | |
16368 | ||
16369 | `GL_NEAREST' | |
16370 | Returns the value of the texture element that is nearest (in | |
16371 | Manhattan distance) to the center of the pixel being textured. | |
16372 | ||
16373 | `GL_LINEAR' | |
16374 | Returns the weighted average of the four texture elements that are | |
16375 | closest to the center of the pixel being textured. These can | |
16376 | include border texture elements, depending on the values of | |
16377 | `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact | |
16378 | mapping. | |
16379 | ||
16380 | `GL_NEAREST_MIPMAP_NEAREST' | |
16381 | Chooses the mipmap that most closely matches the size of the pixel | |
16382 | being textured and uses the `GL_NEAREST' criterion (the texture | |
16383 | element nearest to the center of the pixel) to produce a texture | |
16384 | value. | |
16385 | ||
16386 | `GL_LINEAR_MIPMAP_NEAREST' | |
16387 | Chooses the mipmap that most closely matches the size of the pixel | |
16388 | being textured and uses the `GL_LINEAR' criterion (a weighted | |
16389 | average of the four texture elements that are closest to the center | |
16390 | of the pixel) to produce a texture value. | |
16391 | ||
16392 | `GL_NEAREST_MIPMAP_LINEAR' | |
16393 | Chooses the two mipmaps that most closely match the size of the | |
16394 | pixel being textured and uses the `GL_NEAREST' criterion (the | |
16395 | texture element nearest to the center of the pixel) to produce a | |
16396 | texture value from each mipmap. The final texture value is a | |
16397 | weighted average of those two values. | |
16398 | ||
16399 | `GL_LINEAR_MIPMAP_LINEAR' | |
16400 | Chooses the two mipmaps that most closely match the size of the | |
16401 | pixel being textured and uses the `GL_LINEAR' criterion (a weighted | |
16402 | average of the four texture elements that are closest to the center | |
16403 | of the pixel) to produce a texture value from each mipmap. The | |
16404 | final texture value is a weighted average of those two values. | |
16405 | ||
16406 | `GL_NEAREST' | |
16407 | Returns the value of the texture element that is nearest (in | |
16408 | Manhattan distance) to the center of the pixel being textured. | |
16409 | ||
16410 | `GL_LINEAR' | |
16411 | Returns the weighted average of the four texture elements that are | |
16412 | closest to the center of the pixel being textured. These can | |
16413 | include border texture elements, depending on the values of | |
16414 | `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact | |
16415 | mapping. | |
16416 | ||
16417 | ||
16418 | ||
16419 | `GL_TEXTURE_MIN_LOD' | |
16420 | Sets the minimum level-of-detail parameter. This floating-point | |
16421 | value limits the selection of highest resolution mipmap (lowest | |
16422 | mipmap level). The initial value is -1000. | |
16423 | ||
16424 | ||
16425 | ||
16426 | `GL_TEXTURE_MAX_LOD' | |
16427 | Sets the maximum level-of-detail parameter. This floating-point | |
16428 | value limits the selection of the lowest resolution mipmap (highest | |
16429 | mipmap level). The initial value is 1000. | |
16430 | ||
16431 | ||
16432 | ||
16433 | `GL_TEXTURE_BASE_LEVEL' | |
16434 | Specifies the index of the lowest defined mipmap level. This is an | |
16435 | integer value. The initial value is 0. | |
16436 | ||
16437 | ||
16438 | ||
16439 | `GL_TEXTURE_MAX_LEVEL' | |
16440 | Sets the index of the highest defined mipmap level. This is an | |
16441 | integer value. The initial value is 1000. | |
16442 | ||
16443 | ||
16444 | ||
16445 | `GL_TEXTURE_WRAP_S' | |
16446 | Sets the wrap parameter for texture coordinate S to either | |
16447 | `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE', | |
16448 | `GL_MIRRORED_REPEAT', or `GL_REPEAT'. `GL_CLAMP' causes S | |
16449 | coordinates to be clamped to the range [0,1] and is useful for | |
16450 | preventing wrapping artifacts when mapping a single image onto an | |
16451 | object. `GL_CLAMP_TO_BORDER' causes the S coordinate to be clamped | |
16452 | to the range [-1/2N,,1+1/2N,] , where N is the size of the texture | |
16453 | in the direction of clamping.`GL_CLAMP_TO_EDGE' causes S | |
16454 | coordinates to be clamped to the range [1/2N,,1-1/2N,] , where N is | |
16455 | the size of the texture in the direction of clamping. `GL_REPEAT' | |
16456 | causes the integer part of the S coordinate to be ignored; the GL | |
16457 | uses only the fractional part, thereby creating a repeating | |
16458 | pattern. `GL_MIRRORED_REPEAT' causes the S coordinate to be set to | |
16459 | the fractional part of the texture coordinate if the integer part | |
16460 | of S is even; if the integer part of S is odd, then the S texture | |
16461 | coordinate is set to 1-FRAC\u2061(S,) , where FRAC\u2061(S,) represents the | |
16462 | fractional part of S . Border texture elements are accessed only if | |
16463 | wrapping is set to `GL_CLAMP' or `GL_CLAMP_TO_BORDER'. Initially, | |
16464 | `GL_TEXTURE_WRAP_S' is set to `GL_REPEAT'. | |
16465 | ||
16466 | ||
16467 | ||
16468 | `GL_TEXTURE_WRAP_T' | |
16469 | Sets the wrap parameter for texture coordinate T to either | |
16470 | `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE', | |
16471 | `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under | |
16472 | `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_T' is set to | |
16473 | `GL_REPEAT'. | |
16474 | ||
16475 | `GL_TEXTURE_WRAP_R' | |
16476 | Sets the wrap parameter for texture coordinate R to either | |
16477 | `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE', | |
16478 | `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under | |
16479 | `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_R' is set to | |
16480 | `GL_REPEAT'. | |
16481 | ||
16482 | `GL_TEXTURE_BORDER_COLOR' | |
16483 | Sets a border color. PARAMS contains four values that comprise the | |
16484 | RGBA color of the texture border. Integer color components are | |
16485 | interpreted linearly such that the most positive integer maps to | |
16486 | 1.0, and the most negative integer maps to -1.0. The values are | |
16487 | clamped to the range [0,1] when they are specified. Initially, the | |
16488 | border color is (0, 0, 0, 0). | |
16489 | ||
16490 | `GL_TEXTURE_PRIORITY' | |
16491 | Specifies the texture residence priority of the currently bound | |
16492 | texture. Permissible values are in the range [0,1] . See | |
16493 | `glPrioritizeTextures' and `glBindTexture' for more information. | |
16494 | ||
16495 | `GL_TEXTURE_COMPARE_MODE' | |
16496 | Specifies the texture comparison mode for currently bound depth | |
16497 | textures. That is, a texture whose internal format is | |
16498 | `GL_DEPTH_COMPONENT_*'; see `glTexImage2D') Permissible values are: | |
16499 | ||
16500 | `GL_TEXTURE_COMPARE_FUNC' | |
16501 | Specifies the comparison operator used when | |
16502 | `GL_TEXTURE_COMPARE_MODE' is set to `GL_COMPARE_R_TO_TEXTURE'. | |
16503 | Permissible values are: where R is the current interpolated texture | |
16504 | coordinate, and D_T is the depth texture value sampled from the | |
16505 | currently bound depth texture. RESULT is assigned to the either the | |
16506 | luminance, intensity, or alpha (as specified by | |
16507 | `GL_DEPTH_TEXTURE_MODE'.) | |
16508 | ||
16509 | `GL_DEPTH_TEXTURE_MODE' | |
16510 | Specifies a single symbolic constant indicating how depth values | |
16511 | should be treated during filtering and texture application. | |
16512 | Accepted values are `GL_LUMINANCE', `GL_INTENSITY', and `GL_ALPHA'. | |
16513 | The initial value is `GL_LUMINANCE'. | |
16514 | ||
16515 | `GL_GENERATE_MIPMAP' | |
16516 | Specifies a boolean value that indicates if all levels of a mipmap | |
16517 | array should be automatically updated when any modification to the | |
16518 | base level mipmap is done. The initial value is `GL_FALSE'. | |
16519 | ||
16520 | `GL_COMPARE_R_TO_TEXTURE' | |
16521 | Specifies that the interpolated and clamped R texture coordinate | |
16522 | should be compared to the value in the currently bound depth | |
16523 | texture. See the discussion of `GL_TEXTURE_COMPARE_FUNC' for | |
16524 | details of how the comparison is evaluated. The result of the | |
16525 | comparison is assigned to luminance, intensity, or alpha (as | |
16526 | specified by `GL_DEPTH_TEXTURE_MODE'). | |
16527 | ||
16528 | `GL_NONE' | |
16529 | Specifies that the luminance, intensity, or alpha (as specified by | |
16530 | `GL_DEPTH_TEXTURE_MODE') should be assigned the appropriate value | |
16531 | from the currently bound depth texture. | |
16532 | ||
16533 | *Texture Comparison Function* | |
16534 | *Computed result* | |
16535 | ||
16536 | `GL_LEQUAL' | |
16537 | RESULT={(1.0), (0.0)\u2062\xa0(R<=D_T,), (R>D_T,), | |
16538 | ||
16539 | `GL_GEQUAL' | |
16540 | RESULT={(1.0), (0.0)\u2062\xa0(R>=D_T,), (R<D_T,), | |
16541 | ||
16542 | `GL_LESS' | |
16543 | RESULT={(1.0), (0.0)\u2062\xa0(R<D_T,), (R>=D_T,), | |
16544 | ||
16545 | `GL_GREATER' | |
16546 | RESULT={(1.0), (0.0)\u2062\xa0(R>D_T,), (R<=D_T,), | |
8925f36f | 16547 | |
3c9b6116 AW |
16548 | `GL_EQUAL' |
16549 | RESULT={(1.0), (0.0)\u2062\xa0(R=D_T,), (R≠D_T,), | |
8925f36f | 16550 | |
3c9b6116 AW |
16551 | `GL_NOTEQUAL' |
16552 | RESULT={(1.0), (0.0)\u2062\xa0(R≠D_T,), (R=D_T,), | |
8925f36f | 16553 | |
3c9b6116 AW |
16554 | `GL_ALWAYS' |
16555 | RESULT=`1.0' | |
16556 | ||
16557 | `GL_NEVER' | |
16558 | RESULT=`0.0' | |
16559 | ||
16560 | `GL_INVALID_ENUM' is generated if TARGET or PNAME is not one of the | |
16561 | accepted defined values. | |
16562 | ||
16563 | `GL_INVALID_ENUM' is generated if PARAMS should have a defined constant | |
16564 | value (based on the value of PNAME) and does not. | |
16565 | ||
16566 | `GL_INVALID_OPERATION' is generated if `glTexParameter' is executed | |
16567 | between the execution of `glBegin' and the corresponding execution of | |
16568 | `glEnd'.") | |
8925f36f AW |
16569 | |
16570 | (define-gl-procedure | |
bb894c9d AW |
16571 | ((glTexSubImage1D |
16572 | (target GLenum) | |
16573 | (level GLint) | |
16574 | (xoffset GLint) | |
16575 | (width GLsizei) | |
16576 | (format GLenum) | |
16577 | (type GLenum) | |
16578 | (data *) | |
16579 | -> | |
16580 | void)) | |
3c9b6116 AW |
16581 | "Specify a one-dimensional texture subimage. |
16582 | ||
16583 | TARGET | |
16584 | Specifies the target texture. Must be `GL_TEXTURE_1D'. | |
16585 | ||
16586 | LEVEL | |
16587 | Specifies the level-of-detail number. Level 0 is the base image | |
16588 | level. Level N is the Nth mipmap reduction image. | |
16589 | ||
16590 | XOFFSET | |
16591 | Specifies a texel offset in the x direction within the texture | |
16592 | array. | |
16593 | ||
16594 | WIDTH | |
16595 | Specifies the width of the texture subimage. | |
16596 | ||
16597 | FORMAT | |
16598 | Specifies the format of the pixel data. The following symbolic | |
16599 | values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN', | |
16600 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', | |
16601 | `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'. | |
16602 | ||
16603 | TYPE | |
16604 | Specifies the data type of the pixel data. The following symbolic | |
16605 | values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', | |
16606 | `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', | |
16607 | `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
16608 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
16609 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
16610 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
16611 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
16612 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
16613 | ||
16614 | DATA | |
16615 | Specifies a pointer to the image data in memory. | |
16616 | ||
16617 | Texturing maps a portion of a specified texture image onto each | |
16618 | graphical primitive for which texturing is enabled. To enable or disable | |
16619 | one-dimensional texturing, call `glEnable' and `glDisable' with argument | |
16620 | `GL_TEXTURE_1D'. | |
16621 | ||
16622 | `glTexSubImage1D' redefines a contiguous subregion of an existing | |
16623 | one-dimensional texture image. The texels referenced by DATA replace the | |
16624 | portion of the existing texture array with x indices XOFFSET and | |
16625 | XOFFSET+WIDTH-1 , inclusive. This region may not include any texels | |
16626 | outside the range of the texture array as it was originally specified. | |
16627 | It is not an error to specify a subtexture with width of 0, but such a | |
16628 | specification has no effect. | |
16629 | ||
16630 | If a non-zero named buffer object is bound to the | |
16631 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
16632 | image is specified, DATA is treated as a byte offset into the buffer | |
16633 | object's data store. | |
16634 | ||
16635 | `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable | |
16636 | values. | |
16637 | ||
16638 | `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format | |
16639 | constant. | |
16640 | ||
16641 | `GL_INVALID_ENUM' is generated if TYPE is not a type constant. | |
16642 | ||
16643 | `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not | |
16644 | `GL_COLOR_INDEX'. | |
16645 | ||
16646 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
16647 | ||
16648 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX, | |
16649 | where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
16650 | ||
16651 | `GL_INVALID_VALUE' is generated if XOFFSET<-B , or if | |
16652 | (XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH', and B is | |
16653 | the width of the `GL_TEXTURE_BORDER' of the texture image being | |
16654 | modified. Note that W includes twice the border width. | |
16655 | ||
16656 | `GL_INVALID_VALUE' is generated if WIDTH is less than 0. | |
16657 | ||
16658 | `GL_INVALID_OPERATION' is generated if the texture array has not been | |
16659 | defined by a previous `glTexImage1D' operation. | |
16660 | ||
16661 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
16662 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
16663 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
16664 | is not `GL_RGB'. | |
16665 | ||
16666 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
16667 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
16668 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
16669 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
16670 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
16671 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
16672 | ||
16673 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16674 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
16675 | data store is currently mapped. | |
16676 | ||
16677 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16678 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
16679 | unpacked from the buffer object such that the memory reads required | |
16680 | would exceed the data store size. | |
16681 | ||
16682 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16683 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
16684 | divisible into the number of bytes needed to store in memory a datum | |
16685 | indicated by TYPE. | |
16686 | ||
16687 | `GL_INVALID_OPERATION' is generated if `glTexSubImage1D' is executed | |
16688 | between the execution of `glBegin' and the corresponding execution of | |
16689 | `glEnd'.") | |
8925f36f AW |
16690 | |
16691 | (define-gl-procedure | |
bb894c9d AW |
16692 | ((glTexSubImage2D |
16693 | (target GLenum) | |
16694 | (level GLint) | |
16695 | (xoffset GLint) | |
16696 | (yoffset GLint) | |
16697 | (width GLsizei) | |
16698 | (height GLsizei) | |
16699 | (format GLenum) | |
16700 | (type GLenum) | |
16701 | (data *) | |
16702 | -> | |
16703 | void)) | |
3c9b6116 AW |
16704 | "Specify a two-dimensional texture subimage. |
16705 | ||
16706 | TARGET | |
16707 | Specifies the target texture. Must be `GL_TEXTURE_2D', | |
16708 | `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | |
16709 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | |
16710 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or | |
16711 | `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'. | |
16712 | ||
16713 | LEVEL | |
16714 | Specifies the level-of-detail number. Level 0 is the base image | |
16715 | level. Level N is the Nth mipmap reduction image. | |
16716 | ||
16717 | XOFFSET | |
16718 | Specifies a texel offset in the x direction within the texture | |
16719 | array. | |
16720 | ||
16721 | YOFFSET | |
16722 | Specifies a texel offset in the y direction within the texture | |
16723 | array. | |
16724 | ||
16725 | WIDTH | |
16726 | Specifies the width of the texture subimage. | |
16727 | ||
16728 | HEIGHT | |
16729 | Specifies the height of the texture subimage. | |
16730 | ||
16731 | FORMAT | |
16732 | Specifies the format of the pixel data. The following symbolic | |
16733 | values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN', | |
16734 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', | |
16735 | `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'. | |
16736 | ||
16737 | TYPE | |
16738 | Specifies the data type of the pixel data. The following symbolic | |
16739 | values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', | |
16740 | `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', | |
16741 | `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
16742 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
16743 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
16744 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
16745 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
16746 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
16747 | ||
16748 | DATA | |
16749 | Specifies a pointer to the image data in memory. | |
16750 | ||
16751 | Texturing maps a portion of a specified texture image onto each | |
16752 | graphical primitive for which texturing is enabled. To enable and | |
16753 | disable two-dimensional texturing, call `glEnable' and `glDisable' with | |
16754 | argument `GL_TEXTURE_2D'. | |
16755 | ||
16756 | `glTexSubImage2D' redefines a contiguous subregion of an existing | |
16757 | two-dimensional texture image. The texels referenced by DATA replace the | |
16758 | portion of the existing texture array with x indices XOFFSET and | |
16759 | XOFFSET+WIDTH-1 , inclusive, and y indices YOFFSET and YOFFSET+HEIGHT-1 | |
16760 | , inclusive. This region may not include any texels outside the range of | |
16761 | the texture array as it was originally specified. It is not an error to | |
16762 | specify a subtexture with zero width or height, but such a specification | |
16763 | has no effect. | |
16764 | ||
16765 | If a non-zero named buffer object is bound to the | |
16766 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
16767 | image is specified, DATA is treated as a byte offset into the buffer | |
16768 | object's data store. | |
16769 | ||
16770 | `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D', | |
16771 | `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | |
16772 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | |
16773 | `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'. | |
16774 | ||
16775 | `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format | |
16776 | constant. | |
16777 | ||
16778 | `GL_INVALID_ENUM' is generated if TYPE is not a type constant. | |
16779 | ||
16780 | `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not | |
16781 | `GL_COLOR_INDEX'. | |
16782 | ||
16783 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
16784 | ||
16785 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX, | |
16786 | where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
16787 | ||
16788 | `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,) | |
16789 | , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the | |
16790 | `GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the border | |
16791 | width of the texture image being modified. Note that W and H include | |
16792 | twice the border width. | |
16793 | ||
16794 | `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0. | |
16795 | ||
16796 | `GL_INVALID_OPERATION' is generated if the texture array has not been | |
16797 | defined by a previous `glTexImage2D' operation. | |
16798 | ||
16799 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
16800 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
16801 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
16802 | is not `GL_RGB'. | |
16803 | ||
16804 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
16805 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
16806 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
16807 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
16808 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
16809 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
16810 | ||
16811 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16812 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
16813 | data store is currently mapped. | |
16814 | ||
16815 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16816 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
16817 | unpacked from the buffer object such that the memory reads required | |
16818 | would exceed the data store size. | |
16819 | ||
16820 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16821 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
16822 | divisible into the number of bytes needed to store in memory a datum | |
16823 | indicated by TYPE. | |
16824 | ||
16825 | `GL_INVALID_OPERATION' is generated if `glTexSubImage2D' is executed | |
16826 | between the execution of `glBegin' and the corresponding execution of | |
16827 | `glEnd'.") | |
8925f36f AW |
16828 | |
16829 | (define-gl-procedure | |
bb894c9d AW |
16830 | ((glTexSubImage3D |
16831 | (target GLenum) | |
16832 | (level GLint) | |
16833 | (xoffset GLint) | |
16834 | (yoffset GLint) | |
16835 | (zoffset GLint) | |
16836 | (width GLsizei) | |
16837 | (height GLsizei) | |
16838 | (depth GLsizei) | |
16839 | (format GLenum) | |
16840 | (type GLenum) | |
16841 | (data *) | |
16842 | -> | |
16843 | void)) | |
3c9b6116 AW |
16844 | "Specify a three-dimensional texture subimage. |
16845 | ||
16846 | TARGET | |
16847 | Specifies the target texture. Must be `GL_TEXTURE_3D'. | |
16848 | ||
16849 | LEVEL | |
16850 | Specifies the level-of-detail number. Level 0 is the base image | |
16851 | level. Level N is the Nth mipmap reduction image. | |
16852 | ||
16853 | XOFFSET | |
16854 | Specifies a texel offset in the x direction within the texture | |
16855 | array. | |
16856 | ||
16857 | YOFFSET | |
16858 | Specifies a texel offset in the y direction within the texture | |
16859 | array. | |
16860 | ||
16861 | ZOFFSET | |
16862 | Specifies a texel offset in the z direction within the texture | |
16863 | array. | |
16864 | ||
16865 | WIDTH | |
16866 | Specifies the width of the texture subimage. | |
16867 | ||
16868 | HEIGHT | |
16869 | Specifies the height of the texture subimage. | |
16870 | ||
16871 | DEPTH | |
16872 | Specifies the depth of the texture subimage. | |
16873 | ||
16874 | FORMAT | |
16875 | Specifies the format of the pixel data. The following symbolic | |
16876 | values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN', | |
16877 | `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', | |
16878 | `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'. | |
16879 | ||
16880 | TYPE | |
16881 | Specifies the data type of the pixel data. The following symbolic | |
16882 | values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', | |
16883 | `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', | |
16884 | `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
16885 | `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV', | |
16886 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
16887 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
16888 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
16889 | `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'. | |
16890 | ||
16891 | DATA | |
16892 | Specifies a pointer to the image data in memory. | |
16893 | ||
16894 | Texturing maps a portion of a specified texture image onto each | |
16895 | graphical primitive for which texturing is enabled. To enable and | |
16896 | disable three-dimensional texturing, call `glEnable' and `glDisable' | |
16897 | with argument `GL_TEXTURE_3D'. | |
16898 | ||
16899 | `glTexSubImage3D' redefines a contiguous subregion of an existing | |
16900 | three-dimensional texture image. The texels referenced by DATA replace | |
16901 | the portion of the existing texture array with x indices XOFFSET and | |
16902 | XOFFSET+WIDTH-1 , inclusive, y indices YOFFSET and YOFFSET+HEIGHT-1 , | |
16903 | inclusive, and z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This | |
16904 | region may not include any texels outside the range of the texture array | |
16905 | as it was originally specified. It is not an error to specify a | |
16906 | subtexture with zero width, height, or depth but such a specification | |
16907 | has no effect. | |
16908 | ||
16909 | If a non-zero named buffer object is bound to the | |
16910 | `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture | |
16911 | image is specified, DATA is treated as a byte offset into the buffer | |
16912 | object's data store. | |
16913 | ||
16914 | `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'. | |
16915 | ||
16916 | `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format | |
16917 | constant. | |
16918 | ||
16919 | `GL_INVALID_ENUM' is generated if TYPE is not a type constant. | |
16920 | ||
16921 | `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not | |
16922 | `GL_COLOR_INDEX'. | |
16923 | ||
16924 | `GL_INVALID_VALUE' is generated if LEVEL is less than 0. | |
16925 | ||
16926 | `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX, | |
16927 | where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'. | |
16928 | ||
16929 | `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,) | |
16930 | , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , or ZOFFSET<-B , or | |
16931 | (ZOFFSET+DEPTH,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the | |
16932 | `GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH' and B is the border | |
16933 | width of the texture image being modified. Note that W , H , and D | |
16934 | include twice the border width. | |
16935 | ||
16936 | `GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than | |
16937 | 0. | |
16938 | ||
16939 | `GL_INVALID_OPERATION' is generated if the texture array has not been | |
16940 | defined by a previous `glTexImage3D' operation. | |
16941 | ||
16942 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
16943 | `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV', | |
16944 | `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT | |
16945 | is not `GL_RGB'. | |
16946 | ||
16947 | `GL_INVALID_OPERATION' is generated if TYPE is one of | |
16948 | `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV', | |
16949 | `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV', | |
16950 | `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV', | |
16951 | `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and | |
16952 | FORMAT is neither `GL_RGBA' nor `GL_BGRA'. | |
16953 | ||
16954 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16955 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's | |
16956 | data store is currently mapped. | |
16957 | ||
16958 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16959 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be | |
16960 | unpacked from the buffer object such that the memory reads required | |
16961 | would exceed the data store size. | |
16962 | ||
16963 | `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is | |
16964 | bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly | |
16965 | divisible into the number of bytes needed to store in memory a datum | |
16966 | indicated by TYPE. | |
16967 | ||
16968 | `GL_INVALID_OPERATION' is generated if `glTexSubImage3D' is executed | |
16969 | between the execution of `glBegin' and the corresponding execution of | |
16970 | `glEnd'.") | |
8925f36f AW |
16971 | |
16972 | (define-gl-procedure | |
bb894c9d AW |
16973 | ((glTranslated |
16974 | (x GLdouble) | |
16975 | (y GLdouble) | |
16976 | (z GLdouble) | |
16977 | -> | |
16978 | void)) | |
3c9b6116 AW |
16979 | "Multiply the current matrix by a translation matrix. |
16980 | ||
16981 | X | |
16982 | Y | |
16983 | ||
16984 | Z | |
16985 | ||
16986 | Specify the X, Y, and Z coordinates of a translation vector. | |
16987 | ||
16988 | `glTranslate' produces a translation by (X,YZ) . The current matrix (see | |
16989 | `glMatrixMode') is multiplied by this translation matrix, with the | |
16990 | product replacing the current matrix, as if `glMultMatrix' were called | |
16991 | with the following matrix for its argument: | |
16992 | ||
16993 | ((1 0 0 X), (0 1 0 Y), (0 0 1 Z), (0 0 0 1),) | |
16994 | ||
16995 | ||
16996 | ||
16997 | If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all | |
16998 | objects drawn after a call to `glTranslate' are translated. | |
16999 | ||
17000 | Use `glPushMatrix' and `glPopMatrix' to save and restore the | |
17001 | untranslated coordinate system. | |
17002 | ||
17003 | `GL_INVALID_OPERATION' is generated if `glTranslate' is executed between | |
17004 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
17005 | |
17006 | (define-gl-procedure | |
bb894c9d AW |
17007 | ((glUniform1f |
17008 | (location GLint) | |
17009 | (v0 GLfloat) | |
17010 | -> | |
17011 | void) | |
17012 | (glUniform2f | |
17013 | (location GLint) | |
17014 | (v0 GLfloat) | |
17015 | (v1 GLfloat) | |
17016 | -> | |
17017 | void) | |
17018 | (glUniform3f | |
17019 | (location GLint) | |
17020 | (v0 GLfloat) | |
17021 | (v1 GLfloat) | |
17022 | (v2 GLfloat) | |
17023 | -> | |
17024 | void) | |
17025 | (glUniform4f | |
17026 | (location GLint) | |
17027 | (v0 GLfloat) | |
17028 | (v1 GLfloat) | |
17029 | (v2 GLfloat) | |
17030 | (v3 GLfloat) | |
17031 | -> | |
17032 | void) | |
17033 | (glUniform1i (location GLint) (v0 GLint) -> void) | |
17034 | (glUniform2i | |
17035 | (location GLint) | |
17036 | (v0 GLint) | |
17037 | (v1 GLint) | |
17038 | -> | |
17039 | void) | |
17040 | (glUniform3i | |
17041 | (location GLint) | |
17042 | (v0 GLint) | |
17043 | (v1 GLint) | |
17044 | (v2 GLint) | |
17045 | -> | |
17046 | void) | |
17047 | (glUniform4i | |
17048 | (location GLint) | |
17049 | (v0 GLint) | |
17050 | (v1 GLint) | |
17051 | (v2 GLint) | |
17052 | (v3 GLint) | |
17053 | -> | |
17054 | void)) | |
3c9b6116 AW |
17055 | "Specify the value of a uniform variable for the current program object. |
17056 | ||
17057 | LOCATION | |
17058 | Specifies the location of the uniform variable to be modified. | |
17059 | ||
17060 | V0, V1, V2, V3 | |
17061 | Specifies the new values to be used for the specified uniform | |
17062 | variable. | |
17063 | ||
17064 | `glUniform' modifies the value of a uniform variable or a uniform | |
17065 | variable array. The location of the uniform variable to be modified is | |
17066 | specified by LOCATION, which should be a value returned by | |
17067 | `glGetUniformLocation'. `glUniform' operates on the program object that | |
17068 | was made part of current state by calling `glUseProgram'. | |
17069 | ||
17070 | The commands `glUniform{1|2|3|4}{f|i}' are used to change the value of | |
17071 | the uniform variable specified by LOCATION using the values passed as | |
17072 | arguments. The number specified in the command should match the number | |
17073 | of components in the data type of the specified uniform variable (e.g., | |
17074 | `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The suffix | |
17075 | `f' indicates that floating-point values are being passed; the suffix | |
17076 | `i' indicates that integer values are being passed, and this type should | |
17077 | also match the data type of the specified uniform variable. The `i' | |
17078 | variants of this function should be used to provide values for uniform | |
17079 | variables defined as int, ivec2, ivec3, ivec4, or arrays of these. The | |
17080 | `f' variants should be used to provide values for uniform variables of | |
17081 | type float, vec2, vec3, vec4, or arrays of these. Either the `i' or the | |
17082 | `f' variants may be used to provide values for uniform variables of type | |
17083 | bool, bvec2, bvec3, bvec4, or arrays of these. The uniform variable will | |
17084 | be set to false if the input value is 0 or 0.0f, and it will be set to | |
17085 | true otherwise. | |
17086 | ||
17087 | All active uniform variables defined in a program object are initialized | |
17088 | to 0 when the program object is linked successfully. They retain the | |
17089 | values assigned to them by a call to `glUniform ' until the next | |
17090 | successful link operation occurs on the program object, when they are | |
17091 | once again initialized to 0. | |
17092 | ||
17093 | The commands `glUniform{1|2|3|4}{f|i}v' can be used to modify a single | |
17094 | uniform variable or a uniform variable array. These commands pass a | |
17095 | count and a pointer to the values to be loaded into a uniform variable | |
17096 | or a uniform variable array. A count of 1 should be used if modifying | |
17097 | the value of a single uniform variable, and a count of 1 or greater can | |
17098 | be used to modify an entire array or part of an array. When loading N | |
17099 | elements starting at an arbitrary position M in a uniform variable | |
17100 | array, elements M + N - 1 in the array will be replaced with the new | |
17101 | values. If M + N - 1 is larger than the size of the uniform variable | |
17102 | array, values for all array elements beyond the end of the array will be | |
17103 | ignored. The number specified in the name of the command indicates the | |
17104 | number of components for each element in VALUE, and it should match the | |
17105 | number of components in the data type of the specified uniform variable | |
17106 | (e.g., `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The | |
17107 | data type specified in the name of the command must match the data type | |
17108 | for the specified uniform variable as described previously for | |
17109 | `glUniform{1|2|3|4}{f|i}'. | |
17110 | ||
17111 | For uniform variable arrays, each element of the array is considered to | |
17112 | be of the type indicated in the name of the command (e.g., `glUniform3f' | |
17113 | or `glUniform3fv' can be used to load a uniform variable array of type | |
17114 | vec3). The number of elements of the uniform variable array to be | |
17115 | modified is specified by COUNT | |
17116 | ||
17117 | The commands `glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv' are used | |
17118 | to modify a matrix or an array of matrices. The numbers in the command | |
17119 | name are interpreted as the dimensionality of the matrix. The number `2' | |
17120 | indicates a 2 × 2 matrix (i.e., 4 values), the number `3' indicates a 3 | |
17121 | × 3 matrix (i.e., 9 values), and the number `4' indicates a 4 × 4 matrix | |
17122 | (i.e., 16 values). Non-square matrix dimensionality is explicit, with | |
17123 | the first number representing the number of columns and the second | |
17124 | number representing the number of rows. For example, `2x4' indicates a 2 | |
17125 | × 4 matrix with 2 columns and 4 rows (i.e., 8 values). If TRANSPOSE is | |
17126 | `GL_FALSE', each matrix is assumed to be supplied in column major order. | |
17127 | If TRANSPOSE is `GL_TRUE', each matrix is assumed to be supplied in row | |
17128 | major order. The COUNT argument indicates the number of matrices to be | |
17129 | passed. A count of 1 should be used if modifying the value of a single | |
17130 | matrix, and a count greater than 1 can be used to modify an array of | |
17131 | matrices. | |
17132 | ||
17133 | `GL_INVALID_OPERATION' is generated if there is no current program | |
17134 | object. | |
17135 | ||
17136 | `GL_INVALID_OPERATION' is generated if the size of the uniform variable | |
17137 | declared in the shader does not match the size indicated by the | |
17138 | `glUniform' command. | |
17139 | ||
17140 | `GL_INVALID_OPERATION' is generated if one of the integer variants of | |
17141 | this function is used to load a uniform variable of type float, vec2, | |
17142 | vec3, vec4, or an array of these, or if one of the floating-point | |
17143 | variants of this function is used to load a uniform variable of type | |
17144 | int, ivec2, ivec3, or ivec4, or an array of these. | |
17145 | ||
17146 | `GL_INVALID_OPERATION' is generated if LOCATION is an invalid uniform | |
17147 | location for the current program object and LOCATION is not equal to -1. | |
17148 | ||
17149 | `GL_INVALID_VALUE' is generated if COUNT is less than 0. | |
17150 | ||
17151 | `GL_INVALID_OPERATION' is generated if COUNT is greater than 1 and the | |
17152 | indicated uniform variable is not an array variable. | |
17153 | ||
17154 | `GL_INVALID_OPERATION' is generated if a sampler is loaded using a | |
17155 | command other than `glUniform1i' and `glUniform1iv'. | |
17156 | ||
17157 | `GL_INVALID_OPERATION' is generated if `glUniform' is executed between | |
17158 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
17159 | |
17160 | (define-gl-procedure | |
bb894c9d | 17161 | ((glUseProgram (program GLuint) -> void)) |
3c9b6116 AW |
17162 | "Installs a program object as part of current rendering state. |
17163 | ||
17164 | PROGRAM | |
17165 | Specifies the handle of the program object whose executables are to | |
17166 | be used as part of current rendering state. | |
17167 | ||
17168 | `glUseProgram' installs the program object specified by PROGRAM as part | |
17169 | of current rendering state. One or more executables are created in a | |
17170 | program object by successfully attaching shader objects to it with | |
17171 | `glAttachShader', successfully compiling the shader objects with | |
17172 | `glCompileShader', and successfully linking the program object with | |
17173 | `glLinkProgram'. | |
17174 | ||
17175 | A program object will contain an executable that will run on the vertex | |
17176 | processor if it contains one or more shader objects of type | |
17177 | `GL_VERTEX_SHADER' that have been successfully compiled and linked. | |
17178 | Similarly, a program object will contain an executable that will run on | |
17179 | the fragment processor if it contains one or more shader objects of type | |
17180 | `GL_FRAGMENT_SHADER' that have been successfully compiled and linked. | |
17181 | ||
17182 | Successfully installing an executable on a programmable processor will | |
17183 | cause the corresponding fixed functionality of OpenGL to be disabled. | |
17184 | Specifically, if an executable is installed on the vertex processor, the | |
17185 | OpenGL fixed functionality will be disabled as follows. | |
17186 | ||
17187 | * The projection matrix is not applied to vertex coordinates. | |
17188 | ||
17189 | * The texture matrices are not applied to texture coordinates. | |
17190 | ||
17191 | * Normals are not transformed to eye coordinates. | |
17192 | ||
17193 | * Normals are not rescaled or normalized. | |
17194 | ||
17195 | * Normalization of `GL_AUTO_NORMAL' evaluated normals is not | |
17196 | performed. | |
17197 | ||
17198 | * Texture coordinates are not generated automatically. | |
17199 | ||
17200 | * Per-vertex lighting is not performed. | |
17201 | ||
17202 | * Color material computations are not performed. | |
17203 | ||
17204 | * Color index lighting is not performed. | |
17205 | ||
17206 | * This list also applies when setting the current raster position. | |
17207 | ||
17208 | The executable that is installed on the vertex processor is expected to | |
17209 | implement any or all of the desired functionality from the preceding | |
17210 | list. Similarly, if an executable is installed on the fragment | |
17211 | processor, the OpenGL fixed functionality will be disabled as follows. | |
17212 | ||
17213 | * Texture application is not applied. | |
17214 | ||
17215 | * Color sum is not applied. | |
17216 | ||
17217 | * Fog is not applied. | |
17218 | ||
17219 | Again, the fragment shader that is installed is expected to implement | |
17220 | any or all of the desired functionality from the preceding list. | |
17221 | ||
17222 | While a program object is in use, applications are free to modify | |
17223 | attached shader objects, compile attached shader objects, attach | |
17224 | additional shader objects, and detach or delete shader objects. None of | |
17225 | these operations will affect the executables that are part of the | |
17226 | current state. However, relinking the program object that is currently | |
17227 | in use will install the program object as part of the current rendering | |
17228 | state if the link operation was successful (see `glLinkProgram' ). If | |
17229 | the program object currently in use is relinked unsuccessfully, its link | |
17230 | status will be set to `GL_FALSE', but the executables and associated | |
17231 | state will remain part of the current state until a subsequent call to | |
17232 | `glUseProgram' removes it from use. After it is removed from use, it | |
17233 | cannot be made part of current state until it has been successfully | |
17234 | relinked. | |
17235 | ||
17236 | If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but it | |
17237 | does not contain shader objects of type `GL_FRAGMENT_SHADER', an | |
17238 | executable will be installed on the vertex processor, but fixed | |
17239 | functionality will be used for fragment processing. Similarly, if | |
17240 | PROGRAM contains shader objects of type `GL_FRAGMENT_SHADER' but it does | |
17241 | not contain shader objects of type `GL_VERTEX_SHADER', an executable | |
17242 | will be installed on the fragment processor, but fixed functionality | |
17243 | will be used for vertex processing. If PROGRAM is 0, the programmable | |
17244 | processors will be disabled, and fixed functionality will be used for | |
17245 | both vertex and fragment processing. | |
17246 | ||
17247 | `GL_INVALID_VALUE' is generated if PROGRAM is neither 0 nor a value | |
17248 | generated by OpenGL. | |
17249 | ||
17250 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
17251 | ||
17252 | `GL_INVALID_OPERATION' is generated if PROGRAM could not be made part of | |
17253 | current state. | |
17254 | ||
17255 | `GL_INVALID_OPERATION' is generated if `glUseProgram' is executed | |
17256 | between the execution of `glBegin' and the corresponding execution of | |
17257 | `glEnd'.") | |
8925f36f AW |
17258 | |
17259 | (define-gl-procedure | |
bb894c9d | 17260 | ((glValidateProgram (program GLuint) -> void)) |
3c9b6116 AW |
17261 | "Validates a program object. |
17262 | ||
17263 | PROGRAM | |
17264 | Specifies the handle of the program object to be validated. | |
17265 | ||
17266 | `glValidateProgram' checks to see whether the executables contained in | |
17267 | PROGRAM can execute given the current OpenGL state. The information | |
17268 | generated by the validation process will be stored in PROGRAM's | |
17269 | information log. The validation information may consist of an empty | |
17270 | string, or it may be a string containing information about how the | |
17271 | current program object interacts with the rest of current OpenGL state. | |
17272 | This provides a way for OpenGL implementers to convey more information | |
17273 | about why the current program is inefficient, suboptimal, failing to | |
17274 | execute, and so on. | |
17275 | ||
17276 | The status of the validation operation will be stored as part of the | |
17277 | program object's state. This value will be set to `GL_TRUE' if the | |
17278 | validation succeeded, and `GL_FALSE' otherwise. It can be queried by | |
17279 | calling `glGetProgram' with arguments PROGRAM and `GL_VALIDATE_STATUS'. | |
17280 | If validation is successful, PROGRAM is guaranteed to execute given the | |
17281 | current state. Otherwise, PROGRAM is guaranteed to not execute. | |
17282 | ||
17283 | This function is typically useful only during application development. | |
17284 | The informational string stored in the information log is completely | |
17285 | implementation dependent; therefore, an application should not expect | |
17286 | different OpenGL implementations to produce identical information | |
17287 | strings. | |
17288 | ||
17289 | `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by | |
17290 | OpenGL. | |
17291 | ||
17292 | `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object. | |
17293 | ||
17294 | `GL_INVALID_OPERATION' is generated if `glValidateProgram' is executed | |
17295 | between the execution of `glBegin' and the corresponding execution of | |
17296 | `glEnd'.") | |
8925f36f AW |
17297 | |
17298 | (define-gl-procedure | |
bb894c9d AW |
17299 | ((glVertexAttribPointer |
17300 | (index GLuint) | |
17301 | (size GLint) | |
17302 | (type GLenum) | |
17303 | (normalized GLboolean) | |
17304 | (stride GLsizei) | |
17305 | (pointer *) | |
17306 | -> | |
17307 | void)) | |
3c9b6116 AW |
17308 | "Define an array of generic vertex attribute data. |
17309 | ||
17310 | INDEX | |
17311 | Specifies the index of the generic vertex attribute to be modified. | |
17312 | ||
17313 | SIZE | |
17314 | Specifies the number of components per generic vertex attribute. | |
17315 | Must be 1, 2, 3, or 4. The initial value is 4. | |
17316 | ||
17317 | TYPE | |
17318 | Specifies the data type of each component in the array. Symbolic | |
17319 | constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', | |
17320 | `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or | |
17321 | `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'. | |
17322 | ||
17323 | NORMALIZED | |
17324 | Specifies whether fixed-point data values should be normalized | |
17325 | (`GL_TRUE') or converted directly as fixed-point values | |
17326 | (`GL_FALSE') when they are accessed. | |
17327 | ||
17328 | STRIDE | |
17329 | Specifies the byte offset between consecutive generic vertex | |
17330 | attributes. If STRIDE is 0, the generic vertex attributes are | |
17331 | understood to be tightly packed in the array. The initial value is | |
17332 | 0. | |
17333 | ||
17334 | POINTER | |
17335 | Specifies a pointer to the first component of the first generic | |
17336 | vertex attribute in the array. The initial value is 0. | |
17337 | ||
17338 | `glVertexAttribPointer' specifies the location and data format of the | |
17339 | array of generic vertex attributes at index INDEX to use when rendering. | |
17340 | SIZE specifies the number of components per attribute and must be 1, 2, | |
17341 | 3, or 4. TYPE specifies the data type of each component, and STRIDE | |
17342 | specifies the byte stride from one attribute to the next, allowing | |
17343 | vertices and attributes to be packed into a single array or stored in | |
17344 | separate arrays. If set to `GL_TRUE', NORMALIZED indicates that values | |
17345 | stored in an integer format are to be mapped to the range [-1,1] (for | |
17346 | signed values) or [0,1] (for unsigned values) when they are accessed and | |
17347 | converted to floating point. Otherwise, values will be converted to | |
17348 | floats directly without normalization. | |
17349 | ||
17350 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' | |
17351 | target (see `glBindBuffer') while a generic vertex attribute array is | |
17352 | specified, POINTER is treated as a byte offset into the buffer object's | |
17353 | data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') | |
17354 | is saved as generic vertex attribute array client-side state | |
17355 | (`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING') for index INDEX. | |
17356 | ||
17357 | When a generic vertex attribute array is specified, SIZE, TYPE, | |
17358 | NORMALIZED, STRIDE, and POINTER are saved as client-side state, in | |
17359 | addition to the current vertex array buffer object binding. | |
17360 | ||
17361 | To enable and disable a generic vertex attribute array, call | |
17362 | `glEnableVertexAttribArray' and `glDisableVertexAttribArray' with INDEX. | |
17363 | If enabled, the generic vertex attribute array is used when | |
17364 | `glArrayElement', `glDrawArrays', `glMultiDrawArrays', `glDrawElements', | |
17365 | `glMultiDrawElements', or `glDrawRangeElements' is called. | |
17366 | ||
17367 | `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to | |
17368 | `GL_MAX_VERTEX_ATTRIBS'. | |
17369 | ||
17370 | `GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4. | |
17371 | ||
17372 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
17373 | ||
17374 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
8925f36f AW |
17375 | |
17376 | (define-gl-procedure | |
bb894c9d AW |
17377 | ((glVertexAttrib1s |
17378 | (index GLuint) | |
17379 | (v0 GLshort) | |
17380 | -> | |
17381 | void) | |
17382 | (glVertexAttrib1d | |
17383 | (index GLuint) | |
17384 | (v0 GLdouble) | |
17385 | -> | |
17386 | void) | |
17387 | (glVertexAttrib2s | |
17388 | (index GLuint) | |
17389 | (v0 GLshort) | |
17390 | (v1 GLshort) | |
17391 | -> | |
17392 | void) | |
17393 | (glVertexAttrib2d | |
17394 | (index GLuint) | |
17395 | (v0 GLdouble) | |
17396 | (v1 GLdouble) | |
17397 | -> | |
17398 | void) | |
17399 | (glVertexAttrib3s | |
17400 | (index GLuint) | |
17401 | (v0 GLshort) | |
17402 | (v1 GLshort) | |
17403 | (v2 GLshort) | |
17404 | -> | |
17405 | void) | |
17406 | (glVertexAttrib3d | |
17407 | (index GLuint) | |
17408 | (v0 GLdouble) | |
17409 | (v1 GLdouble) | |
17410 | (v2 GLdouble) | |
17411 | -> | |
17412 | void) | |
17413 | (glVertexAttrib4s | |
17414 | (index GLuint) | |
17415 | (v0 GLshort) | |
17416 | (v1 GLshort) | |
17417 | (v2 GLshort) | |
17418 | (v3 GLshort) | |
17419 | -> | |
17420 | void) | |
17421 | (glVertexAttrib4d | |
17422 | (index GLuint) | |
17423 | (v0 GLdouble) | |
17424 | (v1 GLdouble) | |
17425 | (v2 GLdouble) | |
17426 | (v3 GLdouble) | |
17427 | -> | |
17428 | void) | |
17429 | (glVertexAttrib4Nub | |
17430 | (index GLuint) | |
17431 | (v0 GLubyte) | |
17432 | (v1 GLubyte) | |
17433 | (v2 GLubyte) | |
17434 | (v3 GLubyte) | |
17435 | -> | |
17436 | void)) | |
3c9b6116 AW |
17437 | "Specifies the value of a generic vertex attribute. |
17438 | ||
17439 | INDEX | |
17440 | Specifies the index of the generic vertex attribute to be modified. | |
17441 | ||
17442 | V0, V1, V2, V3 | |
17443 | Specifies the new values to be used for the specified vertex | |
17444 | attribute. | |
17445 | ||
17446 | OpenGL defines a number of standard vertex attributes that applications | |
17447 | can modify with standard API entry points (color, normal, texture | |
17448 | coordinates, etc.). The `glVertexAttrib' family of entry points allows | |
17449 | an application to pass generic vertex attributes in numbered locations. | |
17450 | ||
17451 | Generic attributes are defined as four-component values that are | |
17452 | organized into an array. The first entry of this array is numbered 0, | |
17453 | and the size of the array is specified by the implementation-dependent | |
17454 | constant `GL_MAX_VERTEX_ATTRIBS'. Individual elements of this array can | |
17455 | be modified with a `glVertexAttrib' call that specifies the index of the | |
17456 | element to be modified and a value for that element. | |
17457 | ||
17458 | These commands can be used to specify one, two, three, or all four | |
17459 | components of the generic vertex attribute specified by INDEX. A `1' in | |
17460 | the name of the command indicates that only one value is passed, and it | |
17461 | will be used to modify the first component of the generic vertex | |
17462 | attribute. The second and third components will be set to 0, and the | |
17463 | fourth component will be set to 1. Similarly, a `2' in the name of the | |
17464 | command indicates that values are provided for the first two components, | |
17465 | the third component will be set to 0, and the fourth component will be | |
17466 | set to 1. A `3' in the name of the command indicates that values are | |
17467 | provided for the first three components and the fourth component will be | |
17468 | set to 1, whereas a `4' in the name indicates that values are provided | |
17469 | for all four components. | |
17470 | ||
17471 | The letters `s', `f', `i', `d', `ub', `us', and `ui' indicate whether | |
17472 | the arguments are of type short, float, int, double, unsigned byte, | |
17473 | unsigned short, or unsigned int. When `v' is appended to the name, the | |
17474 | commands can take a pointer to an array of such values. The commands | |
17475 | containing `N' indicate that the arguments will be passed as fixed-point | |
17476 | values that are scaled to a normalized range according to the component | |
17477 | conversion rules defined by the OpenGL specification. Signed values are | |
17478 | understood to represent fixed-point values in the range [-1,1], and | |
17479 | unsigned values are understood to represent fixed-point values in the | |
17480 | range [0,1]. | |
17481 | ||
17482 | OpenGL Shading Language attribute variables are allowed to be of type | |
17483 | mat2, mat3, or mat4. Attributes of these types may be loaded using the | |
17484 | `glVertexAttrib' entry points. Matrices must be loaded into successive | |
17485 | generic attribute slots in column major order, with one column of the | |
17486 | matrix in each generic attribute slot. | |
17487 | ||
17488 | A user-defined attribute variable declared in a vertex shader can be | |
17489 | bound to a generic attribute index by calling `glBindAttribLocation'. | |
17490 | This allows an application to use more descriptive variable names in a | |
17491 | vertex shader. A subsequent change to the specified generic vertex | |
17492 | attribute will be immediately reflected as a change to the corresponding | |
17493 | attribute variable in the vertex shader. | |
17494 | ||
17495 | The binding between a generic vertex attribute index and a user-defined | |
17496 | attribute variable in a vertex shader is part of the state of a program | |
17497 | object, but the current value of the generic vertex attribute is not. | |
17498 | The value of each generic vertex attribute is part of current state, | |
17499 | just like standard vertex attributes, and it is maintained even if a | |
17500 | different program object is used. | |
17501 | ||
17502 | An application may freely modify generic vertex attributes that are not | |
17503 | bound to a named vertex shader attribute variable. These values are | |
17504 | simply maintained as part of current state and will not be accessed by | |
17505 | the vertex shader. If a generic vertex attribute bound to an attribute | |
17506 | variable in a vertex shader is not updated while the vertex shader is | |
17507 | executing, the vertex shader will repeatedly use the current value for | |
17508 | the generic vertex attribute. | |
17509 | ||
17510 | The generic vertex attribute with index 0 is the same as the vertex | |
17511 | position attribute previously defined by OpenGL. A `glVertex2', | |
17512 | `glVertex3', or `glVertex4' command is completely equivalent to the | |
17513 | corresponding `glVertexAttrib' command with an index argument of 0. A | |
17514 | vertex shader can access generic vertex attribute 0 by using the | |
17515 | built-in attribute variable GL_VERTEX. There are no current values for | |
17516 | generic vertex attribute 0. This is the only generic vertex attribute | |
17517 | with this property; calls to set other standard vertex attributes can be | |
17518 | freely mixed with calls to set any of the other generic vertex | |
17519 | attributes. | |
17520 | ||
17521 | `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to | |
17522 | `GL_MAX_VERTEX_ATTRIBS'.") | |
8925f36f AW |
17523 | |
17524 | (define-gl-procedure | |
bb894c9d AW |
17525 | ((glVertexPointer |
17526 | (size GLint) | |
17527 | (type GLenum) | |
17528 | (stride GLsizei) | |
17529 | (pointer *) | |
17530 | -> | |
17531 | void)) | |
3c9b6116 AW |
17532 | "Define an array of vertex data. |
17533 | ||
17534 | SIZE | |
17535 | Specifies the number of coordinates per vertex. Must be 2, 3, or 4. | |
17536 | The initial value is 4. | |
17537 | ||
17538 | TYPE | |
17539 | Specifies the data type of each coordinate in the array. Symbolic | |
17540 | constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are | |
17541 | accepted. The initial value is `GL_FLOAT'. | |
17542 | ||
17543 | STRIDE | |
17544 | Specifies the byte offset between consecutive vertices. If STRIDE | |
17545 | is 0, the vertices are understood to be tightly packed in the | |
17546 | array. The initial value is 0. | |
17547 | ||
17548 | POINTER | |
17549 | Specifies a pointer to the first coordinate of the first vertex in | |
17550 | the array. The initial value is 0. | |
17551 | ||
17552 | `glVertexPointer' specifies the location and data format of an array of | |
17553 | vertex coordinates to use when rendering. SIZE specifies the number of | |
17554 | coordinates per vertex, and must be 2, 3, or 4. TYPE specifies the data | |
17555 | type of each coordinate, and STRIDE specifies the byte stride from one | |
17556 | vertex to the next, allowing vertices and attributes to be packed into a | |
17557 | single array or stored in separate arrays. (Single-array storage may be | |
17558 | more efficient on some implementations; see `glInterleavedArrays'.) | |
17559 | ||
17560 | If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER' | |
17561 | target (see `glBindBuffer') while a vertex array is specified, POINTER | |
17562 | is treated as a byte offset into the buffer object's data store. Also, | |
17563 | the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as vertex | |
17564 | array client-side state (`GL_VERTEX_ARRAY_BUFFER_BINDING'). | |
17565 | ||
17566 | When a vertex array is specified, SIZE, TYPE, STRIDE, and POINTER are | |
17567 | saved as client-side state, in addition to the current vertex array | |
17568 | buffer object binding. | |
17569 | ||
17570 | To enable and disable the vertex array, call `glEnableClientState' and | |
17571 | `glDisableClientState' with the argument `GL_VERTEX_ARRAY'. If enabled, | |
17572 | the vertex array is used when `glArrayElement', `glDrawArrays', | |
17573 | `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', or | |
17574 | `glDrawRangeElements' is called. | |
17575 | ||
17576 | `GL_INVALID_VALUE' is generated if SIZE is not 2, 3, or 4. | |
17577 | ||
17578 | `GL_INVALID_ENUM' is generated if TYPE is not an accepted value. | |
17579 | ||
17580 | `GL_INVALID_VALUE' is generated if STRIDE is negative.") | |
8925f36f AW |
17581 | |
17582 | (define-gl-procedure | |
bb894c9d AW |
17583 | ((glVertex2i (x GLint) (y GLint) -> void) |
17584 | (glVertex2d (x GLdouble) (y GLdouble) -> void) | |
17585 | (glVertex3i | |
17586 | (x GLint) | |
17587 | (y GLint) | |
17588 | (z GLint) | |
17589 | -> | |
17590 | void) | |
17591 | (glVertex3d | |
17592 | (x GLdouble) | |
17593 | (y GLdouble) | |
17594 | (z GLdouble) | |
17595 | -> | |
17596 | void) | |
17597 | (glVertex4i | |
17598 | (x GLint) | |
17599 | (y GLint) | |
17600 | (z GLint) | |
17601 | (w GLint) | |
17602 | -> | |
17603 | void) | |
17604 | (glVertex4d | |
17605 | (x GLdouble) | |
17606 | (y GLdouble) | |
17607 | (z GLdouble) | |
17608 | (w GLdouble) | |
17609 | -> | |
17610 | void)) | |
3c9b6116 AW |
17611 | "Specify a vertex. |
17612 | ||
17613 | X | |
17614 | Y | |
17615 | ||
17616 | Z | |
17617 | ||
17618 | W | |
17619 | ||
17620 | Specify X, Y, Z, and W coordinates of a vertex. Not all parameters | |
17621 | are present in all forms of the command. | |
17622 | ||
17623 | `glVertex' commands are used within `glBegin'/`glEnd' pairs to specify | |
17624 | point, line, and polygon vertices. The current color, normal, texture | |
17625 | coordinates, and fog coordinate are associated with the vertex when | |
17626 | `glVertex' is called. | |
17627 | ||
17628 | When only X and Y are specified, Z defaults to 0 and W defaults to 1. | |
17629 | When X , Y , and Z are specified, W defaults to 1.") | |
8925f36f AW |
17630 | |
17631 | (define-gl-procedure | |
bb894c9d AW |
17632 | ((glViewport |
17633 | (x GLint) | |
17634 | (y GLint) | |
17635 | (width GLsizei) | |
17636 | (height GLsizei) | |
17637 | -> | |
17638 | void)) | |
3c9b6116 AW |
17639 | "Set the viewport. |
17640 | ||
17641 | X | |
17642 | Y | |
17643 | ||
17644 | Specify the lower left corner of the viewport rectangle, in pixels. | |
17645 | The initial value is (0,0). | |
17646 | ||
17647 | WIDTH | |
17648 | HEIGHT | |
17649 | ||
17650 | Specify the width and height of the viewport. When a GL context is | |
17651 | first attached to a window, WIDTH and HEIGHT are set to the | |
17652 | dimensions of that window. | |
17653 | ||
17654 | `glViewport' specifies the affine transformation of X and Y from | |
17655 | normalized device coordinates to window coordinates. Let (X_ND,Y_ND) be | |
17656 | normalized device coordinates. Then the window coordinates (X_W,Y_W) are | |
17657 | computed as follows: | |
17658 | ||
17659 | X_W=(X_ND+1,)\u2062(WIDTH/2,)+X | |
17660 | ||
17661 | Y_W=(Y_ND+1,)\u2062(HEIGHT/2,)+Y | |
17662 | ||
17663 | Viewport width and height are silently clamped to a range that depends | |
17664 | on the implementation. To query this range, call `glGet' with argument | |
17665 | `GL_MAX_VIEWPORT_DIMS'. | |
17666 | ||
17667 | `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative. | |
17668 | ||
17669 | `GL_INVALID_OPERATION' is generated if `glViewport' is executed between | |
17670 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f AW |
17671 | |
17672 | (define-gl-procedure | |
bb894c9d AW |
17673 | ((glWindowPos2i (x GLint) (y GLint) -> void) |
17674 | (glWindowPos2d (x GLdouble) (y GLdouble) -> void) | |
17675 | (glWindowPos3i | |
17676 | (x GLint) | |
17677 | (y GLint) | |
17678 | (z GLint) | |
17679 | -> | |
17680 | void) | |
17681 | (glWindowPos3d | |
17682 | (x GLdouble) | |
17683 | (y GLdouble) | |
17684 | (z GLdouble) | |
17685 | -> | |
17686 | void)) | |
3c9b6116 AW |
17687 | "Specify the raster position in window coordinates for pixel operations. |
17688 | ||
17689 | X | |
17690 | Y | |
17691 | ||
17692 | Z | |
17693 | ||
17694 | Specify the X , Y , Z coordinates for the raster position. | |
17695 | ||
17696 | The GL maintains a 3D position in window coordinates. This position, | |
17697 | called the raster position, is used to position pixel and bitmap write | |
17698 | operations. It is maintained with subpixel accuracy. See `glBitmap', | |
17699 | `glDrawPixels', and `glCopyPixels'. | |
17700 | ||
17701 | `glWindowPos2' specifies the X and Y coordinates, while Z is implicitly | |
17702 | set to 0. `glWindowPos3' specifies all three coordinates. The W | |
17703 | coordinate of the current raster position is always set to 1.0. | |
17704 | ||
17705 | `glWindowPos' directly updates the X and Y coordinates of the current | |
17706 | raster position with the values specified. That is, the values are | |
17707 | neither transformed by the current modelview and projection matrices, | |
17708 | nor by the viewport-to-window transform. The Z coordinate of the current | |
17709 | raster position is updated in the following manner: | |
17710 | ||
17711 | Z={(N), (F), (N+Z×(F-N,),)\u2062(IF\u2062Z<=0), (IF\u2062Z>=1), (`otherwise',), | |
17712 | ||
17713 | ||
17714 | ||
17715 | where N is `GL_DEPTH_RANGE''s near value, and F is `GL_DEPTH_RANGE''s | |
17716 | far value. See `glDepthRange'. | |
17717 | ||
17718 | The specified coordinates are not clip-tested, causing the raster | |
17719 | position to always be valid. | |
17720 | ||
8925f36f | 17721 | The current raster position also includes some associated color data and |
3c9b6116 AW |
17722 | texture coordinates. If lighting is enabled, then |
17723 | `GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX' | |
8925f36f | 17724 | (in color index mode) is set to the color produced by the lighting |
3c9b6116 AW |
17725 | calculation (see `glLight', `glLightModel', and `glShadeModel'). If |
17726 | lighting is disabled, current color (in RGBA mode, state variable | |
17727 | `GL_CURRENT_COLOR') or color index (in color index mode, state variable | |
17728 | `GL_CURRENT_INDEX') is used to update the current raster color. | |
17729 | `GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated. | |
17730 | ||
17731 | Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of | |
17732 | `GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture | |
17733 | generation functions (see `glTexGen'). The `GL_CURRENT_RASTER_DISTANCE' | |
17734 | is set to the `GL_CURRENT_FOG_COORD'. | |
17735 | ||
17736 | ||
17737 | ||
17738 | `GL_INVALID_OPERATION' is generated if `glWindowPos' is executed between | |
17739 | the execution of `glBegin' and the corresponding execution of `glEnd'.") | |
8925f36f | 17740 |